Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: Source/core/html/parser/HTMLDocumentParser.h

Issue 277633002: Convert DocumentParser code to Use more reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make TextDocument use reference as well Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/html/TextDocument.cpp ('k') | Source/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2010 Google, Inc. All Rights Reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 class HTMLTreeBuilder; 61 class HTMLTreeBuilder;
62 class HTMLResourcePreloader; 62 class HTMLResourcePreloader;
63 class ScriptController; 63 class ScriptController;
64 class ScriptSourceCode; 64 class ScriptSourceCode;
65 65
66 class PumpSession; 66 class PumpSession;
67 67
68 class HTMLDocumentParser : public ScriptableDocumentParser, HTMLScriptRunnerHos t, ResourceClient { 68 class HTMLDocumentParser : public ScriptableDocumentParser, HTMLScriptRunnerHos t, ResourceClient {
69 WTF_MAKE_FAST_ALLOCATED; 69 WTF_MAKE_FAST_ALLOCATED;
70 public: 70 public:
71 static PassRefPtr<HTMLDocumentParser> create(HTMLDocument* document, bool re portErrors) 71 static PassRefPtr<HTMLDocumentParser> create(HTMLDocument& document, bool re portErrors)
72 { 72 {
73 return adoptRef(new HTMLDocumentParser(document, reportErrors)); 73 return adoptRef(new HTMLDocumentParser(document, reportErrors));
74 } 74 }
75 virtual ~HTMLDocumentParser(); 75 virtual ~HTMLDocumentParser();
76 76
77 // Exposed for HTMLParserScheduler 77 // Exposed for HTMLParserScheduler
78 void resumeParsingAfterYield(); 78 void resumeParsingAfterYield();
79 79
80 static void parseDocumentFragment(const String&, DocumentFragment*, Element* contextElement, ParserContentPolicy = AllowScriptingContent); 80 static void parseDocumentFragment(const String&, DocumentFragment*, Element* contextElement, ParserContentPolicy = AllowScriptingContent);
81 81
(...skipping 21 matching lines...) Expand all
103 virtual void flush() OVERRIDE FINAL; 103 virtual void flush() OVERRIDE FINAL;
104 virtual void setDecoder(PassOwnPtr<TextResourceDecoder>) OVERRIDE FINAL; 104 virtual void setDecoder(PassOwnPtr<TextResourceDecoder>) OVERRIDE FINAL;
105 105
106 UseCounter* useCounter() { return UseCounter::getFrom(contextForParsingSessi on()); } 106 UseCounter* useCounter() { return UseCounter::getFrom(contextForParsingSessi on()); }
107 107
108 protected: 108 protected:
109 virtual void insert(const SegmentedString&) OVERRIDE FINAL; 109 virtual void insert(const SegmentedString&) OVERRIDE FINAL;
110 virtual void append(PassRefPtr<StringImpl>) OVERRIDE; 110 virtual void append(PassRefPtr<StringImpl>) OVERRIDE;
111 virtual void finish() OVERRIDE FINAL; 111 virtual void finish() OVERRIDE FINAL;
112 112
113 HTMLDocumentParser(HTMLDocument*, bool reportErrors); 113 HTMLDocumentParser(HTMLDocument&, bool reportErrors);
114 HTMLDocumentParser(DocumentFragment*, Element* contextElement, ParserContent Policy); 114 HTMLDocumentParser(DocumentFragment*, Element* contextElement, ParserContent Policy);
115 115
116 HTMLTreeBuilder* treeBuilder() const { return m_treeBuilder.get(); } 116 HTMLTreeBuilder* treeBuilder() const { return m_treeBuilder.get(); }
117 117
118 void forcePlaintextForTextDocument(); 118 void forcePlaintextForTextDocument();
119 119
120 private: 120 private:
121 static PassRefPtr<HTMLDocumentParser> create(DocumentFragment* fragment, Ele ment* contextElement, ParserContentPolicy parserContentPolicy) 121 static PassRefPtr<HTMLDocumentParser> create(DocumentFragment* fragment, Ele ment* contextElement, ParserContentPolicy parserContentPolicy)
122 { 122 {
123 return adoptRef(new HTMLDocumentParser(fragment, contextElement, parserC ontentPolicy)); 123 return adoptRef(new HTMLDocumentParser(fragment, contextElement, parserC ontentPolicy));
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 205
206 bool m_isPinnedToMainThread; 206 bool m_isPinnedToMainThread;
207 bool m_endWasDelayed; 207 bool m_endWasDelayed;
208 bool m_haveBackgroundParser; 208 bool m_haveBackgroundParser;
209 unsigned m_pumpSessionNestingLevel; 209 unsigned m_pumpSessionNestingLevel;
210 }; 210 };
211 211
212 } 212 }
213 213
214 #endif 214 #endif
OLDNEW
« no previous file with comments | « Source/core/html/TextDocument.cpp ('k') | Source/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698