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

Unified Diff: third_party/WebKit/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: Added comments Created 4 years, 11 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/FetchBlobDataConsumerHandle.cpp
diff --git a/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp b/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
index 0e98cb65e50c6088c2fa95b990a67e5bab8a00fa..01016800c2ca73813452f96c551ce9436ff36c43 100644
--- a/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
+++ b/third_party/WebKit/Source/modules/fetch/FetchBlobDataConsumerHandle.cpp
@@ -83,24 +83,25 @@ 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()) {
- return nullptr;
+ m_updater->update(createUnexpectedErrorDataConsumerHandle());
+ return;
}
BlobRegistry::registerPublicBlobURL(executionContext->securityOrigin(), url, m_blobDataHandle);
+ m_loader = createLoader(executionContext, this);
+ ASSERT(m_loader);
+
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;
@@ -110,7 +111,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
@@ -160,11 +161,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