| 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 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "components/content_settings/core/browser/host_content_settings_map.h" | 35 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 36 #include "components/google/core/browser/google_util.h" | 36 #include "components/google/core/browser/google_util.h" |
| 37 #include "components/variations/net/variations_http_header_provider.h" | 37 #include "components/variations/net/variations_http_header_provider.h" |
| 38 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
| 39 #include "content/public/browser/notification_service.h" | 39 #include "content/public/browser/notification_service.h" |
| 40 #include "content/public/browser/render_process_host.h" | 40 #include "content/public/browser/render_process_host.h" |
| 41 #include "content/public/browser/render_view_host.h" | 41 #include "content/public/browser/render_view_host.h" |
| 42 #include "content/public/browser/resource_context.h" | 42 #include "content/public/browser/resource_context.h" |
| 43 #include "content/public/browser/resource_dispatcher_host.h" | 43 #include "content/public/browser/resource_dispatcher_host.h" |
| 44 #include "content/public/browser/resource_request_info.h" | 44 #include "content/public/browser/resource_request_info.h" |
| 45 #include "content/public/browser/service_worker_context.h" |
| 45 #include "content/public/browser/stream_info.h" | 46 #include "content/public/browser/stream_info.h" |
| 46 #include "content/public/browser/web_contents.h" | 47 #include "content/public/browser/web_contents.h" |
| 47 #include "content/public/common/resource_response.h" | 48 #include "content/public/common/resource_response.h" |
| 48 #include "net/base/load_flags.h" | 49 #include "net/base/load_flags.h" |
| 49 #include "net/base/load_timing_info.h" | 50 #include "net/base/load_timing_info.h" |
| 50 #include "net/base/request_priority.h" | 51 #include "net/base/request_priority.h" |
| 51 #include "net/http/http_response_headers.h" | 52 #include "net/http/http_response_headers.h" |
| 52 #include "net/url_request/url_request.h" | 53 #include "net/url_request/url_request.h" |
| 53 | 54 |
| 54 #if !defined(DISABLE_NACL) | 55 #if !defined(DISABLE_NACL) |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 } // namespace | 265 } // namespace |
| 265 | 266 |
| 266 ChromeResourceDispatcherHostDelegate::ChromeResourceDispatcherHostDelegate( | 267 ChromeResourceDispatcherHostDelegate::ChromeResourceDispatcherHostDelegate( |
| 267 prerender::PrerenderTracker* prerender_tracker) | 268 prerender::PrerenderTracker* prerender_tracker) |
| 268 : download_request_limiter_(g_browser_process->download_request_limiter()), | 269 : download_request_limiter_(g_browser_process->download_request_limiter()), |
| 269 safe_browsing_(g_browser_process->safe_browsing_service()), | 270 safe_browsing_(g_browser_process->safe_browsing_service()), |
| 270 #if defined(ENABLE_EXTENSIONS) | 271 #if defined(ENABLE_EXTENSIONS) |
| 271 user_script_listener_(new extensions::UserScriptListener()), | 272 user_script_listener_(new extensions::UserScriptListener()), |
| 272 #endif | 273 #endif |
| 273 prerender_tracker_(prerender_tracker) { | 274 prerender_tracker_(prerender_tracker) { |
| 275 BrowserThread::PostTask( |
| 276 BrowserThread::IO, |
| 277 FROM_HERE, |
| 278 base::Bind(content::ServiceWorkerContext::AddExcludedHeadersForFetchEvent, |
| 279 variations::VariationsHttpHeaderProvider::GetInstance() |
| 280 ->GetVariationHeaderNames())); |
| 274 } | 281 } |
| 275 | 282 |
| 276 ChromeResourceDispatcherHostDelegate::~ChromeResourceDispatcherHostDelegate() { | 283 ChromeResourceDispatcherHostDelegate::~ChromeResourceDispatcherHostDelegate() { |
| 277 #if defined(ENABLE_EXTENSIONS) | 284 #if defined(ENABLE_EXTENSIONS) |
| 278 CHECK(stream_target_info_.empty()); | 285 CHECK(stream_target_info_.empty()); |
| 279 #endif | 286 #endif |
| 280 } | 287 } |
| 281 | 288 |
| 282 bool ChromeResourceDispatcherHostDelegate::ShouldBeginRequest( | 289 bool ChromeResourceDispatcherHostDelegate::ShouldBeginRequest( |
| 283 const std::string& method, | 290 const std::string& method, |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 url_request->GetTotalReceivedBytes())); | 761 url_request->GetTotalReceivedBytes())); |
| 755 } | 762 } |
| 756 } | 763 } |
| 757 | 764 |
| 758 // static | 765 // static |
| 759 void ChromeResourceDispatcherHostDelegate:: | 766 void ChromeResourceDispatcherHostDelegate:: |
| 760 SetExternalProtocolHandlerDelegateForTesting( | 767 SetExternalProtocolHandlerDelegateForTesting( |
| 761 ExternalProtocolHandler::Delegate* delegate) { | 768 ExternalProtocolHandler::Delegate* delegate) { |
| 762 g_external_protocol_handler_delegate = delegate; | 769 g_external_protocol_handler_delegate = delegate; |
| 763 } | 770 } |
| OLD | NEW |