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

Unified Diff: Source/core/dom/ScriptLoader.h

Issue 271533002: Make ScriptLoader into a ResourceOwner (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/ScriptLoader.h
diff --git a/Source/core/dom/ScriptLoader.h b/Source/core/dom/ScriptLoader.h
index a862e33b5b1a75bf0655ce3f245b7fb970043cb4..094728ff0b364fe79587c3e75f57b3f8c77ad6c0 100644
--- a/Source/core/dom/ScriptLoader.h
+++ b/Source/core/dom/ScriptLoader.h
@@ -22,7 +22,9 @@
#define ScriptLoader_h
#include "core/fetch/ResourceClient.h"
+#include "core/fetch/ResourceOwner.h"
#include "core/fetch/ResourcePtr.h"
+#include "core/fetch/ScriptResource.h"
#include "wtf/text/TextPosition.h"
#include "wtf/text/WTFString.h"
@@ -33,10 +35,10 @@ class ContainerNode;
class Document;
class Element;
class ScriptLoaderClient;
+class ScriptRunner;
class ScriptSourceCode;
-
-class ScriptLoader FINAL : private ResourceClient {
+class ScriptLoader FINAL : public ResourceOwner<ScriptResource> {
public:
static PassOwnPtr<ScriptLoader> create(Element*, bool createdByParser, bool isEvaluated);
virtual ~ScriptLoader();
@@ -44,7 +46,7 @@ public:
Element* element() const { return m_element; }
enum LegacyTypeSupport { DisallowLegacyTypeInTypeAttribute, AllowLegacyTypeInTypeAttribute };
- bool prepareScript(const TextPosition& scriptStartPosition = TextPosition::minimumPosition(), LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute);
+ bool prepareScript(ResourcePtr<ScriptResource>* = 0, const TextPosition& scriptStartPosition = TextPosition::minimumPosition(), LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute);
Nate Chapin 2014/05/07 18:13:10 It looks like the return value will be false if th
Hajime Morrita 2014/05/07 18:27:28 Sometimes it can be true but return null. I agree
String scriptCharset() const { return m_characterEncoding; }
String scriptContent() const;
@@ -60,7 +62,6 @@ public:
bool willBeParserExecuted() const { return m_willBeParserExecuted; }
bool readyToBeParserExecuted() const { return m_readyToBeParserExecuted; }
bool willExecuteWhenDocumentFinishedParsing() const { return m_willExecuteWhenDocumentFinishedParsing; }
- ResourcePtr<ScriptResource> resource() { return m_resource; }
void setHaveFiredLoadEvent(bool haveFiredLoad) { m_haveFiredLoad = haveFiredLoad; }
bool isParserInserted() const { return m_parserInserted; }
@@ -80,8 +81,7 @@ private:
bool ignoresLoadRequest() const;
bool isScriptForEventSupported() const;
- bool fetchScript(const String& sourceUrl);
- void stopLoadRequest();
+ ResourcePtr<ScriptResource> fetchScript(const String& sourceUrl);
ScriptLoaderClient* client() const;
@@ -95,9 +95,9 @@ private:
};
void finishLoading(Document* contextDocument, FinishType);
+ void notifyRunnerFinishLoading(ScriptRunner*, FinishType);
Element* m_element;
- ResourcePtr<ScriptResource> m_resource;
WTF::OrdinalNumber m_startLineNumber;
bool m_parserInserted : 1;
bool m_isExternalScript : 1;

Powered by Google App Engine
This is Rietveld 408576698