| 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 c002175480a9180c27b37d325d81a35dfaa3c6cf..18913b464778f2c3038b79126de54ef1f0b4682d 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h
|
| @@ -6,7 +6,6 @@
|
| #define ScriptStreamer_h
|
|
|
| #include "core/CoreExport.h"
|
| -#include "core/dom/PendingScript.h"
|
| #include "platform/heap/Handle.h"
|
| #include "wtf/RefCounted.h"
|
|
|
| @@ -33,7 +32,13 @@ class WebTaskRunner;
|
| 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, WebTaskRunner* loadingTaskRunner)
|
| + enum Type {
|
| + ParsingBlocking,
|
| + Deferred,
|
| + Async
|
| + };
|
| +
|
| + static PassRefPtrWillBeRawPtr<ScriptStreamer> create(ScriptResource* resource, Type scriptType, ScriptState* scriptState, v8::ScriptCompiler::CompileOptions compileOptions, WebTaskRunner* loadingTaskRunner)
|
| {
|
| return adoptRefWillBeNoop(new ScriptStreamer(resource, scriptType, scriptState, compileOptions, loadingTaskRunner));
|
| }
|
| @@ -43,7 +48,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*, WebTaskRunner*);
|
| + static void startStreaming(PendingScript*, Type, Settings*, ScriptState*, WebTaskRunner*);
|
|
|
| // Returns false if we cannot stream the given encoding.
|
| static bool convertEncoding(const char* encodingName, v8::ScriptCompiler::StreamedSource::Encoding*);
|
| @@ -108,12 +113,12 @@ private:
|
| // streamed. Non-const for testing.
|
| static size_t kSmallScriptThreshold;
|
|
|
| - ScriptStreamer(ScriptResource*, PendingScript::Type, ScriptState*, v8::ScriptCompiler::CompileOptions, WebTaskRunner*);
|
| + ScriptStreamer(ScriptResource*, Type, ScriptState*, v8::ScriptCompiler::CompileOptions, WebTaskRunner*);
|
|
|
| void streamingComplete();
|
| void notifyFinishedToClient();
|
|
|
| - static bool startStreamingInternal(PendingScript&, PendingScript::Type, Settings*, ScriptState*, WebTaskRunner*);
|
| + static bool startStreamingInternal(PendingScript*, Type, Settings*, ScriptState*, WebTaskRunner*);
|
|
|
| // This pointer is weak. If PendingScript and its Resource are deleted
|
| // before ScriptStreamer, PendingScript will notify ScriptStreamer of its
|
| @@ -144,7 +149,7 @@ private:
|
| RefPtr<ScriptState> m_scriptState;
|
|
|
| // For recording metrics for different types of scripts separately.
|
| - PendingScript::Type m_scriptType;
|
| + Type m_scriptType;
|
|
|
| mutable Mutex m_mutex;
|
|
|
|
|