GithubHelp home page GithubHelp logo

runrunmeme / chromium Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chromium/-archived-chromium

0.0 1.0 0.0 696.39 MB

Open-source project behind Google Chrome

Home Page: https://www.chromium.org/

chromium's Introduction

chromium's People

Contributors

willnorris avatar

Watchers

 avatar

chromium's Issues

chromium解析meta charset

TextResourceDecoderBuilder类

数据成员:

  • mime_type_ mime类型
  • encoding_ 编码
    成员方法:
  • TextResourceDecoderBuilder
  • ~TextResourceDecoderBuilder 析构
  • CreateDecoderInstance 创建解码器实例
  • SetupEncoding 设置编码
  • BuildFor
    1. 创建解码器 call CreateDecoderInstance
    2. 设置编码 call SetupEncoding
      返回编码器
  • Clear 清除

TextResourceDecoder类

  • [E] EncodingSource
    kDefaultEncoding,
    kAutoDetectedEncoding,
    kEncodingFromContentSniffing,
    kEncodingFromXMLHeader,
    kEncodingFromMetaTag,
    kEncodingFromCSSCharset,
    kEncodingFromHTTPHeader,
    kEncodingFromParentFrame
  • Create 默认编码

  • CreateWithAutoDetection 创建TextResourceDecoder实例,使用自动检测

  • CreateAlwaysUseUTF8ForText 创建TextResourceDecoder实例,使用UTF8

  • SetEncoding 设置encoding_

  • Encoding 返回encoding_

  • bool EncodingWasDetectedHeuristically 是否通过嗅探检测编码

  • Decode

  • Flush
    处理文档已经完全loaded,还确定不了编码的情况
    在使用自动检测编码时,根据文本的编码确定encoding_

  • SetHintEncoding

  • UseLenientXMLDecoding 设置use_lenient_xml_decoding_ 宽容的xml解码

  • SawError 是否有错误

  • CheckForBOM

  • [E] EncodingDetectionOption

  • TextResourceDecoder

  • [E] ContentType

  • DetermineContentType

  • DefaultEncoding 默认编码

  • CheckForCSSCharset

  • CheckForXMLCharset

  • CheckForMetaCharset

  • ShouldAutoDetect

  • ContentType content_type_;

  • WTF::TextEncoding encoding_; 编码

  • std::unique_ptr codec_;

  • EncodingSource source_;
    const char* hint_encoding_;
    const KURL hint_url_;
    Vector buffer_;
    char hint_language_[3];
    bool checked_for_bom_;
    bool checked_for_css_charset_;
    bool checked_for_xml_charset_;
    bool checked_for_meta_charset_;
    bool use_lenient_xml_decoding_; // Don't stop on XML decoding errors.
    bool saw_error_;
    EncodingDetectionOption encoding_detection_option_;

    std::unique_ptr charset_parser_;

HTMLMetaCharsetParser 类

成员方法:

  • Create 创建HTMLMetaCharsetParser实例,使用unique_ptr
  • CheckForMetaCharset
  • Encoding 返回encoding_
  • ProcessMeta 根据meta token,设置encoding_

成员变量:

  • tokenizer_
  • assumed_codec_
  • input_
  • HTMLToken token_
  • bool in_head_section_ 是否位于head里
  • bool done_checking_ 是否完成检测
  • encoding_ 编码

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.