| 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 "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| 11 #include "platform/UserGestureIndicator.h" | 11 #include "platform/UserGestureIndicator.h" |
| 12 #include "public/platform/WebVector.h" | 12 #include "public/platform/WebVector.h" |
| 13 #include "public/web/WebScriptExecutionCallback.h" | 13 #include "public/web/WebScriptExecutionCallback.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 void SuspendableScriptExecutor::createAndRun(LocalFrame* frame, int worldID, con
st WillBeHeapVector<ScriptSourceCode>& sources, int extensionGroup, bool userGes
ture, WebScriptExecutionCallback* callback) | 17 void SuspendableScriptExecutor::createAndRun(LocalFrame* frame, int worldID, con
st HeapVector<ScriptSourceCode>& sources, int extensionGroup, bool userGesture,
WebScriptExecutionCallback* callback) |
| 18 { | 18 { |
| 19 SuspendableScriptExecutor* executor = new SuspendableScriptExecutor(frame, w
orldID, sources, extensionGroup, userGesture, callback); | 19 SuspendableScriptExecutor* executor = new SuspendableScriptExecutor(frame, w
orldID, sources, extensionGroup, userGesture, callback); |
| 20 executor->run(); | 20 executor->run(); |
| 21 } | 21 } |
| 22 | 22 |
| 23 void SuspendableScriptExecutor::contextDestroyed() | 23 void SuspendableScriptExecutor::contextDestroyed() |
| 24 { | 24 { |
| 25 SuspendableTimer::contextDestroyed(); | 25 SuspendableTimer::contextDestroyed(); |
| 26 m_callback->completed(Vector<v8::Local<v8::Value>>()); | 26 m_callback->completed(Vector<v8::Local<v8::Value>>()); |
| 27 dispose(); | 27 dispose(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 SuspendableScriptExecutor::SuspendableScriptExecutor(LocalFrame* frame, int worl
dID, const WillBeHeapVector<ScriptSourceCode>& sources, int extensionGroup, bool
userGesture, WebScriptExecutionCallback* callback) | 30 SuspendableScriptExecutor::SuspendableScriptExecutor(LocalFrame* frame, int worl
dID, const HeapVector<ScriptSourceCode>& sources, int extensionGroup, bool userG
esture, WebScriptExecutionCallback* callback) |
| 31 : SuspendableTimer(frame->document()) | 31 : SuspendableTimer(frame->document()) |
| 32 , m_frame(frame) | 32 , m_frame(frame) |
| 33 , m_sources(sources) | 33 , m_sources(sources) |
| 34 , m_callback(callback) | 34 , m_callback(callback) |
| 35 , m_keepAlive(this) | 35 , m_keepAlive(this) |
| 36 , m_worldID(worldID) | 36 , m_worldID(worldID) |
| 37 , m_extensionGroup(extensionGroup) | 37 , m_extensionGroup(extensionGroup) |
| 38 , m_userGesture(userGesture) | 38 , m_userGesture(userGesture) |
| 39 { | 39 { |
| 40 } | 40 } |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 } | 96 } |
| 97 | 97 |
| 98 DEFINE_TRACE(SuspendableScriptExecutor) | 98 DEFINE_TRACE(SuspendableScriptExecutor) |
| 99 { | 99 { |
| 100 visitor->trace(m_frame); | 100 visitor->trace(m_frame); |
| 101 visitor->trace(m_sources); | 101 visitor->trace(m_sources); |
| 102 SuspendableTimer::trace(visitor); | 102 SuspendableTimer::trace(visitor); |
| 103 } | 103 } |
| 104 | 104 |
| 105 } // namespace blink | 105 } // namespace blink |
| OLD | NEW |