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..84b161db4c8586a784de859e82c2fc419248baad 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()); |
haraken
2016/01/21 10:16:15
Ditto.
|
+ |
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::OriginWorldPusher worldPusher(ScriptState::forMainWorld(toDocument(context)->frame())->world(), m_originWorld); |
haraken
2016/01/21 16:41:33
For example, the world in this first parameter is
|
TRACE_EVENT1("devtools.timeline", "TimerFire", "data", InspectorTimerFireEvent::data(context, m_timeoutID)); |
InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireTimer(context, m_timeoutID); |