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" |
11 #include "core/dom/Document.h" | 11 #include "core/dom/Document.h" |
12 #include "core/dom/DocumentUserGestureToken.h" | 12 #include "core/dom/DocumentUserGestureToken.h" |
| 13 #include "core/dom/TaskRunnerHelper.h" |
13 #include "core/frame/LocalFrame.h" | 14 #include "core/frame/LocalFrame.h" |
14 #include "platform/UserGestureIndicator.h" | 15 #include "platform/UserGestureIndicator.h" |
15 #include "public/platform/WebVector.h" | 16 #include "public/platform/WebVector.h" |
16 #include "public/web/WebScriptExecutionCallback.h" | 17 #include "public/web/WebScriptExecutionCallback.h" |
17 #include "wtf/PtrUtil.h" | 18 #include "wtf/PtrUtil.h" |
18 #include "wtf/Vector.h" | 19 #include "wtf/Vector.h" |
19 #include <memory> | 20 #include <memory> |
20 | 21 |
21 namespace blink { | 22 namespace blink { |
22 | 23 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 if (m_callback) | 177 if (m_callback) |
177 m_callback->completed(Vector<v8::Local<v8::Value>>()); | 178 m_callback->completed(Vector<v8::Local<v8::Value>>()); |
178 dispose(); | 179 dispose(); |
179 } | 180 } |
180 | 181 |
181 SuspendableScriptExecutor::SuspendableScriptExecutor( | 182 SuspendableScriptExecutor::SuspendableScriptExecutor( |
182 LocalFrame* frame, | 183 LocalFrame* frame, |
183 ScriptState* scriptState, | 184 ScriptState* scriptState, |
184 WebScriptExecutionCallback* callback, | 185 WebScriptExecutionCallback* callback, |
185 Executor* executor) | 186 Executor* executor) |
186 : SuspendableTimer(frame->document()), | 187 : SuspendableTimer(frame->document(), TaskType::Timer), |
187 m_scriptState(scriptState), | 188 m_scriptState(scriptState), |
188 m_callback(callback), | 189 m_callback(callback), |
189 m_keepAlive(this), | 190 m_keepAlive(this), |
190 m_executor(executor) {} | 191 m_executor(executor) {} |
191 | 192 |
192 SuspendableScriptExecutor::~SuspendableScriptExecutor() {} | 193 SuspendableScriptExecutor::~SuspendableScriptExecutor() {} |
193 | 194 |
194 void SuspendableScriptExecutor::fired() { | 195 void SuspendableScriptExecutor::fired() { |
195 executeAndDestroySelf(); | 196 executeAndDestroySelf(); |
196 } | 197 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 m_keepAlive.clear(); | 232 m_keepAlive.clear(); |
232 stop(); | 233 stop(); |
233 } | 234 } |
234 | 235 |
235 DEFINE_TRACE(SuspendableScriptExecutor) { | 236 DEFINE_TRACE(SuspendableScriptExecutor) { |
236 visitor->trace(m_executor); | 237 visitor->trace(m_executor); |
237 SuspendableTimer::trace(visitor); | 238 SuspendableTimer::trace(visitor); |
238 } | 239 } |
239 | 240 |
240 } // namespace blink | 241 } // namespace blink |
OLD | NEW |