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

Unified Diff: Source/bindings/core/v8/ScriptStreamer.cpp

Issue 1143083005: Replace ScriptStreamerTask with blink::Task and threadSafeBind() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use threadSafeBind(). Created 5 years, 7 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
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptStreamerThread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ScriptStreamer.cpp
diff --git a/Source/bindings/core/v8/ScriptStreamer.cpp b/Source/bindings/core/v8/ScriptStreamer.cpp
index 59572fbfe7b9689bc8aafade642ec47be062780d..fac4faa6f31adbf3e770f519778d7aa547dca513 100644
--- a/Source/bindings/core/v8/ScriptStreamer.cpp
+++ b/Source/bindings/core/v8/ScriptStreamer.cpp
@@ -14,6 +14,7 @@
#include "core/frame/Settings.h"
#include "core/html/parser/TextResourceDecoder.h"
#include "platform/SharedBuffer.h"
+#include "platform/Task.h"
#include "platform/ThreadSafeFunctional.h"
#include "platform/TraceEvent.h"
#include "public/platform/Platform.h"
@@ -429,8 +430,7 @@ void ScriptStreamer::notifyAppendData(ScriptResource* resource)
// running. This is taken care of with a manual ref() & deref() pair;
// the corresponding deref() is in streamingComplete.
ref();
- ScriptStreamingTask* task = new ScriptStreamingTask(scriptStreamingTask.release(), this);
- ScriptStreamerThread::shared()->postTask(task);
+ ScriptStreamerThread::shared()->postTask(new Task(threadSafeBind(&ScriptStreamerThread::runScriptStreamingTask, scriptStreamingTask.release(), AllowCrossThreadAccess(this))));
Platform::current()->histogramEnumeration(startedStreamingHistogramName(m_scriptType), 1, 2);
}
if (m_stream)
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptStreamerThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698