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

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

Issue 69823002: Move ownership of the TextResourceDecoder to DecodedDataDocumentParser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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
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.
11 * 11 *
12 * This library is distributed in the hope that it will be useful, 12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details. 15 * Library General Public License for more details.
16 * 16 *
17 * You should have received a copy of the GNU Library General Public License 17 * You should have received a copy of the GNU Library General Public License
18 * along with this library; see the file COPYING.LIB. If not, write to 18 * along with this library; see the file COPYING.LIB. If not, write to
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA. 20 * Boston, MA 02110-1301, USA.
21 * 21 *
22 */ 22 */
23 23
24 #ifndef DocumentParser_h 24 #ifndef DocumentParser_h
25 #define DocumentParser_h 25 #define DocumentParser_h
26 26
27 #include "wtf/Forward.h" 27 #include "wtf/Forward.h"
28 #include "wtf/RefCounted.h" 28 #include "wtf/RefCounted.h"
29 #include "wtf/RefPtr.h"
29 30
30 namespace WebCore { 31 namespace WebCore {
31 32
32 class Document; 33 class Document;
33 class DocumentWriter; 34 class DocumentWriter;
34 class SegmentedString; 35 class SegmentedString;
35 class ScriptableDocumentParser; 36 class ScriptableDocumentParser;
37 class TextResourceDecoder;
36 38
37 class DocumentParser : public RefCounted<DocumentParser> { 39 class DocumentParser : public RefCounted<DocumentParser> {
38 public: 40 public:
39 virtual ~DocumentParser(); 41 virtual ~DocumentParser();
40 42
41 virtual ScriptableDocumentParser* asScriptableDocumentParser() { return 0; } 43 virtual ScriptableDocumentParser* asScriptableDocumentParser() { return 0; }
42 44
43 // http://www.whatwg.org/specs/web-apps/current-work/#insertion-point 45 // http://www.whatwg.org/specs/web-apps/current-work/#insertion-point
44 virtual bool hasInsertionPoint() { return true; } 46 virtual bool hasInsertionPoint() { return true; }
45 47
46 // insert is used by document.write. 48 // insert is used by document.write.
47 virtual void insert(const SegmentedString&) = 0; 49 virtual void insert(const SegmentedString&) = 0;
48 50
49 // appendBytes and flush are used by DocumentWriter (the loader). 51 // appendBytes and flush are used by DocumentWriter (the loader).
50 virtual size_t appendBytes(const char* bytes, size_t length) = 0; 52 virtual size_t appendBytes(const char* bytes, size_t length) = 0;
51 virtual size_t flush() = 0; 53 virtual size_t flush() = 0;
52 virtual bool needsDecoder() const { return false; } 54 virtual bool needsDecoder() const { return false; }
55 virtual void setDecoder(PassRefPtr<TextResourceDecoder>) { ASSERT_NOT_REACHE D(); }
53 56
54 // pinToMainThread also makes append() not yield before completion of that c hunk. 57 // pinToMainThread also makes append() not yield before completion of that c hunk.
55 virtual void pinToMainThread() { } 58 virtual void pinToMainThread() { }
56 59
57 // FIXME: append() should be private, but DocumentWriter::replaceDocument us es it for now. 60 // FIXME: append() should be private, but DocumentWriter::replaceDocument us es it for now.
58 // FIXME: This really should take a PassOwnPtr to signify that it expects to take 61 // FIXME: This really should take a PassOwnPtr to signify that it expects to take
59 // ownership of the buffer. The parser expects the PassRefPtr to hold the on ly ref of the StringImpl. 62 // ownership of the buffer. The parser expects the PassRefPtr to hold the on ly ref of the StringImpl.
60 virtual void append(PassRefPtr<StringImpl>) = 0; 63 virtual void append(PassRefPtr<StringImpl>) = 0;
61 64
62 virtual void finish() = 0; 65 virtual void finish() = 0;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 bool m_documentWasLoadedAsPartOfNavigation; 118 bool m_documentWasLoadedAsPartOfNavigation;
116 119
117 // Every DocumentParser needs a pointer back to the document. 120 // Every DocumentParser needs a pointer back to the document.
118 // m_document will be 0 after the parser is stopped. 121 // m_document will be 0 after the parser is stopped.
119 Document* m_document; 122 Document* m_document;
120 }; 123 };
121 124
122 } // namespace WebCore 125 } // namespace WebCore
123 126
124 #endif // DocumentParser_h 127 #endif // DocumentParser_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698