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

Unified Diff: third_party/WebKit/Source/core/loader/NavigationScheduler.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: Use a static world stack instead of a per-world private field 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
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMTimer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3edce4571bec3615f942c9cff57bf8c19f895ecc 100644
--- a/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
+++ b/third_party/WebKit/Source/core/loader/NavigationScheduler.cpp
@@ -108,14 +108,22 @@ protected:
: ScheduledNavigation(delay, originDocument, replacesCurrentItem, isLocationChange)
, m_url(url)
, m_shouldCheckMainWorldContentSecurityPolicy(CheckContentSecurityPolicy)
+ , m_originWorld(nullptr)
{
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()) {
+ m_originWorld = PassRefPtr<DOMWrapperWorld>(DOMWrapperWorld::current(v8::Isolate::GetCurrent()).originWorld());
+ }
}
void fire(LocalFrame* frame) override
{
OwnPtr<UserGestureIndicator> gestureIndicator = createUserGestureIndicator();
+ // Ensure the origin world gets propagated to the navigation and is reset afterwards.
+ DOMWrapperWorld::OriginWorldScope worldScope(m_originWorld);
FrameLoadRequest request(originDocument(), m_url, "_self", m_shouldCheckMainWorldContentSecurityPolicy);
request.setReplacesCurrentItem(replacesCurrentItem());
request.setClientRedirect(ClientRedirect);
@@ -126,6 +134,7 @@ protected:
private:
String m_url;
+ RefPtr<DOMWrapperWorld> m_originWorld;
ContentSecurityPolicyDisposition m_shouldCheckMainWorldContentSecurityPolicy;
};
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMTimer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698