| Index: Source/web/SuspendableScriptExecutor.cpp
|
| diff --git a/Source/web/SuspendableScriptExecutor.cpp b/Source/web/SuspendableScriptExecutor.cpp
|
| index d59c9aa630be5b66a2688a95e47cd8bde1a4e9a9..84af91a263f08e2d7561dfe9bfc219cbf965779d 100644
|
| --- a/Source/web/SuspendableScriptExecutor.cpp
|
| +++ b/Source/web/SuspendableScriptExecutor.cpp
|
| @@ -14,6 +14,26 @@
|
|
|
| namespace blink {
|
|
|
| +void SuspendableScriptExecutor::createAndRun(LocalFrame* frame, int worldID, const Vector<ScriptSourceCode>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallback* callback)
|
| +{
|
| + SuspendableScriptExecutor* executor = new SuspendableScriptExecutor(frame, worldID, sources, extensionGroup, userGesture, callback);
|
| + executor->run();
|
| +}
|
| +
|
| +void SuspendableScriptExecutor::resume()
|
| +{
|
| + executeAndDestroySelf();
|
| +}
|
| +
|
| +void SuspendableScriptExecutor::contextDestroyed()
|
| +{
|
| + // this method can only be called if the script was not called in run()
|
| + // and context remained suspend (method resume has never called)
|
| + ActiveDOMObject::contextDestroyed();
|
| + m_callback->completed(Vector<v8::Local<v8::Value> >());
|
| + delete this;
|
| +}
|
| +
|
| SuspendableScriptExecutor::SuspendableScriptExecutor(LocalFrame* frame, int worldID, const Vector<ScriptSourceCode>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallback* callback)
|
| : ActiveDOMObject(frame->document())
|
| , m_frame(frame)
|
| @@ -38,20 +58,6 @@ void SuspendableScriptExecutor::run()
|
| executeAndDestroySelf();
|
| }
|
|
|
| -void SuspendableScriptExecutor::resume()
|
| -{
|
| - executeAndDestroySelf();
|
| -}
|
| -
|
| -void SuspendableScriptExecutor::contextDestroyed()
|
| -{
|
| - // this method can only be called if the script was not called in run()
|
| - // and context remained suspend (method resume has never called)
|
| - ActiveDOMObject::contextDestroyed();
|
| - m_callback->completed(Vector<v8::Local<v8::Value> >());
|
| - delete this;
|
| -}
|
| -
|
| void SuspendableScriptExecutor::executeAndDestroySelf()
|
| {
|
| // after calling the destructor of object - object will be unsubscribed from
|
|
|