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

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 1615523002: Transitively keep track of an isolated world's children scripts and worlds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 7fa14d64a272291c32068ef276c7189d4102c558..23e6a25fe2b4c320c5fdb945936f186708a0f65f 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -1822,6 +1822,12 @@ PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const Fra
}
webframeChild->frame()->loader().load(newRequest, loadType, childItem.get());
+ // Apply the creating worldId to the created child frame.
+ if (v8::Isolate::GetCurrent()->InContext()) {
+ RefPtr<DOMWrapperWorld> parentFrameOriginWorld = PassRefPtr<DOMWrapperWorld>(DOMWrapperWorld::current(v8::Isolate::GetCurrent()).originWorld());
+ ScriptState::forMainWorld(webframeChild->frame())->world().setOriginWorld(parentFrameOriginWorld);
+ }
+
// Note a synchronous navigation (about:blank) would have already processed
// onload, so it is possible for the child frame to have already been
// detached by script in the page.

Powered by Google App Engine
This is Rietveld 408576698