Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
index 622b3b96e215b9ef6d08dcc0d77120fdeaa5960b..5826cacd0a6e23ad3606c08c47422bf1ece5987b 100644 |
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp |
@@ -754,8 +754,10 @@ void WebLocalFrameImpl::requestExecuteScriptAndReturnValue( |
WebScriptExecutionCallback* callback) { |
DCHECK(frame()); |
+ RefPtr<DOMWrapperWorld> mainWorld = &DOMWrapperWorld::mainWorld(); |
SuspendableScriptExecutor* executor = SuspendableScriptExecutor::create( |
- frame(), 0, createSourcesVector(&source, 1), userGesture, callback); |
+ frame(), std::move(mainWorld), createSourcesVector(&source, 1), |
+ userGesture, callback); |
executor->run(); |
} |
@@ -810,9 +812,11 @@ void WebLocalFrameImpl::requestExecuteScriptInIsolatedWorld( |
CHECK_GT(worldID, 0); |
CHECK_LT(worldID, DOMWrapperWorld::EmbedderWorldIdLimit); |
+ RefPtr<DOMWrapperWorld> isolatedWorld = |
+ DOMWrapperWorld::ensureIsolatedWorld(toIsolate(frame()), worldID); |
SuspendableScriptExecutor* executor = SuspendableScriptExecutor::create( |
- frame(), worldID, createSourcesVector(sourcesIn, numSources), userGesture, |
- callback); |
+ frame(), std::move(isolatedWorld), |
+ createSourcesVector(sourcesIn, numSources), userGesture, callback); |
switch (option) { |
case AsynchronousBlockingOnload: |
executor->runAsync(SuspendableScriptExecutor::OnloadBlocking); |