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

Unified Diff: third_party/WebKit/Source/web/SuspendableScriptExecutor.h

Issue 2339683006: [Blink] Modify SuspendableScriptExecutor to take a v8::Function (Closed)
Patch Set: Daniels Created 4 years, 3 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 | « extensions/renderer/script_context.cc ('k') | third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/SuspendableScriptExecutor.h
diff --git a/third_party/WebKit/Source/web/SuspendableScriptExecutor.h b/third_party/WebKit/Source/web/SuspendableScriptExecutor.h
index 402d398c0b861c7bbb1cb458d28eb17b82648f2e..2d6990711cf1759fe85b62b806e765174bf5413a 100644
--- a/third_party/WebKit/Source/web/SuspendableScriptExecutor.h
+++ b/third_party/WebKit/Source/web/SuspendableScriptExecutor.h
@@ -9,6 +9,7 @@
#include "platform/heap/Handle.h"
#include "platform/heap/SelfKeepAlive.h"
#include "wtf/Vector.h"
+#include <v8.h>
namespace blink {
@@ -20,14 +21,22 @@ class SuspendableScriptExecutor final : public GarbageCollectedFinalized<Suspend
USING_GARBAGE_COLLECTED_MIXIN(SuspendableScriptExecutor);
public:
static void createAndRun(LocalFrame*, int worldID, const HeapVector<ScriptSourceCode>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallback*);
+ static void createAndRun(LocalFrame*, v8::Isolate*, v8::Local<v8::Function>, v8::Local<v8::Value> receiver, int argc, v8::Local<v8::Value> argv[], WebScriptExecutionCallback*);
~SuspendableScriptExecutor() override;
void contextDestroyed() override;
DECLARE_VIRTUAL_TRACE();
+ class Executor {
haraken 2016/09/28 00:41:22 Make this inherit from GarbageCollected<>.
Devlin 2016/09/30 21:22:22 Done.
+ public:
+ virtual Vector<v8::Local<v8::Value>> execute(LocalFrame*) = 0;
+
+ virtual void trace(Visitor*) {};
haraken 2016/09/28 00:41:22 Use DEFINE_INLINE_VIRTUAL_TRACE.
Devlin 2016/09/30 21:22:22 Done.
+ };
+
private:
- SuspendableScriptExecutor(LocalFrame*, int worldID, const HeapVector<ScriptSourceCode>& sources, int extensionGroup, bool userGesture, WebScriptExecutionCallback*);
+ SuspendableScriptExecutor(LocalFrame*, WebScriptExecutionCallback*, std::unique_ptr<Executor>);
void fired() override;
@@ -36,15 +45,11 @@ private:
void dispose();
Member<LocalFrame> m_frame;
- HeapVector<ScriptSourceCode> m_sources;
WebScriptExecutionCallback* m_callback;
SelfKeepAlive<SuspendableScriptExecutor> m_keepAlive;
- int m_worldID;
- int m_extensionGroup;
-
- bool m_userGesture;
+ std::unique_ptr<Executor> m_executor;
haraken 2016/09/28 00:41:22 Use Member<Executor>.
Devlin 2016/09/30 21:22:22 Done.
};
} // namespace blink
« no previous file with comments | « extensions/renderer/script_context.cc ('k') | third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698