| 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 205993824612efaa6fe85cfdb8091d4e62305292..450641e0148f93008071c2abdd3fbe72402ac1de 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"
|
| @@ -958,14 +957,10 @@ void ResourceDispatcherHostImpl::BeginRequest(
|
| request->set_priority(DetermineRequestPriority(request_data.resource_type));
|
|
|
| // Resolve elements from request_body and prepare upload data.
|
| - uint64 upload_size = 0;
|
| if (request_data.request_body) {
|
| request->set_upload(
|
| request_data.request_body->ResolveElementsAndCreateUploadData(
|
| GetBlobStorageControllerForResourceContext(resource_context)));
|
| - // This results in performing file IO. crbug.com/112607.
|
| - base::ThreadRestrictions::ScopedAllowIO allow_io;
|
| - upload_size = request->get_upload_mutable()->GetContentLengthSync();
|
| }
|
|
|
| bool allow_download = request_data.allow_download &&
|
| @@ -985,7 +980,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,
|
| @@ -1185,7 +1179,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
|
| @@ -1592,7 +1585,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 = request->GetUploadProgress().size();
|
| if (request->GetLoadState().state != net::LOAD_STATE_SENDING_REQUEST)
|
| upload_size = 0;
|
| std::pair<int, int> key(info->GetChildID(), info->GetRouteID());
|
| @@ -1604,6 +1597,7 @@ void ResourceDispatcherHostImpl::UpdateLoadStates() {
|
| net::URLRequest* request = i->second->request();
|
| ResourceRequestInfoImpl* info = i->second->GetRequestInfo();
|
| net::LoadStateWithParam load_state = request->GetLoadState();
|
| + net::UploadProgress progress = request->GetUploadProgress();
|
|
|
| // We also poll for upload progress on this timer and send upload
|
| // progress ipc messages to the plugin process.
|
| @@ -1614,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])
|
| + progress.size() < largest_upload_size[key])
|
| continue;
|
|
|
| net::LoadStateWithParam to_insert = load_state;
|
| @@ -1628,8 +1622,8 @@ 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_position = request->GetUploadProgress();
|
| + load_info.upload_size = progress.size();
|
| + load_info.upload_position = progress.position();
|
| }
|
|
|
| if (info_map.empty())
|
|
|