diff options
author | win7-7 <win7-7@users.noreply.github.com> | 2019-07-05 21:58:21 +0300 |
---|---|---|
committer | win7-7 <win7-7@users.noreply.github.com> | 2019-07-05 21:58:21 +0300 |
commit | 7c5a0db237c7a43136ee3cdc6cfb0663778d9e2c (patch) | |
tree | 9cd5a806763b73bed3fef3d599f32b525f4c0d7a /parser/html/nsHtml5Tokenizer.h | |
parent | 0e54a032624b4ce23a959454047bfd504a734cc0 (diff) | |
download | uxp-7c5a0db237c7a43136ee3cdc6cfb0663778d9e2c.tar.gz |
Introduce a new non-heap-allocated type for holding nsStringBuffer* in the HTML parser.
An innerHTML setter profile shows about 10% of the time being spent under nsHtml5HtmlAttributes::clear, mostly deleting nsStrings.
Diffstat (limited to 'parser/html/nsHtml5Tokenizer.h')
-rw-r--r-- | parser/html/nsHtml5Tokenizer.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/parser/html/nsHtml5Tokenizer.h b/parser/html/nsHtml5Tokenizer.h index da509b69b4..00cca9a9c1 100644 --- a/parser/html/nsHtml5Tokenizer.h +++ b/parser/html/nsHtml5Tokenizer.h @@ -33,7 +33,7 @@ #include "nsIAtom.h" #include "nsHtml5AtomTable.h" -#include "nsString.h" +#include "nsHtml5String.h" #include "nsIContent.h" #include "nsTraceRefcnt.h" #include "jArray.h" @@ -106,8 +106,8 @@ class nsHtml5Tokenizer protected: int32_t cstart; private: - nsString* publicId; - nsString* systemId; + nsHtml5String publicId; + nsHtml5String systemId; autoJArray<char16_t,int32_t> strBuf; int32_t strBufLen; autoJArray<char16_t,int32_t> charRefBuf; @@ -126,8 +126,8 @@ class nsHtml5Tokenizer nsHtml5AttributeName* attributeName; private: nsIAtom* doctypeName; - nsString* publicIdentifier; - nsString* systemIdentifier; + nsHtml5String publicIdentifier; + nsHtml5String systemIdentifier; nsHtml5HtmlAttributes* attributes; bool newAttributesEachTime; bool shouldSuspend; @@ -141,7 +141,7 @@ class nsHtml5Tokenizer public: nsHtml5Tokenizer(nsHtml5TreeBuilder* tokenHandler, bool viewingXmlSource); void setInterner(nsHtml5AtomTable* interner); - void initLocation(nsString* newPublicId, nsString* newSystemId); + void initLocation(nsHtml5String newPublicId, nsHtml5String newSystemId); bool isViewingXmlSource(); void setStateAndEndTagExpectation(int32_t specialTokenizerState, nsIAtom* endTagExpectation); void setStateAndEndTagExpectation(int32_t specialTokenizerState, nsHtml5ElementName* endTagExpectation); @@ -193,7 +193,7 @@ class nsHtml5Tokenizer } protected: - nsString* strBufToString(); + nsHtml5String strBufToString(); private: void strBufToDoctypeName(); void emitStrBuf(); @@ -285,7 +285,7 @@ class nsHtml5Tokenizer } public: - bool internalEncodingDeclaration(nsString* internalCharset); + bool internalEncodingDeclaration(nsHtml5String internalCharset); private: void emitOrAppendTwo(const char16_t* val, int32_t returnState); void emitOrAppendOne(const char16_t* val, int32_t returnState); |