| 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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 BrowserThread::PostTask( | 410 BrowserThread::PostTask( |
| 411 BrowserThread::UI, FROM_HERE, | 411 BrowserThread::UI, FROM_HERE, |
| 412 base::Bind(&NotifyDownloadInitiatedOnUI, child_id, route_id)); | 412 base::Bind(&NotifyDownloadInitiatedOnUI, child_id, route_id)); |
| 413 | 413 |
| 414 // If it's from the web, we don't trust it, so we push the throttle on. | 414 // If it's from the web, we don't trust it, so we push the throttle on. |
| 415 if (is_content_initiated) { | 415 if (is_content_initiated) { |
| 416 throttles->push_back( | 416 throttles->push_back( |
| 417 new DownloadResourceThrottle(download_request_limiter_.get(), | 417 new DownloadResourceThrottle(download_request_limiter_.get(), |
| 418 child_id, | 418 child_id, |
| 419 route_id, | 419 route_id, |
| 420 request_id, | 420 request->url(), |
| 421 request->method())); | 421 request->method())); |
| 422 #if defined(OS_ANDROID) | 422 #if defined(OS_ANDROID) |
| 423 throttles->push_back( | 423 throttles->push_back( |
| 424 new chrome::InterceptDownloadResourceThrottle( | 424 new chrome::InterceptDownloadResourceThrottle( |
| 425 request, child_id, route_id, request_id)); | 425 request, child_id, route_id, request_id)); |
| 426 #endif | 426 #endif |
| 427 } | 427 } |
| 428 | 428 |
| 429 // If this isn't a new request, we've seen this before and added the standard | 429 // If this isn't a new request, we've seen this before and added the standard |
| 430 // resource throttles already so no need to add it again. | 430 // resource throttles already so no need to add it again. |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 url_request->GetTotalReceivedBytes())); | 696 url_request->GetTotalReceivedBytes())); |
| 697 } | 697 } |
| 698 } | 698 } |
| 699 | 699 |
| 700 // static | 700 // static |
| 701 void ChromeResourceDispatcherHostDelegate:: | 701 void ChromeResourceDispatcherHostDelegate:: |
| 702 SetExternalProtocolHandlerDelegateForTesting( | 702 SetExternalProtocolHandlerDelegateForTesting( |
| 703 ExternalProtocolHandler::Delegate* delegate) { | 703 ExternalProtocolHandler::Delegate* delegate) { |
| 704 g_external_protocol_handler_delegate = delegate; | 704 g_external_protocol_handler_delegate = delegate; |
| 705 } | 705 } |
| OLD | NEW |