Index: content/browser/renderer_host/resource_dispatcher_host_impl.cc |
diff --git a/content/browser/renderer_host/resource_dispatcher_host_impl.cc b/content/browser/renderer_host/resource_dispatcher_host_impl.cc |
index 052e5ce9d52d6a8249849bdb17ec96617a296e13..196c4146623ded4d35bbe17a068bb34adb23bc17 100644 |
--- a/content/browser/renderer_host/resource_dispatcher_host_impl.cc |
+++ b/content/browser/renderer_host/resource_dispatcher_host_impl.cc |
@@ -21,7 +21,6 @@ |
#include "base/shared_memory.h" |
#include "base/stl_util.h" |
#include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
-#include "base/threading/thread_restrictions.h" |
#include "content/browser/appcache/chrome_appcache_service.h" |
#include "content/browser/cert_store_impl.h" |
#include "content/browser/child_process_security_policy_impl.h" |
@@ -962,13 +961,8 @@ void ResourceDispatcherHostImpl::BeginRequest( |
request->set_priority(DetermineRequestPriority(request_data.resource_type)); |
// Set upload data. |
- uint64 upload_size = 0; |
- if (request_data.upload_data) { |
+ if (request_data.upload_data) |
request->set_upload(request_data.upload_data); |
- // This results in performing file IO. crbug.com/112607. |
- base::ThreadRestrictions::ScopedAllowIO allow_io; |
- upload_size = request_data.upload_data->GetContentLengthSync(); |
- } |
bool allow_download = request_data.allow_download && |
ResourceType::IsFrame(request_data.resource_type); |
@@ -987,7 +981,6 @@ void ResourceDispatcherHostImpl::BeginRequest( |
request_data.parent_frame_id, |
request_data.resource_type, |
request_data.transition_type, |
- upload_size, |
false, // is download |
allow_download, |
request_data.has_user_gesture, |
@@ -1187,7 +1180,6 @@ ResourceRequestInfoImpl* ResourceDispatcherHostImpl::CreateRequestInfo( |
-1, // parent_frame_id |
ResourceType::SUB_RESOURCE, |
PAGE_TRANSITION_LINK, |
- 0, // upload_size |
download, // is_download |
download, // allow_download |
false, // has_user_gesture |
@@ -1594,7 +1586,7 @@ void ResourceDispatcherHostImpl::UpdateLoadStates() { |
for (i = pending_loaders_.begin(); i != pending_loaders_.end(); ++i) { |
net::URLRequest* request = i->second->request(); |
ResourceRequestInfoImpl* info = i->second->GetRequestInfo(); |
- uint64 upload_size = info->GetUploadSize(); |
+ uint64 upload_size = i->second->upload_size(); |
if (request->GetLoadState().state != net::LOAD_STATE_SENDING_REQUEST) |
upload_size = 0; |
std::pair<int, int> key(info->GetChildID(), info->GetRouteID()); |
@@ -1616,7 +1608,7 @@ void ResourceDispatcherHostImpl::UpdateLoadStates() { |
// If a request is uploading data, ignore all other requests so that the |
// upload progress takes priority for being shown in the status bar. |
if (largest_upload_size.find(key) != largest_upload_size.end() && |
- info->GetUploadSize() < largest_upload_size[key]) |
+ i->second->upload_size() < largest_upload_size[key]) |
continue; |
net::LoadStateWithParam to_insert = load_state; |
@@ -1630,7 +1622,7 @@ void ResourceDispatcherHostImpl::UpdateLoadStates() { |
LoadInfo& load_info = info_map[key]; |
load_info.url = request->url(); |
load_info.load_state = to_insert; |
- load_info.upload_size = info->GetUploadSize(); |
+ load_info.upload_size = i->second->upload_size(); |
load_info.upload_position = request->GetUploadProgress(); |
} |