| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SuspendableScriptExecutor_h |
| 6 #define SuspendableScriptExecutor_h |
| 7 |
| 8 #include "core/dom/ActiveDOMObject.h" |
| 9 #include "wtf/OwnPtr.h" |
| 10 #include "wtf/Vector.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class LocalFrame; |
| 15 class ScriptSourceCode; |
| 16 class WebScriptExecutionCallback; |
| 17 |
| 18 class SuspendableScriptExecutor final : public ActiveDOMObject { |
| 19 public: |
| 20 SuspendableScriptExecutor(LocalFrame*, int worldID, const Vector<ScriptSourc
eCode>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallbac
k*); |
| 21 virtual ~SuspendableScriptExecutor(); |
| 22 |
| 23 // this method must be called only once |
| 24 void run(); |
| 25 |
| 26 virtual void resume() override; |
| 27 |
| 28 virtual void contextDestroyed() override; |
| 29 |
| 30 private: |
| 31 void executeAndDestroySelf(); |
| 32 |
| 33 LocalFrame* m_frame; |
| 34 int m_worldID; |
| 35 Vector<ScriptSourceCode> m_sources; |
| 36 int m_extensionGroup; |
| 37 bool m_userGesture; |
| 38 WebScriptExecutionCallback* m_callback; |
| 39 }; |
| 40 |
| 41 } // namespace blink |
| 42 |
| 43 #endif // SuspendableScriptExecutor_h |
| OLD | NEW |