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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h

Issue 2653923008: Reland of Split PendingScript into PendingScript and ClassicPendingScript (Closed)
Patch Set: Rebase Created 3 years, 8 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
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 81c2f92db03a8ad5b2fd4671fd7677a5bee2de32..cb582bad265c38df89603f142a77b3631a13c24c 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,21 +16,20 @@
namespace blink {
-class PendingScript;
+class ClassicPendingScript;
class Resource;
class ScriptResource;
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
-// 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 +41,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 +58,9 @@ class CORE_EXPORT ScriptStreamer final
ScriptResource* GetResource() const { return 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
@@ -72,7 +72,7 @@ class CORE_EXPORT ScriptStreamer final
void SuppressStreaming();
bool StreamingSuppressed() const { return streaming_suppressed_; }
- // Called by PendingScript when data arrives from the network.
+ // Called by ClassicPendingScript when data arrives from the network.
void NotifyAppendData(ScriptResource*);
void NotifyFinished(Resource*);
@@ -95,7 +95,7 @@ class CORE_EXPORT ScriptStreamer final
static size_t small_script_threshold_;
static ScriptStreamer* Create(
- PendingScript* script,
+ ClassicPendingScript* script,
Type script_type,
ScriptState* script_state,
v8::ScriptCompiler::CompileOptions compile_options,
@@ -103,7 +103,7 @@ class CORE_EXPORT ScriptStreamer final
return new ScriptStreamer(script, script_type, script_state,
compile_options, std::move(loading_task_runner));
}
- ScriptStreamer(PendingScript*,
+ ScriptStreamer(ClassicPendingScript*,
Type,
ScriptState*,
v8::ScriptCompiler::CompileOptions,
@@ -112,16 +112,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> pending_script_;
- // 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> pending_script_;
+ // 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> 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

Powered by Google App Engine
This is Rietveld 408576698