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

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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 640
641 request->set_context( 641 request->set_context(
642 filter_->GetURLRequestContext(request_data.resource_type)); 642 filter_->GetURLRequestContext(request_data.resource_type));
643 request->set_priority(DetermineRequestPriority(request_data.resource_type)); 643 request->set_priority(DetermineRequestPriority(request_data.resource_type));
644 644
645 // Set upload data. 645 // Set upload data.
646 uint64 upload_size = 0; 646 uint64 upload_size = 0;
647 if (request_data.upload_data) { 647 if (request_data.upload_data) {
648 request->set_upload(request_data.upload_data); 648 request->set_upload(request_data.upload_data);
649 // This results in performing file IO. crbug.com/112607. 649 // This results in performing file IO. crbug.com/112607.
650 upload_size = request_data.upload_data->GetContentLength(); 650 upload_size = request_data.upload_data->GetContentLengthSyncHack();
651 } 651 }
652 652
653 // Install a CrossSiteResourceHandler if this request is coming from a 653 // Install a CrossSiteResourceHandler if this request is coming from a
654 // RenderViewHost with a pending cross-site request. We only check this for 654 // RenderViewHost with a pending cross-site request. We only check this for
655 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do 655 // MAIN_FRAME requests. Unblock requests only come from a blocked page, do
656 // not count as cross-site, otherwise it gets blocked indefinitely. 656 // not count as cross-site, otherwise it gets blocked indefinitely.
657 if (request_data.resource_type == ResourceType::MAIN_FRAME && 657 if (request_data.resource_type == ResourceType::MAIN_FRAME &&
658 process_type == content::PROCESS_TYPE_RENDERER && 658 process_type == content::PROCESS_TYPE_RENDERER &&
659 CrossSiteRequestManager::GetInstance()-> 659 CrossSiteRequestManager::GetInstance()->
660 HasPendingCrossSiteRequest(child_id, route_id)) { 660 HasPendingCrossSiteRequest(child_id, route_id)) {
(...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after
2300 scoped_refptr<ResourceHandler> transferred_resource_handler( 2300 scoped_refptr<ResourceHandler> transferred_resource_handler(
2301 new DoomedResourceHandler(info->resource_handler())); 2301 new DoomedResourceHandler(info->resource_handler()));
2302 info->set_resource_handler(transferred_resource_handler.get()); 2302 info->set_resource_handler(transferred_resource_handler.get());
2303 } 2303 }
2304 2304
2305 bool ResourceDispatcherHost::IsTransferredNavigation( 2305 bool ResourceDispatcherHost::IsTransferredNavigation(
2306 const content::GlobalRequestID& transferred_request_id) const { 2306 const content::GlobalRequestID& transferred_request_id) const {
2307 return transferred_navigations_.find(transferred_request_id) != 2307 return transferred_navigations_.find(transferred_request_id) !=
2308 transferred_navigations_.end(); 2308 transferred_navigations_.end();
2309 } 2309 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698