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

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

Issue 2821553002: Refactor code around ScriptLoader::FetchScript() according to the spec (Closed)
Patch Set: Rebase Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ScriptLoader.h
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.h b/third_party/WebKit/Source/core/dom/ScriptLoader.h
index 001309da07569b21fc1fc4b2dc4da98e6b01420b..ec3032bc4ae816e6d5d0cf009e870328dccac554 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.h
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.h
@@ -25,17 +25,20 @@
#include "core/dom/PendingScript.h"
#include "core/dom/Script.h"
#include "core/dom/ScriptRunner.h"
-#include "core/loader/resource/ScriptResource.h"
-#include "platform/loader/fetch/FetchParameters.h"
-#include "platform/loader/fetch/ResourceClient.h"
+#include "core/html/CrossOriginAttribute.h"
+#include "platform/loader/fetch/ResourceLoaderOptions.h"
#include "platform/wtf/text/TextPosition.h"
#include "platform/wtf/text/WTFString.h"
+#include "public/platform/WebURLRequest.h"
namespace blink {
class ScriptElementBase;
class Script;
+class ResourceFetcher;
+class ScriptResource;
+
class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>,
public PendingScriptClient {
USING_GARBAGE_COLLECTED_MIXIN(ScriptLoader);
@@ -70,7 +73,7 @@ class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>,
String ScriptContent() const;
// Creates a PendingScript for external script whose fetch is started in
- // fetchScript().
+ // FetchClassicScript().
PendingScript* CreatePendingScript();
// Returns false if and only if execution was blocked.
@@ -132,9 +135,20 @@ class CORE_EXPORT ScriptLoader : public GarbageCollectedFinalized<ScriptLoader>,
bool IgnoresLoadRequest() const;
bool IsScriptForEventSupported() const;
- bool FetchScript(const String& source_url,
- const String& encoding,
- FetchParameters::DeferOption);
+ // FetchClassicScript corresponds to Step 21.6 of
+ // https://html.spec.whatwg.org/#prepare-a-script
+ // and must NOT be called from outside of PendingScript().
+ //
+ // https://html.spec.whatwg.org/#fetch-a-classic-script
+ bool FetchClassicScript(const KURL&,
+ ResourceFetcher*,
+ const String& nonce,
+ const IntegrityMetadataSet&,
+ ParserDisposition,
+ CrossOriginAttributeValue,
+ SecurityOrigin*,
+ const String& encoding);
+
bool DoExecuteScript(const Script*);
// Clears the connection to the PendingScript.
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698