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

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

Issue 2781713003: Enable module scripts in ScriptLoader (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
Index: third_party/WebKit/Source/core/dom/ModuleScript.cpp
diff --git a/third_party/WebKit/Source/core/dom/ModuleScript.cpp b/third_party/WebKit/Source/core/dom/ModuleScript.cpp
index ced261f0aba7c0f11f28ffeec2de898930be137d..4f3467df22cddee3f0273bef575d5ee7dc060373 100644
--- a/third_party/WebKit/Source/core/dom/ModuleScript.cpp
+++ b/third_party/WebKit/Source/core/dom/ModuleScript.cpp
@@ -4,6 +4,10 @@
#include "core/dom/ModuleScript.h"
+#include "bindings/core/v8/V8Binding.h"
+#include "bindings/core/v8/V8ThrowException.h"
+#include "core/dom/Modulator.h"
+
namespace blink {
void ModuleScript::SetInstantiationError(v8::Isolate* isolate,
@@ -40,8 +44,12 @@ bool ModuleScript::CheckMIMETypeBeforeRunScript(Document* context_document,
}
void ModuleScript::RunScript(LocalFrame* frame, const SecurityOrigin*) const {
- // TODO(hiroshige): Implement this once Modulator::ExecuteModule() is landed.
- NOTREACHED();
+ // FOXME: What if the isolate is different from the isolate used for
+ // m_record's compilation?
+ fprintf(stderr, "ModuleScript: isNull=%d state=%d\n", record_.IsNull(),
+ InstantiationState());
+
+ Modulator::From(ToScriptStateForMainWorld(frame))->ExecuteModule(this);
hiroshige 2017/04/12 19:57:05 I think we should have |m_modulator| in ModuleScri
}
String ModuleScript::InlineSourceTextForCSP() const {

Powered by Google App Engine
This is Rietveld 408576698