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

Unified Diff: third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp

Issue 2177243002: Use per-frame TaskRunner instead of thread's default in DataConsumerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@data_consumer_handle_unique_ptr
Patch Set: update Created 4 years, 5 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/modules/fetch/BodyStreamBuffer.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
index ea9bebed928461031340a6baa041b9e68de1e88c..b1c2c36f191e028bafa8cd82c0437043a05a062c 100644
--- a/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
+++ b/third_party/WebKit/Source/modules/fetch/BodyStreamBuffer.cpp
@@ -10,6 +10,7 @@
#include "core/dom/DOMArrayBuffer.h"
#include "core/dom/DOMTypedArray.h"
#include "core/dom/ExceptionCode.h"
+#include "core/dom/TaskRunnerHelper.h"
#include "core/streams/ReadableStreamController.h"
#include "core/streams/ReadableStreamOperations.h"
#include "core/workers/WorkerGlobalScope.h"
@@ -53,31 +54,41 @@ public:
void didFetchDataLoadedBlobHandle(PassRefPtr<BlobDataHandle> blobDataHandle) override
{
m_buffer->endLoading();
- m_client->didFetchDataLoadedBlobHandle(blobDataHandle);
+ if (m_client)
+ m_client->didFetchDataLoadedBlobHandle(blobDataHandle);
}
void didFetchDataLoadedArrayBuffer(DOMArrayBuffer* arrayBuffer) override
{
m_buffer->endLoading();
- m_client->didFetchDataLoadedArrayBuffer(arrayBuffer);
+ if (m_client)
+ m_client->didFetchDataLoadedArrayBuffer(arrayBuffer);
}
void didFetchDataLoadedString(const String& string) override
{
m_buffer->endLoading();
- m_client->didFetchDataLoadedString(string);
+ if (m_client)
+ m_client->didFetchDataLoadedString(string);
}
void didFetchDataLoadedStream() override
{
m_buffer->endLoading();
- m_client->didFetchDataLoadedStream();
+ if (m_client)
+ m_client->didFetchDataLoadedStream();
}
void didFetchDataLoadFailed() override
{
m_buffer->endLoading();
- m_client->didFetchDataLoadFailed();
+ if (m_client)
+ m_client->didFetchDataLoadFailed();
+ }
+
+ WebTaskRunner* getTaskRunner() override
+ {
+ return m_client ? m_client->getTaskRunner() : TaskRunnerHelper::getUnthrottledTaskRunner(getExecutionContext());
}
DEFINE_INLINE_TRACE()
@@ -296,6 +307,11 @@ void BodyStreamBuffer::didGetReadable()
processData();
}
+WebTaskRunner* BodyStreamBuffer::getTaskRunner()
+{
+ return TaskRunnerHelper::getUnthrottledTaskRunner(scriptState());
+}
+
bool BodyStreamBuffer::hasPendingActivity() const
{
if (m_loader)

Powered by Google App Engine
This is Rietveld 408576698