Commit 9dcf7246 authored by tyoshino@chromium.org's avatar tyoshino@chromium.org

Split ResourceDispatcherHostImpl::BeginRequest

This method is very long. Factor out code building a resource handler
into a separate method to improve readability.

BUG=none

Review URL: https://codereview.chromium.org/94503003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238346 0039d316-1c4b-4281-b951-d872f2087c98
parent 96496f30
......@@ -1131,6 +1131,23 @@ void ResourceDispatcherHostImpl::BeginRequest(
request, filter_->appcache_service(), child_id,
request_data.appcache_host_id, request_data.resource_type);
scoped_ptr<ResourceHandler> handler(
CreateResourceHandler(
request,
request_data, sync_result, route_id, process_type, child_id,
resource_context));
BeginRequestInternal(new_request.Pass(), handler.Pass());
}
scoped_ptr<ResourceHandler> ResourceDispatcherHostImpl::CreateResourceHandler(
net::URLRequest* request,
const ResourceHostMsg_Request& request_data,
IPC::Message* sync_result,
int route_id,
int process_type,
int child_id,
ResourceContext* resource_context) {
// Construct the IPC resource handler.
scoped_ptr<ResourceHandler> handler;
if (sync_result) {
......@@ -1185,7 +1202,7 @@ void ResourceDispatcherHostImpl::BeginRequest(
handler.reset(
new ThrottlingResourceHandler(handler.Pass(), request, throttles.Pass()));
BeginRequestInternal(new_request.Pass(), handler.Pass());
return handler.Pass();
}
void ResourceDispatcherHostImpl::OnReleaseDownloadedFile(int request_id) {
......
......@@ -372,6 +372,18 @@ class CONTENT_EXPORT ResourceDispatcherHostImpl
const ResourceHostMsg_Request& request_data,
IPC::Message* sync_result, // only valid for sync
int route_id); // only valid for async
// Creates a ResourceHandler to be used by BeginRequest() for normal resource
// loading.
scoped_ptr<ResourceHandler> CreateResourceHandler(
net::URLRequest* request,
const ResourceHostMsg_Request& request_data,
IPC::Message* sync_result,
int route_id,
int process_type,
int child_id,
ResourceContext* resource_context);
void OnDataDownloadedACK(int request_id);
void OnUploadProgressACK(int request_id);
void OnCancelRequest(int request_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment