| Index: trunk/Source/core/dom/ScriptLoader.h
|
| ===================================================================
|
| --- trunk/Source/core/dom/ScriptLoader.h (revision 174070)
|
| +++ trunk/Source/core/dom/ScriptLoader.h (working copy)
|
| @@ -22,9 +22,7 @@
|
| #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"
|
|
|
| @@ -35,31 +33,10 @@
|
| class Document;
|
| class Element;
|
| class ScriptLoaderClient;
|
| -class ScriptRunner;
|
| class ScriptSourceCode;
|
|
|
| -class ScriptPrep FINAL {
|
| -public:
|
| - ScriptPrep(bool succeeded, const ResourcePtr<ScriptResource>& resource)
|
| - : m_succeeded(succeeded)
|
| - , m_resource(resource)
|
| - { }
|
|
|
| - bool succeeded() const { return m_succeeded; }
|
| - ScriptResource* resource() const { return m_resource.get(); }
|
| -
|
| - static ScriptPrep failed() { return ScriptPrep(); }
|
| -
|
| -private:
|
| - ScriptPrep()
|
| - : m_succeeded(false)
|
| - { }
|
| -
|
| - bool m_succeeded;
|
| - ResourcePtr<ScriptResource> m_resource;
|
| -};
|
| -
|
| -class ScriptLoader FINAL : public ResourceOwner<ScriptResource> {
|
| +class ScriptLoader FINAL : private ResourceClient {
|
| public:
|
| static PassOwnPtr<ScriptLoader> create(Element*, bool createdByParser, bool isEvaluated);
|
| virtual ~ScriptLoader();
|
| @@ -67,7 +44,7 @@
|
| Element* element() const { return m_element; }
|
|
|
| enum LegacyTypeSupport { DisallowLegacyTypeInTypeAttribute, AllowLegacyTypeInTypeAttribute };
|
| - ScriptPrep prepareScript(const TextPosition& scriptStartPosition = TextPosition::minimumPosition(), LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute);
|
| + bool prepareScript(const TextPosition& scriptStartPosition = TextPosition::minimumPosition(), LegacyTypeSupport = DisallowLegacyTypeInTypeAttribute);
|
|
|
| String scriptCharset() const { return m_characterEncoding; }
|
| String scriptContent() const;
|
| @@ -83,6 +60,7 @@
|
| 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; }
|
| @@ -102,7 +80,8 @@
|
| bool ignoresLoadRequest() const;
|
| bool isScriptForEventSupported() const;
|
|
|
| - ResourcePtr<ScriptResource> fetchScript(const String& sourceUrl);
|
| + bool fetchScript(const String& sourceUrl);
|
| + void stopLoadRequest();
|
|
|
| ScriptLoaderClient* client() const;
|
|
|
| @@ -116,9 +95,9 @@
|
| };
|
|
|
| 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;
|
|
|