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

Side by Side Diff: Source/core/dom/DocumentParser.h

Issue 473203002: DocumentParser should flush itself on finish (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: needs finish event when stopped Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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) 2000 Peter Kelly (pmk@post.com) 2 * Copyright (C) 2000 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2005, 2006 Apple Computer, Inc. 3 * Copyright (C) 2005, 2006 Apple Computer, Inc.
4 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org) 4 * Copyright (C) 2007 Samuel Weinig (sam@webkit.org)
5 * Copyright (C) 2010 Google, Inc. 5 * Copyright (C) 2010 Google, Inc.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 virtual ScriptableDocumentParser* asScriptableDocumentParser() { return 0; } 43 virtual ScriptableDocumentParser* asScriptableDocumentParser() { return 0; }
44 44
45 // http://www.whatwg.org/specs/web-apps/current-work/#insertion-point 45 // http://www.whatwg.org/specs/web-apps/current-work/#insertion-point
46 virtual bool hasInsertionPoint() { return true; } 46 virtual bool hasInsertionPoint() { return true; }
47 47
48 // insert is used by document.write. 48 // insert is used by document.write.
49 virtual void insert(const SegmentedString&) = 0; 49 virtual void insert(const SegmentedString&) = 0;
50 50
51 // The below functions are used by DocumentWriter (the loader). 51 // The below functions are used by DocumentWriter (the loader).
52 virtual void appendBytes(const char* bytes, size_t length) = 0; 52 virtual void appendBytes(const char* bytes, size_t length) = 0;
53 virtual void flush() = 0;
54 virtual bool needsDecoder() const { return false; } 53 virtual bool needsDecoder() const { return false; }
55 virtual void setDecoder(PassOwnPtr<TextResourceDecoder>); 54 virtual void setDecoder(PassOwnPtr<TextResourceDecoder>);
56 virtual TextResourceDecoder* decoder(); 55 virtual TextResourceDecoder* decoder();
57 virtual void setHasAppendedData() { } 56 virtual void setHasAppendedData() { }
58 57
59 // pinToMainThread also makes append() not yield before completion of that c hunk. 58 // pinToMainThread also makes append() not yield before completion of that c hunk.
60 virtual void pinToMainThread() { } 59 virtual void pinToMainThread() { }
61 60
62 // FIXME: append() should be private, but DocumentWriter::replaceDocument us es it for now. 61 // FIXME: append() should be private, but DocumentWriter::replaceDocument us es it for now.
63 // FIXME: This really should take a PassOwnPtr to signify that it expects to take 62 // FIXME: This really should take a PassOwnPtr to signify that it expects to take
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 void setDocumentWasLoadedAsPartOfNavigation() { m_documentWasLoadedAsPartOfN avigation = true; } 99 void setDocumentWasLoadedAsPartOfNavigation() { m_documentWasLoadedAsPartOfN avigation = true; }
101 bool documentWasLoadedAsPartOfNavigation() const { return m_documentWasLoade dAsPartOfNavigation; } 100 bool documentWasLoadedAsPartOfNavigation() const { return m_documentWasLoade dAsPartOfNavigation; }
102 101
103 // FIXME: The names are not very accurate :( 102 // FIXME: The names are not very accurate :(
104 virtual void suspendScheduledTasks(); 103 virtual void suspendScheduledTasks();
105 virtual void resumeScheduledTasks(); 104 virtual void resumeScheduledTasks();
106 105
107 protected: 106 protected:
108 explicit DocumentParser(Document*); 107 explicit DocumentParser(Document*);
109 108
109 virtual void flush() = 0;
110
110 private: 111 private:
111 enum ParserState { 112 enum ParserState {
112 ParsingState, 113 ParsingState,
113 StoppingState, 114 StoppingState,
114 StoppedState, 115 StoppedState,
115 DetachedState 116 DetachedState
116 }; 117 };
117 ParserState m_state; 118 ParserState m_state;
118 bool m_documentWasLoadedAsPartOfNavigation; 119 bool m_documentWasLoadedAsPartOfNavigation;
119 120
120 // Every DocumentParser needs a pointer back to the document. 121 // Every DocumentParser needs a pointer back to the document.
121 // m_document will be 0 after the parser is stopped. 122 // m_document will be 0 after the parser is stopped.
122 RawPtrWillBeMember<Document> m_document; 123 RawPtrWillBeMember<Document> m_document;
123 }; 124 };
124 125
125 } // namespace blink 126 } // namespace blink
126 127
127 #endif // DocumentParser_h 128 #endif // DocumentParser_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/parser/HTMLDocumentParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698