| Index: third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
|
| diff --git a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
|
| index f4a962da8b6d02ed5ec02d25a7aef5612297a456..1773aab03e445b8132c9de7d1ede17094f51b3a6 100644
|
| --- a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
|
| +++ b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
|
| @@ -111,11 +111,21 @@ protected:
|
| {
|
| if (ContentSecurityPolicy::shouldBypassMainWorld(originDocument))
|
| m_shouldCheckMainWorldContentSecurityPolicy = DoNotCheckContentSecurityPolicy;
|
| +
|
| + // Store the world id of the frame requesting the navigation in case it's a 'javascript:...' url.
|
| + if (v8::Isolate::GetCurrent()->InContext()) {
|
| + DOMWrapperWorld& creatingWorld = DOMWrapperWorld::current(v8::Isolate::GetCurrent());
|
| + m_originWorldId = creatingWorld.originWorldId();
|
| + } else {
|
| + m_originWorldId = 0;
|
| + }
|
| }
|
|
|
| void fire(LocalFrame* frame) override
|
| {
|
| OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicator();
|
| + // Ensure the parent world id gets propagated to the navigation and is reset afterwards.
|
| + DOMWrapperWorld::ParentWorldIdPusher worldIdPusher(ScriptState::forMainWorld(frame)->world(), m_originWorldId);
|
| FrameLoadRequest request(originDocument(), m_url, "_self", m_shouldCheckMainWorldContentSecurityPolicy);
|
| request.setReplacesCurrentItem(replacesCurrentItem());
|
| request.setClientRedirect(ClientRedirect);
|
| @@ -126,6 +136,7 @@ protected:
|
|
|
| private:
|
| String m_url;
|
| + int m_originWorldId;
|
| ContentSecurityPolicyDisposition m_shouldCheckMainWorldContentSecurityPolicy;
|
| };
|
|
|
|
|