Chromium Code Reviews| Index: Source/core/dom/SuspendableScriptRunner.h | 
| diff --git a/Source/core/dom/SuspendableScriptRunner.h b/Source/core/dom/SuspendableScriptRunner.h | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..696478227dbebc1a45c8f8b5a33339f8303d8419 | 
| --- /dev/null | 
| +++ b/Source/core/dom/SuspendableScriptRunner.h | 
| @@ -0,0 +1,42 @@ | 
| +// Copyright 2014 The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +#ifndef SuspendableScriptRunner_h | 
| +#define SuspendableScriptRunner_h | 
| + | 
| +#include "core/dom/ActiveDOMObject.h" | 
| +#include "wtf/OwnPtr.h" | 
| +#include "wtf/Vector.h" | 
| + | 
| +namespace blink { | 
| + | 
| +class LocalFrame; | 
| +class ScriptSourceCode; | 
| +class ScriptExecutionCallback; | 
| + | 
| +class SuspendableScriptRunner final : public ActiveDOMObject { | 
| 
 
vsevik
2014/10/22 13:29:00
SuspendableScriptExecutor
 
kozyatinskiy1
2014/10/22 13:53:03
Done.
 
 | 
| +public: | 
| + SuspendableScriptRunner(LocalFrame*, int worldID, const Vector<ScriptSourceCode>& sources, int extensionGroup, bool userGesture, PassOwnPtr<ScriptExecutionCallback>); | 
| + virtual ~SuspendableScriptRunner(); | 
| + | 
| + 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.
 
 | 
| + | 
| + virtual void resume() override; | 
| + | 
| + virtual void contextDestroyed() override; | 
| + | 
| +private: | 
| + void executeAndDestroySelf(); | 
| + | 
| + LocalFrame* m_frame; | 
| + int m_worldID; | 
| + Vector<ScriptSourceCode> m_sources; | 
| + int m_extensionGroup; | 
| + bool m_userGesture; | 
| + OwnPtr<ScriptExecutionCallback> m_client; | 
| +}; | 
| + | 
| +} // namespace blink | 
| + | 
| +#endif // SuspendableScriptRunner_h |