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

Unified Diff: Source/modules/fetch/FetchBlobDataConsumerHandle.cpp

Issue 1264453002: Split the constructor of ThreadableLoader into two methods (ctor and start()) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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: Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
diff --git a/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp b/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
index 9005fb551944f0fc283f8c371eaa5be99f5a03fb..86b29f157b6331d1aeb7d75fd4f09de14200f52b 100644
--- a/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
+++ b/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
@@ -244,24 +244,23 @@ public:
ASSERT(executionContext->isContextThread());
ASSERT(!m_loader);
- m_loader = createLoader(executionContext, this);
- if (!m_loader)
- m_updater->update(createUnexpectedErrorDataConsumerHandle());
- }
-
-private:
- PassRefPtr<ThreadableLoader> createLoader(ExecutionContext* executionContext, ThreadableLoaderClient* client) const
- {
KURL url = BlobURL::createPublicURL(executionContext->securityOrigin());
if (url.isEmpty()) {
hiroshige 2015/07/30 12:07:21 Please call m_updater->update(createUnexpectedErro
tyoshino (SeeGerritForStatus) 2015/07/31 08:00:42 Good catch! Done
- return nullptr;
+ return;
}
BlobRegistry::registerPublicBlobURL(executionContext->securityOrigin(), url, m_blobDataHandle);
+ m_loader = createLoader(executionContext, this);
hiroshige 2015/07/30 12:07:21 Please add ASSERT(m_loader) here.
tyoshino (SeeGerritForStatus) 2015/07/31 08:00:42 Done.
+
ResourceRequest request(url);
request.setRequestContext(WebURLRequest::RequestContextInternal);
request.setUseStreamOnResponse(true);
+ m_loader->start(request);
+ }
+private:
+ PassRefPtr<ThreadableLoader> createLoader(ExecutionContext* executionContext, ThreadableLoaderClient* client) const
+ {
ThreadableLoaderOptions options;
options.preflightPolicy = ConsiderPreflight;
options.crossOriginRequestPolicy = DenyCrossOriginRequests;
@@ -271,7 +270,7 @@ private:
ResourceLoaderOptions resourceLoaderOptions;
resourceLoaderOptions.dataBufferingPolicy = DoNotBufferData;
- return m_loaderFactory->create(*executionContext, client, request, options, resourceLoaderOptions);
+ return m_loaderFactory->create(*executionContext, client, options, resourceLoaderOptions);
}
// ThreadableLoaderClient
@@ -321,11 +320,10 @@ public:
PassRefPtr<ThreadableLoader> create(
ExecutionContext& executionContext,
ThreadableLoaderClient* client,
- const ResourceRequest& request,
const ThreadableLoaderOptions& options,
const ResourceLoaderOptions& resourceLoaderOptions) override
{
- return ThreadableLoader::create(executionContext, client, request, options, resourceLoaderOptions);
+ return ThreadableLoader::create(executionContext, client, options, resourceLoaderOptions);
}
};

Powered by Google App Engine
This is Rietveld 408576698