Consider splitting TextResourceDecoder into multiple classes |
|
Issue description
TextResourceDecoder contains a bunch of decoding-related code, spanning multiple specs (Encoding, HTML <meta> and parsing, CSS, XHR, etc.).
Splitting TextResourceDecoder into multiple classes (probably by TextResourceDecoderOptions::ContentType) might be beneficial.
The core parts should be still be shared (as a base class or something else), but each part for each spec/usage can be split.
This might
- Make each class simpler.
- Make each class correspond more directly to specs.
- Especially, the class for TextResourceDecoderOptions::kPlainTextContent will look clearly corresponding to some methods in https://encoding.spec.whatwg.org.
- Enable to move some classes to platform/loader or somewhere in platform.
- I feel the class for TextResourceDecoderOptions::kPlainTextContent, which will used from TextResource, should be in platform.
This might be a good-first-bug for those who are interested in the complicated Blink loader infra, as this is a practical example of:
- A basic small-sized C++ refactoring.
- platform/core separation in Blink.
- refactoring for spec conformance and code health.
,
Dec 26
I want to do a refactor using inheritance and |TextResourceDecoderOptions::ContentType|, but not sure how this should be done. Should I override methods for each child class and rewrite all referencies to use new classes instead of base class? |
|
►
Sign in to add a comment |
|
Comment 1 by eui-sang.lim@samsung.com
, Nov 20