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

Side by Side Diff: third_party/WebKit/Source/core/dom/ScriptLoader.h

Issue 2549143009: Create PendingScriptClient as a separate client interface for PendingScript. (Closed)
Patch Set: . Created 4 years 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) 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 20 matching lines...) Expand all
31 #include "wtf/text/WTFString.h" 31 #include "wtf/text/WTFString.h"
32 32
33 namespace blink { 33 namespace blink {
34 34
35 class Element; 35 class Element;
36 class ScriptLoaderClient; 36 class ScriptLoaderClient;
37 class ScriptSourceCode; 37 class ScriptSourceCode;
38 class LocalFrame; 38 class LocalFrame;
39 39
40 class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>, 40 class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>,
41 public ScriptResourceClient { 41 public PendingScriptClient {
42 USING_GARBAGE_COLLECTED_MIXIN(ScriptLoader); 42 USING_GARBAGE_COLLECTED_MIXIN(ScriptLoader);
43 43
44 public: 44 public:
45 static ScriptLoader* create(Element* element, 45 static ScriptLoader* create(Element* element,
46 bool createdByParser, 46 bool createdByParser,
47 bool isEvaluated, 47 bool isEvaluated,
48 bool createdDuringDocumentWrite = false) { 48 bool createdDuringDocumentWrite = false) {
49 return new ScriptLoader(element, createdByParser, isEvaluated, 49 return new ScriptLoader(element, createdByParser, isEvaluated,
50 createdDuringDocumentWrite); 50 createdDuringDocumentWrite);
51 } 51 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 private: 127 private:
128 bool ignoresLoadRequest() const; 128 bool ignoresLoadRequest() const;
129 bool isScriptForEventSupported() const; 129 bool isScriptForEventSupported() const;
130 void logScriptMIMEType(LocalFrame*, ScriptResource*, const String&); 130 void logScriptMIMEType(LocalFrame*, ScriptResource*, const String&);
131 131
132 bool fetchScript(const String& sourceUrl, FetchRequest::DeferOption); 132 bool fetchScript(const String& sourceUrl, FetchRequest::DeferOption);
133 bool doExecuteScript(const ScriptSourceCode&); 133 bool doExecuteScript(const ScriptSourceCode&);
134 134
135 ScriptLoaderClient* client() const; 135 ScriptLoaderClient* client() const;
136 136
137 // ResourceClient 137 // PendingScriptClient
138 void notifyFinished(Resource*) override; 138 void pendingScriptFinished(PendingScript*) override;
139 String debugName() const override { return "ScriptLoader"; }
140 139
141 Member<Element> m_element; 140 Member<Element> m_element;
142 Member<ScriptResource> m_resource; 141 Member<ScriptResource> m_resource;
143 WTF::OrdinalNumber m_startLineNumber; 142 WTF::OrdinalNumber m_startLineNumber;
144 String m_characterEncoding; 143 String m_characterEncoding;
145 String m_fallbackCharacterEncoding; 144 String m_fallbackCharacterEncoding;
146 145
147 bool m_parserInserted : 1; 146 bool m_parserInserted : 1;
148 bool m_isExternalScript : 1; 147 bool m_isExternalScript : 1;
149 bool m_alreadyStarted : 1; 148 bool m_alreadyStarted : 1;
(...skipping 22 matching lines...) Expand all
172 DocumentWriteIntervention m_documentWriteIntervention; 171 DocumentWriteIntervention m_documentWriteIntervention;
173 172
174 Member<PendingScript> m_pendingScript; 173 Member<PendingScript> m_pendingScript;
175 }; 174 };
176 175
177 ScriptLoader* toScriptLoaderIfPossible(Element*); 176 ScriptLoader* toScriptLoaderIfPossible(Element*);
178 177
179 } // namespace blink 178 } // namespace blink
180 179
181 #endif // ScriptLoader_h 180 #endif // ScriptLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698