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. |