Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3601)

Unified Diff: Source/web/SuspendableScriptExecutor.h

Issue 660863002: [DevTools] Added public method for async execution of scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added deprecated label for not suspendable execute methods Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/web/SuspendableScriptExecutor.cpp » ('j') | Source/web/WebLocalFrameImpl.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/SuspendableScriptExecutor.h
diff --git a/Source/web/SuspendableScriptExecutor.h b/Source/web/SuspendableScriptExecutor.h
new file mode 100644
index 0000000000000000000000000000000000000000..b2d8489c72f355115ae3020fb9c54c4093a7896b
--- /dev/null
+++ b/Source/web/SuspendableScriptExecutor.h
@@ -0,0 +1,43 @@
+// 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 SuspendableScriptExecutor_h
+#define SuspendableScriptExecutor_h
+
+#include "core/dom/ActiveDOMObject.h"
+#include "wtf/OwnPtr.h"
+#include "wtf/Vector.h"
+
+namespace blink {
+
+class LocalFrame;
+class ScriptSourceCode;
+class WebScriptExecutionCallback;
+
+class SuspendableScriptExecutor final : public ActiveDOMObject {
+public:
+ SuspendableScriptExecutor(LocalFrame*, int worldID, const Vector<ScriptSourceCode>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallback*);
+ virtual ~SuspendableScriptExecutor();
+
+ // this method must be called only once
+ void run();
+
+ 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;
+ WebScriptExecutionCallback* m_callback;
+};
+
+} // namespace blink
+
+#endif // SuspendableScriptExecutor_h
« no previous file with comments | « no previous file | Source/web/SuspendableScriptExecutor.cpp » ('j') | Source/web/WebLocalFrameImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698