| 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 b4af7536024d263e40a333bc158e7c2aeb36481c..ae8c27b735360e5c267fbd4cb3ba05f1b2e1546e 100644
|
| --- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h
|
| +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h
|
| @@ -8,6 +8,7 @@
|
| #include <memory>
|
|
|
| #include "core/CoreExport.h"
|
| +#include "platform/WebTaskRunner.h"
|
| #include "platform/heap/Handle.h"
|
| #include "platform/wtf/Noncopyable.h"
|
| #include "platform/wtf/text/WTFString.h"
|
| @@ -15,7 +16,7 @@
|
|
|
| namespace blink {
|
|
|
| -class PendingScript;
|
| +class ClassicPendingScript;
|
| class Resource;
|
| class ScriptResource;
|
| class ScriptState;
|
| @@ -24,12 +25,12 @@ 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
|
| -// moment, ScriptStreamer is only used for parser blocking scripts; this means
|
| -// that the Document stays stable and no other scripts are executing while we're
|
| -// streaming. It is possible, though, that Document and the PendingScript are
|
| -// destroyed while the streaming is in progress, and ScriptStreamer handles it
|
| -// gracefully.
|
| +// while it's loaded. ClassicPendingScript holds a reference to ScriptStreamer.
|
| +// At the moment, ScriptStreamer is only used for parser blocking scripts; this
|
| +// means that the Document stays stable and no other scripts are executing
|
| +// while we're streaming. It is possible, though, that Document and the
|
| +// ClassicPendingScript are destroyed while the streaming is in progress, and
|
| +// ScriptStreamer handles it gracefully.
|
| class CORE_EXPORT ScriptStreamer final
|
| : public GarbageCollectedFinalized<ScriptStreamer> {
|
| WTF_MAKE_NONCOPYABLE(ScriptStreamer);
|
| @@ -41,8 +42,8 @@ class CORE_EXPORT ScriptStreamer final
|
| DECLARE_TRACE();
|
|
|
| // Launches a task (on a background thread) which will stream the given
|
| - // PendingScript into V8 as it loads.
|
| - static void startStreaming(PendingScript*,
|
| + // ClassicPendingScript into V8 as it loads.
|
| + static void startStreaming(ClassicPendingScript*,
|
| Type,
|
| Settings*,
|
| ScriptState*,
|
| @@ -58,9 +59,9 @@ class CORE_EXPORT ScriptStreamer final
|
| ScriptResource* resource() const { return m_resource; }
|
|
|
| // Called when the script is not needed any more (e.g., loading was
|
| - // cancelled). After calling cancel, PendingScript can drop its reference to
|
| - // ScriptStreamer, and ScriptStreamer takes care of eventually deleting
|
| - // itself (after the V8 side has finished too).
|
| + // cancelled). After calling cancel, ClassicPendingScript can drop its
|
| + // reference to ScriptStreamer, and ScriptStreamer takes care of eventually
|
| + // deleting itself (after the V8 side has finished too).
|
| void cancel();
|
|
|
| // When the streaming is suppressed, the data is not given to V8, but
|
| @@ -76,7 +77,7 @@ class CORE_EXPORT ScriptStreamer final
|
| return m_compileOptions;
|
| }
|
|
|
| - // Called by PendingScript when data arrives from the network.
|
| + // Called by ClassicPendingScript when data arrives from the network.
|
| void notifyAppendData(ScriptResource*);
|
| void notifyFinished(Resource*);
|
|
|
| @@ -105,7 +106,7 @@ class CORE_EXPORT ScriptStreamer final
|
| static size_t s_smallScriptThreshold;
|
|
|
| static ScriptStreamer* create(
|
| - PendingScript* script,
|
| + ClassicPendingScript* script,
|
| Type scriptType,
|
| ScriptState* scriptState,
|
| v8::ScriptCompiler::CompileOptions compileOptions,
|
| @@ -113,7 +114,7 @@ class CORE_EXPORT ScriptStreamer final
|
| return new ScriptStreamer(script, scriptType, scriptState, compileOptions,
|
| std::move(loadingTaskRunner));
|
| }
|
| - ScriptStreamer(PendingScript*,
|
| + ScriptStreamer(ClassicPendingScript*,
|
| Type,
|
| ScriptState*,
|
| v8::ScriptCompiler::CompileOptions,
|
| @@ -122,16 +123,16 @@ class CORE_EXPORT ScriptStreamer final
|
| void streamingComplete();
|
| void notifyFinishedToClient();
|
|
|
| - static bool startStreamingInternal(PendingScript*,
|
| + static bool startStreamingInternal(ClassicPendingScript*,
|
| Type,
|
| Settings*,
|
| ScriptState*,
|
| RefPtr<WebTaskRunner>);
|
|
|
| - Member<PendingScript> m_pendingScript;
|
| - // This pointer is weak. If PendingScript and its Resource are deleted
|
| - // before ScriptStreamer, PendingScript will notify ScriptStreamer of its
|
| - // deletion by calling cancel().
|
| + Member<ClassicPendingScript> m_pendingScript;
|
| + // This pointer is weak. If ClassicPendingScript and its Resource are deleted
|
| + // before ScriptStreamer, ClassicPendingScript will notify ScriptStreamer of
|
| + // its deletion by calling cancel().
|
| Member<ScriptResource> m_resource;
|
| // Whether ScriptStreamer is detached from the Resource. In those cases, the
|
| // script data is not needed any more, and the client won't get notified
|
|
|