| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |