Chromium Code Reviews| 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..8918695aa206aa57f918d9d9c61e26a86d090873 100644 |
| --- a/third_party/WebKit/Source/web/SuspendableScriptExecutor.h |
| +++ b/third_party/WebKit/Source/web/SuspendableScriptExecutor.h |
| @@ -8,6 +8,7 @@ |
| #include "core/frame/SuspendableTimer.h" |
| #include "platform/heap/Handle.h" |
| #include "platform/heap/SelfKeepAlive.h" |
| +#include "v8/include/v8.h" |
|
dcheng
2016/09/27 08:30:57
Oh, maybe try cheating and putting this in <>, whi
|
| #include "wtf/Vector.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 { |
| + public: |
| + virtual Vector<v8::Local<v8::Value>> execute(LocalFrame*) = 0; |
| + |
| + virtual void trace(Visitor*) {}; |
| + }; |
| + |
| 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; |
| }; |
| } // namespace blink |