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

Unified Diff: third_party/WebKit/Source/core/loader/NavigationScheduler.cpp

Issue 1561663003: CL for perf tryjob on win (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/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;
};
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMTimer.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698