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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 frame->document(), UserGestureToken::NewGesture))); | 61 frame->document(), UserGestureToken::NewGesture))); |
62 } | 62 } |
63 | 63 |
64 Vector<v8::Local<v8::Value>> results; | 64 Vector<v8::Local<v8::Value>> results; |
65 if (m_worldID) { | 65 if (m_worldID) { |
66 frame->script().executeScriptInIsolatedWorld(m_worldID, m_sources, | 66 frame->script().executeScriptInIsolatedWorld(m_worldID, m_sources, |
67 m_extensionGroup, &results); | 67 m_extensionGroup, &results); |
68 } else { | 68 } else { |
69 v8::Local<v8::Value> scriptValue = | 69 v8::Local<v8::Value> scriptValue = |
70 frame->script().executeScriptInMainWorldAndReturnValue( | 70 frame->script().executeScriptInMainWorldAndReturnValue( |
71 m_sources.first()); | 71 m_sources.front()); |
72 results.append(scriptValue); | 72 results.append(scriptValue); |
73 } | 73 } |
74 | 74 |
75 return results; | 75 return results; |
76 } | 76 } |
77 | 77 |
78 class V8FunctionExecutor : public SuspendableScriptExecutor::Executor { | 78 class V8FunctionExecutor : public SuspendableScriptExecutor::Executor { |
79 public: | 79 public: |
80 V8FunctionExecutor(v8::Isolate*, | 80 V8FunctionExecutor(v8::Isolate*, |
81 v8::Local<v8::Function>, | 81 v8::Local<v8::Function>, |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |