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

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

Issue 1366883002: [Reland] Post loading tasks on the appropriate WebFrameScheduler's queue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix UAF in BackgroundHTMLParser Created 5 years, 2 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 e3eb425878a429be07503850888b10cfe5355b4c..c002175480a9180c27b37d325d81a35dfaa3c6cf 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;
+
+ OwnPtr<WebTaskRunner> m_loadingTaskRunner;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698