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

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

Issue 2172183003: Return unique_ptr<WebDataConsumerHandle::Reader> directly from obtainReader (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gmock_cxx11
Patch Set: rebase 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/DataConsumerTee.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/DataConsumerTee.cpp b/third_party/WebKit/Source/modules/fetch/DataConsumerTee.cpp
index a30dd8016c7c30a69b022ec2aa142202645ebffa..6ec7c80dc730cf39e55af507cdd1b19282a02cf9 100644
--- a/third_party/WebKit/Source/modules/fetch/DataConsumerTee.cpp
+++ b/third_party/WebKit/Source/modules/fetch/DataConsumerTee.cpp
@@ -317,9 +317,13 @@ public:
return wrapUnique(new DestinationHandle(contextProxy));
}
+ std::unique_ptr<Reader> obtainReader(Client* client)
+ {
+ return wrapUnique(new DestinationReader(m_contextProxy, client));
+ }
+
private:
DestinationHandle(PassRefPtr<DestinationContext::Proxy> contextProxy) : m_contextProxy(contextProxy) { }
- DestinationReader* obtainReaderInternal(Client* client) { return new DestinationReader(m_contextProxy, client); }
const char* debugName() const override { return "DestinationHandle"; }
RefPtr<DestinationContext::Proxy> m_contextProxy;
@@ -418,7 +422,7 @@ void DataConsumerTee::create(ExecutionContext* executionContext, std::unique_ptr
void DataConsumerTee::create(ExecutionContext* executionContext, std::unique_ptr<FetchDataConsumerHandle> src, std::unique_ptr<FetchDataConsumerHandle>* dest1, std::unique_ptr<FetchDataConsumerHandle>* dest2)
{
- RefPtr<BlobDataHandle> blobDataHandle = src->obtainReader(nullptr)->drainAsBlobDataHandle(FetchDataConsumerHandle::Reader::AllowBlobWithInvalidSize);
+ RefPtr<BlobDataHandle> blobDataHandle = src->obtainFetchDataReader(nullptr)->drainAsBlobDataHandle(FetchDataConsumerHandle::Reader::AllowBlobWithInvalidSize);
if (blobDataHandle) {
*dest1 = FetchBlobDataConsumerHandle::create(executionContext, blobDataHandle);
*dest2 = FetchBlobDataConsumerHandle::create(executionContext, blobDataHandle);

Powered by Google App Engine
This is Rietveld 408576698