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 #ifndef SuspendableScriptExecutor_h | 5 #ifndef SuspendableScriptExecutor_h |
6 #define SuspendableScriptExecutor_h | 6 #define SuspendableScriptExecutor_h |
7 | 7 |
8 #include "core/dom/ActiveDOMObject.h" | 8 #include "core/dom/ActiveDOMObject.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 #include "wtf/OwnPtr.h" | 10 #include "wtf/OwnPtr.h" |
11 #include "wtf/Vector.h" | 11 #include "wtf/Vector.h" |
12 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 class LocalFrame; | 15 class LocalFrame; |
16 class ScriptSourceCode; | 16 class ScriptSourceCode; |
17 class WebScriptExecutionCallback; | 17 class WebScriptExecutionCallback; |
18 | 18 |
19 class SuspendableScriptExecutor final : public RefCountedWillBeRefCountedGarbage
Collected<SuspendableScriptExecutor>, public ActiveDOMObject { | 19 class SuspendableScriptExecutor final : public RefCountedWillBeRefCountedGarbage
Collected<SuspendableScriptExecutor>, public ActiveDOMObject { |
20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SuspendableScriptExecutor); | 20 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(SuspendableScriptExecutor); |
21 public: | 21 public: |
22 static void createAndRun(LocalFrame*, int worldID, const Vector<ScriptSource
Code>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallback
*); | 22 static void createAndRun(LocalFrame*, int worldID, const WillBeHeapVector<Sc
riptSourceCode>& sources, int extensionGroup, bool userGesture, WebScriptExecuti
onCallback*); |
23 virtual ~SuspendableScriptExecutor(); | 23 virtual ~SuspendableScriptExecutor(); |
24 | 24 |
25 virtual void resume() override; | 25 virtual void resume() override; |
26 virtual void contextDestroyed() override; | 26 virtual void contextDestroyed() override; |
27 | 27 |
28 virtual void trace(Visitor*) override; | 28 virtual void trace(Visitor*) override; |
29 | 29 |
30 private: | 30 private: |
31 SuspendableScriptExecutor(LocalFrame*, int worldID, const Vector<ScriptSourc
eCode>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallbac
k*); | 31 SuspendableScriptExecutor(LocalFrame*, int worldID, const WillBeHeapVector<S
criptSourceCode>& sources, int extensionGroup, bool userGesture, WebScriptExecut
ionCallback*); |
32 | 32 |
33 void run(); | 33 void run(); |
34 void executeAndDestroySelf(); | 34 void executeAndDestroySelf(); |
35 | 35 |
36 RawPtrWillBeMember<LocalFrame> m_frame; | 36 RawPtrWillBeMember<LocalFrame> m_frame; |
37 int m_worldID; | 37 int m_worldID; |
38 Vector<ScriptSourceCode> m_sources; | 38 WillBeHeapVector<ScriptSourceCode> m_sources; |
39 int m_extensionGroup; | 39 int m_extensionGroup; |
40 bool m_userGesture; | 40 bool m_userGesture; |
41 WebScriptExecutionCallback* m_callback; | 41 WebScriptExecutionCallback* m_callback; |
42 }; | 42 }; |
43 | 43 |
44 } // namespace blink | 44 } // namespace blink |
45 | 45 |
46 #endif // SuspendableScriptExecutor_h | 46 #endif // SuspendableScriptExecutor_h |
OLD | NEW |