Chromium Code Reviews| 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 SuspendableScriptRunner_h | |
| 6 #define SuspendableScriptRunner_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 ScriptExecutionCallback; | |
| 17 | |
| 18 class SuspendableScriptRunner final : public ActiveDOMObject { | |
|
vsevik
2014/10/22 13:29:00
SuspendableScriptExecutor
kozyatinskiy1
2014/10/22 13:53:03
Done.
| |
| 19 public: | |
| 20 SuspendableScriptRunner(LocalFrame*, int worldID, const Vector<ScriptSourceC ode>& sources, int extensionGroup, bool userGesture, PassOwnPtr<ScriptExecutionC allback>); | |
| 21 virtual ~SuspendableScriptRunner(); | |
| 22 | |
| 23 void run(); | |
|
vsevik
2014/10/22 13:29:00
Can we move this into constructor? We always want
kozyatinskiy1
2014/10/22 13:53:03
No, we can't call delete this in class cstor.
| |
| 24 | |
| 25 virtual void resume() override; | |
| 26 | |
| 27 virtual void contextDestroyed() override; | |
| 28 | |
| 29 private: | |
| 30 void executeAndDestroySelf(); | |
| 31 | |
| 32 LocalFrame* m_frame; | |
| 33 int m_worldID; | |
| 34 Vector<ScriptSourceCode> m_sources; | |
| 35 int m_extensionGroup; | |
| 36 bool m_userGesture; | |
| 37 OwnPtr<ScriptExecutionCallback> m_client; | |
| 38 }; | |
| 39 | |
| 40 } // namespace blink | |
| 41 | |
| 42 #endif // SuspendableScriptRunner_h | |
| OLD | NEW |