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

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

Issue 9314037: Save As for content retrieved via POST works in most circumstances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add test page 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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 const content::ResourceContext& context) { 886 const content::ResourceContext& context) {
887 if (is_shutdown_) 887 if (is_shutdown_)
888 return net::ERR_INSUFFICIENT_RESOURCES; 888 return net::ERR_INSUFFICIENT_RESOURCES;
889 889
890 const GURL& url = request->original_url(); 890 const GURL& url = request->original_url();
891 const net::URLRequestContext* request_context = context.request_context(); 891 const net::URLRequestContext* request_context = context.request_context();
892 request->set_referrer(MaybeStripReferrer(GURL(request->referrer())).spec()); 892 request->set_referrer(MaybeStripReferrer(GURL(request->referrer())).spec());
893 request->set_context(request_context); 893 request->set_context(request_context);
894 int extra_load_flags = net::LOAD_IS_DOWNLOAD; 894 int extra_load_flags = net::LOAD_IS_DOWNLOAD;
895 if (prefer_cache) { 895 if (prefer_cache) {
896 extra_load_flags |= net::LOAD_PREFERRING_CACHE; 896 if (request->get_upload() != NULL)
Randy Smith (Not in Mondays) 2012/02/02 19:46:10 I think I'd like a comment here. The form of the
cbentzel 2012/02/03 15:54:47 I cover this with a comment in BeginDownload in do
Randy Smith (Not in Mondays) 2012/02/03 19:43:06 I'm afraid so. Code's better when it can be under
cbentzel 2012/02/03 20:29:31 Patch Set #9 adds a comment here.
897 extra_load_flags |= net::LOAD_ONLY_FROM_CACHE;
898 else
899 extra_load_flags |= net::LOAD_PREFERRING_CACHE;
897 } else { 900 } else {
898 extra_load_flags |= net::LOAD_DISABLE_CACHE; 901 extra_load_flags |= net::LOAD_DISABLE_CACHE;
899 } 902 }
900 request->set_load_flags(request->load_flags() | extra_load_flags); 903 request->set_load_flags(request->load_flags() | extra_load_flags);
901 // Check if the renderer is permitted to request the requested URL. 904 // Check if the renderer is permitted to request the requested URL.
902 if (!ChildProcessSecurityPolicy::GetInstance()-> 905 if (!ChildProcessSecurityPolicy::GetInstance()->
903 CanRequestURL(child_id, url)) { 906 CanRequestURL(child_id, url)) {
904 VLOG(1) << "Denied unauthorized download request for " 907 VLOG(1) << "Denied unauthorized download request for "
905 << url.possibly_invalid_spec(); 908 << url.possibly_invalid_spec();
906 return net::ERR_ACCESS_DENIED; 909 return net::ERR_ACCESS_DENIED;
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after
2268 scoped_refptr<ResourceHandler> transferred_resource_handler( 2271 scoped_refptr<ResourceHandler> transferred_resource_handler(
2269 new DoomedResourceHandler(info->resource_handler())); 2272 new DoomedResourceHandler(info->resource_handler()));
2270 info->set_resource_handler(transferred_resource_handler.get()); 2273 info->set_resource_handler(transferred_resource_handler.get());
2271 } 2274 }
2272 2275
2273 bool ResourceDispatcherHost::IsTransferredNavigation( 2276 bool ResourceDispatcherHost::IsTransferredNavigation(
2274 const content::GlobalRequestID& transferred_request_id) const { 2277 const content::GlobalRequestID& transferred_request_id) const {
2275 return transferred_navigations_.find(transferred_request_id) != 2278 return transferred_navigations_.find(transferred_request_id) !=
2276 transferred_navigations_.end(); 2279 transferred_navigations_.end();
2277 } 2280 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698