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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host_impl.cc

Issue 10825073: Stop using ScopedAllowIO in content::ResourceDispatcherHostImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove const Created 8 years, 4 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
« no previous file with comments | « chrome_frame/urlmon_url_request.cc ('k') | content/browser/renderer_host/resource_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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())
« no previous file with comments | « chrome_frame/urlmon_url_request.cc ('k') | content/browser/renderer_host/resource_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698