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

Side by Side Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 13609002: fix a problem that android cannot download files with basic authentication (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h" 5 #include "chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate. h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 content::ResourceContext* resource_context, 317 content::ResourceContext* resource_context,
318 int child_id, 318 int child_id,
319 int route_id, 319 int route_id,
320 int request_id, 320 int request_id,
321 bool is_content_initiated, 321 bool is_content_initiated,
322 bool must_download, 322 bool must_download,
323 ScopedVector<content::ResourceThrottle>* throttles) { 323 ScopedVector<content::ResourceThrottle>* throttles) {
324 BrowserThread::PostTask( 324 BrowserThread::PostTask(
325 BrowserThread::UI, FROM_HERE, 325 BrowserThread::UI, FROM_HERE,
326 base::Bind(&NotifyDownloadInitiatedOnUI, child_id, route_id)); 326 base::Bind(&NotifyDownloadInitiatedOnUI, child_id, route_id));
327
328 // If it's from the web, we don't trust it, so we push the throttle on. 327 // If it's from the web, we don't trust it, so we push the throttle on.
329 if (is_content_initiated) { 328 if (is_content_initiated) {
330 throttles->push_back(new DownloadResourceThrottle( 329 throttles->push_back(new DownloadResourceThrottle(
331 download_request_limiter_, child_id, route_id, request_id, 330 download_request_limiter_, child_id, route_id, request_id,
332 request->method())); 331 request->method(), request->HasAuth()));
333 } 332 }
334 333
335 // If this isn't a new request, we've seen this before and added the standard 334 // If this isn't a new request, we've seen this before and added the standard
336 // resource throttles already so no need to add it again. 335 // resource throttles already so no need to add it again.
337 if (!request->is_pending()) { 336 if (!request->is_pending()) {
338 AppendStandardResourceThrottles(request, 337 AppendStandardResourceThrottles(request,
339 resource_context, 338 resource_context,
340 child_id, 339 child_id,
341 route_id, 340 route_id,
342 ResourceType::MAIN_FRAME, 341 ResourceType::MAIN_FRAME,
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 int child_id, route_id; 624 int child_id, route_id;
626 if (!prerender::PrerenderManager::DoesURLHaveValidScheme(redirect_url) && 625 if (!prerender::PrerenderManager::DoesURLHaveValidScheme(redirect_url) &&
627 ResourceRequestInfo::ForRequest(request)->GetAssociatedRenderView( 626 ResourceRequestInfo::ForRequest(request)->GetAssociatedRenderView(
628 &child_id, &route_id) && 627 &child_id, &route_id) &&
629 prerender_tracker_->IsPrerenderingOnIOThread(child_id, route_id)) { 628 prerender_tracker_->IsPrerenderingOnIOThread(child_id, route_id)) {
630 prerender_tracker_->TryCancel( 629 prerender_tracker_->TryCancel(
631 child_id, route_id, prerender::FINAL_STATUS_UNSUPPORTED_SCHEME); 630 child_id, route_id, prerender::FINAL_STATUS_UNSUPPORTED_SCHEME);
632 request->Cancel(); 631 request->Cancel();
633 } 632 }
634 } 633 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698