Chromium Code Reviews| Index: third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h |
| diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h |
| index e3eb425878a429be07503850888b10cfe5355b4c..ff43acbde0bcc74c0978efd13fdca281bce2d969 100644 |
| --- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h |
| +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h |
| @@ -21,6 +21,7 @@ class ScriptResourceClient; |
| class ScriptState; |
| class Settings; |
| class SourceStream; |
| +class WebTaskRunner; |
| // ScriptStreamer streams incomplete script data to V8 so that it can be parsed |
| // while it's loaded. PendingScript holds a reference to ScriptStreamer. At the |
| @@ -32,9 +33,9 @@ class SourceStream; |
| class CORE_EXPORT ScriptStreamer final : public RefCountedWillBeRefCountedGarbageCollected<ScriptStreamer> { |
| WTF_MAKE_NONCOPYABLE(ScriptStreamer); |
| public: |
| - static PassRefPtrWillBeRawPtr<ScriptStreamer> create(ScriptResource* resource, PendingScript::Type scriptType, ScriptState* scriptState, v8::ScriptCompiler::CompileOptions compileOptions) |
| + static PassRefPtrWillBeRawPtr<ScriptStreamer> create(ScriptResource* resource, PendingScript::Type scriptType, ScriptState* scriptState, v8::ScriptCompiler::CompileOptions compileOptions, WebTaskRunner* loadingTaskRunner) |
| { |
| - return adoptRefWillBeNoop(new ScriptStreamer(resource, scriptType, scriptState, compileOptions)); |
| + return adoptRefWillBeNoop(new ScriptStreamer(resource, scriptType, scriptState, compileOptions, loadingTaskRunner)); |
| } |
| ~ScriptStreamer(); |
| @@ -42,7 +43,7 @@ public: |
| // Launches a task (on a background thread) which will stream the given |
| // PendingScript into V8 as it loads. |
| - static void startStreaming(PendingScript&, PendingScript::Type, Settings*, ScriptState*); |
| + static void startStreaming(PendingScript&, PendingScript::Type, Settings*, ScriptState*, WebTaskRunner*); |
| // Returns false if we cannot stream the given encoding. |
| static bool convertEncoding(const char* encodingName, v8::ScriptCompiler::StreamedSource::Encoding*); |
| @@ -107,12 +108,12 @@ private: |
| // streamed. Non-const for testing. |
| static size_t kSmallScriptThreshold; |
| - ScriptStreamer(ScriptResource*, PendingScript::Type, ScriptState*, v8::ScriptCompiler::CompileOptions); |
| + ScriptStreamer(ScriptResource*, PendingScript::Type, ScriptState*, v8::ScriptCompiler::CompileOptions, WebTaskRunner*); |
| void streamingComplete(); |
| void notifyFinishedToClient(); |
| - static bool startStreamingInternal(PendingScript&, PendingScript::Type, Settings*, ScriptState*); |
| + static bool startStreamingInternal(PendingScript&, PendingScript::Type, Settings*, ScriptState*, WebTaskRunner*); |
| // This pointer is weak. If PendingScript and its Resource are deleted |
| // before ScriptStreamer, PendingScript will notify ScriptStreamer of its |
| @@ -149,6 +150,8 @@ private: |
| // Encoding of the streamed script. Saved for sanity checking purposes. |
| v8::ScriptCompiler::StreamedSource::Encoding m_encoding; |
| + |
| + WebTaskRunner* m_loadingTaskRunner; |
|
Sami
2015/09/30 13:03:16
nit: add a comment about the lifetime here too?
alex clarke (OOO till 29th)
2015/09/30 13:37:17
I think we can just clone it and use an OwnPtr her
|
| }; |
| } // namespace blink |