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

Unified Diff: third_party/WebKit/Source/core/dom/PendingScript.cpp

Issue 2800683005: Introduce PendingScript::startStreamingIfPossible() (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/core/dom/PendingScript.cpp
diff --git a/third_party/WebKit/Source/core/dom/PendingScript.cpp b/third_party/WebKit/Source/core/dom/PendingScript.cpp
index 4771069d7d7d2441578ca73f93d1c3db92347f33..049af533de121697d441094207a27a7c9f46b217 100644
--- a/third_party/WebKit/Source/core/dom/PendingScript.cpp
+++ b/third_party/WebKit/Source/core/dom/PendingScript.cpp
@@ -26,7 +26,12 @@
#include "core/dom/PendingScript.h"
#include "bindings/core/v8/ScriptSourceCode.h"
+#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/V8Binding.h"
+#include "core/dom/Document.h"
#include "core/dom/ScriptElementBase.h"
+#include "core/dom/TaskRunnerHelper.h"
+#include "core/frame/LocalFrame.h"
#include "core/frame/SubresourceIntegrity.h"
#include "platform/SharedBuffer.h"
#include "wtf/CurrentTime.h"
@@ -273,4 +278,19 @@ void PendingScript::onPurgeMemory() {
m_streamer = nullptr;
}
+void PendingScript::startStreamingIfPossible(
+ Document* document,
+ ScriptStreamer::Type streamerType) {
+ if (!document->frame())
+ return;
+
+ ScriptState* scriptState = toScriptStateForMainWorld(document->frame());
+ if (!scriptState)
+ return;
+
+ ScriptStreamer::startStreaming(
+ this, streamerType, document->frame()->settings(), scriptState,
+ TaskRunnerHelper::get(TaskType::Networking, document));
+}
+
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/PendingScript.h ('k') | third_party/WebKit/Source/core/dom/ScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698