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

Side by Side Diff: content/browser/renderer_host/resource_dispatcher_host.cc

Issue 9321003: net: Make UploadData::GetContentLength() asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading
6 6
7 #include "content/browser/renderer_host/resource_dispatcher_host.h" 7 #include "content/browser/renderer_host/resource_dispatcher_host.h"
8 8
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 611
612 request->set_context( 612 request->set_context(
613 filter_->GetURLRequestContext(request_data.resource_type)); 613 filter_->GetURLRequestContext(request_data.resource_type));
614 request->set_priority(DetermineRequestPriority(request_data.resource_type)); 614 request->set_priority(DetermineRequestPriority(request_data.resource_type));
615 615
616 // Set upload data. 616 // Set upload data.
617 uint64 upload_size = 0; 617 uint64 upload_size = 0;
618 if (request_data.upload_data) { 618 if (request_data.upload_data) {
619 request->set_upload(request_data.upload_data); 619 request->set_upload(request_data.upload_data);
620 // This results in performing file IO. crbug.com/112607. 620 // This results in performing file IO. crbug.com/112607.
621 upload_size = request_data.upload_data->GetContentLength(); 621 upload_size = request_data.upload_data->GetContentLengthSyncHack();
622 } 622 }
623 623
624 // Install a CrossSiteResourceHandler if this request is coming from a 624 // Install a CrossSiteResourceHandler if this request is coming from a
625 // RenderViewHost with a pending cross-site request. We only check this for 625 // RenderViewHost with a pending cross-site request. We only check this for
626 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do 626 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do
627 // not count as cross-site, otherwise it gets blocked indefinitely. 627 // not count as cross-site, otherwise it gets blocked indefinitely.
628 if (request_data.resource_type == ResourceType::MAIN_FRAME && 628 if (request_data.resource_type == ResourceType::MAIN_FRAME &&
629 process_type == content::PROCESS_TYPE_RENDERER && 629 process_type == content::PROCESS_TYPE_RENDERER &&
630 CrossSiteRequestManager::GetInstance()-> 630 CrossSiteRequestManager::GetInstance()->
631 HasPendingCrossSiteRequest(child_id, route_id)) { 631 HasPendingCrossSiteRequest(child_id, route_id)) {
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after
2269 scoped_refptr<ResourceHandler> transferred_resource_handler( 2269 scoped_refptr<ResourceHandler> transferred_resource_handler(
2270 new DoomedResourceHandler(info->resource_handler())); 2270 new DoomedResourceHandler(info->resource_handler()));
2271 info->set_resource_handler(transferred_resource_handler.get()); 2271 info->set_resource_handler(transferred_resource_handler.get());
2272 } 2272 }
2273 2273
2274 bool ResourceDispatcherHost::IsTransferredNavigation( 2274 bool ResourceDispatcherHost::IsTransferredNavigation(
2275 const content::GlobalRequestID& transferred_request_id) const { 2275 const content::GlobalRequestID& transferred_request_id) const {
2276 return transferred_navigations_.find(transferred_request_id) != 2276 return transferred_navigations_.find(transferred_request_id) !=
2277 transferred_navigations_.end(); 2277 transferred_navigations_.end();
2278 } 2278 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698