New issue
Advanced search Search tips

Issue 906898 link

Starred by 4 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Consider splitting TextResourceDecoder into multiple classes

Project Member Reported by hirosh...@chromium.org, Nov 20

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.

 
I am interested in this one. 
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