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

Unified Diff: third_party/WebKit/Source/core/frame/DOMTimer.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
Index: third_party/WebKit/Source/core/frame/DOMTimer.cpp
diff --git a/third_party/WebKit/Source/core/frame/DOMTimer.cpp b/third_party/WebKit/Source/core/frame/DOMTimer.cpp
index 78da1a72b2de6f537282463ed404223098a766dc..cc6414042f59f2cc012350610a1ca1f3d08da43b 100644
--- a/third_party/WebKit/Source/core/frame/DOMTimer.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMTimer.cpp
@@ -72,6 +72,10 @@ DOMTimer::DOMTimer(ExecutionContext* context, PassOwnPtrWillBeRawPtr<ScheduledAc
, m_nestingLevel(context->timers()->timerNestingLevel() + 1)
, m_action(action)
{
+ // Store the creating worldId, as the timer is fired in the main world.
+ ASSERT(v8::Isolate::GetCurrent()->InContext());
+ m_originWorld = PassRefPtr<DOMWrapperWorld>(DOMWrapperWorld::current(v8::Isolate::GetCurrent()).originWorld());
+
ASSERT(timeoutID > 0);
if (shouldForwardUserGesture(interval, m_nestingLevel))
m_userGestureToken = UserGestureIndicator::currentToken();
@@ -104,6 +108,8 @@ void DOMTimer::fired()
ASSERT(!context->activeDOMObjectsAreSuspended());
// Only the first execution of a multi-shot timer should get an affirmative user gesture indicator.
UserGestureIndicator gestureIndicator(m_userGestureToken.release());
+ // Ensure the origin world is propagated to the action and is reset afterwards.
+ DOMWrapperWorld::OriginWorldScope worldScope(m_originWorld);
TRACE_EVENT1("devtools.timeline", "TimerFire", "data", InspectorTimerFireEvent::data(context, m_timeoutID));
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireTimer(context, m_timeoutID);
« no previous file with comments | « third_party/WebKit/Source/core/frame/DOMTimer.h ('k') | third_party/WebKit/Source/core/loader/NavigationScheduler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698