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

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

Issue 2823483002: Make ModuleScript to have a reference to Modulator explicitly (Closed)
Patch Set: unit tests fix 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
Index: third_party/WebKit/Source/core/dom/ModuleScript.h
diff --git a/third_party/WebKit/Source/core/dom/ModuleScript.h b/third_party/WebKit/Source/core/dom/ModuleScript.h
index dbe6db95b273d80b695eead1b5b8557685ac66c5..17cec9d0fc62b5659c4cf828a80a3e9d91022405 100644
--- a/third_party/WebKit/Source/core/dom/ModuleScript.h
+++ b/third_party/WebKit/Source/core/dom/ModuleScript.h
@@ -10,6 +10,7 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "bindings/core/v8/TraceWrapperV8Reference.h"
#include "core/CoreExport.h"
+#include "core/dom/Modulator.h"
#include "core/dom/Script.h"
#include "platform/heap/Handle.h"
#include "platform/loader/fetch/ResourceLoaderOptions.h"
@@ -30,13 +31,14 @@ enum class ModuleInstantiationState {
class CORE_EXPORT ModuleScript final : public Script, public TraceWrapperBase {
public:
static ModuleScript* Create(
+ Modulator* settings_object,
ScriptModule record,
const KURL& base_url,
const String& nonce,
ParserDisposition parser_state,
WebURLRequest::FetchCredentialsMode credentials_mode) {
- return new ModuleScript(record, base_url, nonce, parser_state,
- credentials_mode);
+ return new ModuleScript(settings_object, record, base_url, nonce,
+ parser_state, credentials_mode);
}
~ModuleScript() override = default;
@@ -61,12 +63,14 @@ class CORE_EXPORT ModuleScript final : public Script, public TraceWrapperBase {
DECLARE_TRACE_WRAPPERS();
private:
- ModuleScript(ScriptModule record,
+ ModuleScript(Modulator* settings_object,
+ ScriptModule record,
const KURL& base_url,
const String& nonce,
ParserDisposition parser_state,
WebURLRequest::FetchCredentialsMode credentials_mode)
- : record_(record),
+ : settings_object_(settings_object),
+ record_(record),
base_url_(base_url),
instantiation_error_(this),
nonce_(nonce),
@@ -80,10 +84,8 @@ class CORE_EXPORT ModuleScript final : public Script, public TraceWrapperBase {
void RunScript(LocalFrame*, const SecurityOrigin*) const override;
String InlineSourceTextForCSP() const override;
- // Note: A "module script"'s "setttings object" is ommitted, as we currently
- // always have access to the corresponding Modulator when operating on a
- // ModuleScript instance.
// https://html.spec.whatwg.org/multipage/webappapis.html#settings-object
+ Member<Modulator> settings_object_;
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-module-record
ScriptModule record_;
« no previous file with comments | « third_party/WebKit/Source/core/dom/ModuleMapTest.cpp ('k') | third_party/WebKit/Source/core/dom/ModuleScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698