| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "web/SuspendableScriptExecutor.h" | 5 #include "web/SuspendableScriptExecutor.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptController.h" | 7 #include "bindings/core/v8/ScriptController.h" |
| 8 #include "bindings/core/v8/ScriptSourceCode.h" | 8 #include "bindings/core/v8/ScriptSourceCode.h" |
| 9 #include "bindings/core/v8/V8PersistentValueVector.h" | 9 #include "bindings/core/v8/V8PersistentValueVector.h" |
| 10 #include "bindings/core/v8/WindowProxy.h" | 10 #include "bindings/core/v8/WindowProxy.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 SuspendableScriptExecutor::~SuspendableScriptExecutor() {} | 192 SuspendableScriptExecutor::~SuspendableScriptExecutor() {} |
| 193 | 193 |
| 194 void SuspendableScriptExecutor::fired() { | 194 void SuspendableScriptExecutor::fired() { |
| 195 executeAndDestroySelf(); | 195 executeAndDestroySelf(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void SuspendableScriptExecutor::run() { | 198 void SuspendableScriptExecutor::run() { |
| 199 ExecutionContext* context = getExecutionContext(); | 199 ExecutionContext* context = getExecutionContext(); |
| 200 DCHECK(context); | 200 DCHECK(context); |
| 201 if (!context->activeDOMObjectsAreSuspended()) { | 201 if (!context->isContextSuspended()) { |
| 202 suspendIfNeeded(); | 202 suspendIfNeeded(); |
| 203 executeAndDestroySelf(); | 203 executeAndDestroySelf(); |
| 204 return; | 204 return; |
| 205 } | 205 } |
| 206 startOneShot(0, BLINK_FROM_HERE); | 206 startOneShot(0, BLINK_FROM_HERE); |
| 207 suspendIfNeeded(); | 207 suspendIfNeeded(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 void SuspendableScriptExecutor::executeAndDestroySelf() { | 210 void SuspendableScriptExecutor::executeAndDestroySelf() { |
| 211 CHECK(m_scriptState->contextIsValid()); | 211 CHECK(m_scriptState->contextIsValid()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 231 m_keepAlive.clear(); | 231 m_keepAlive.clear(); |
| 232 stop(); | 232 stop(); |
| 233 } | 233 } |
| 234 | 234 |
| 235 DEFINE_TRACE(SuspendableScriptExecutor) { | 235 DEFINE_TRACE(SuspendableScriptExecutor) { |
| 236 visitor->trace(m_executor); | 236 visitor->trace(m_executor); |
| 237 SuspendableTimer::trace(visitor); | 237 SuspendableTimer::trace(visitor); |
| 238 } | 238 } |
| 239 | 239 |
| 240 } // namespace blink | 240 } // namespace blink |
| OLD | NEW |