| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/browser/cast_content_browser_client.h" | 5 #include "chromecast/browser/cast_content_browser_client.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/files/scoped_file.h" | 11 #include "base/files/scoped_file.h" |
| 12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "chromecast/browser/cast_browser_context.h" | 14 #include "chromecast/browser/cast_browser_context.h" |
| 15 #include "chromecast/browser/cast_browser_main_parts.h" | 15 #include "chromecast/browser/cast_browser_main_parts.h" |
| 16 #include "chromecast/browser/cast_browser_process.h" | 16 #include "chromecast/browser/cast_browser_process.h" |
| 17 #include "chromecast/browser/cast_network_delegate.h" | 17 #include "chromecast/browser/cast_network_delegate.h" |
| 18 #include "chromecast/browser/devtools/cast_dev_tools_delegate.h" | 18 #include "chromecast/browser/devtools/cast_dev_tools_delegate.h" |
| 19 #include "chromecast/browser/geolocation/cast_access_token_store.h" | 19 #include "chromecast/browser/geolocation/cast_access_token_store.h" |
| 20 #include "chromecast/browser/media/cma_message_filter_host.h" | 20 #include "chromecast/browser/media/cma_message_filter_host.h" |
| 21 #include "chromecast/browser/url_request_context_factory.h" | 21 #include "chromecast/browser/url_request_context_factory.h" |
| 22 #include "chromecast/common/cast_paths.h" | 22 #include "chromecast/common/cast_paths.h" |
| 23 #include "chromecast/common/chromecast_switches.h" | 23 #include "chromecast/common/chromecast_switches.h" |
| 24 #include "chromecast/common/global_descriptors.h" | 24 #include "chromecast/common/global_descriptors.h" |
| 25 #include "components/crash/app/breakpad_linux.h" | 25 #include "components/crash/app/breakpad_linux.h" |
| 26 #include "components/crash/browser/crash_handler_host_linux.h" | 26 #include "components/crash/browser/crash_handler_host_linux.h" |
| 27 #include "components/dns_prefetch/browser/net_message_filter.h" | 27 #include "components/network_hints/browser/network_hints_message_filter.h" |
| 28 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
| 29 #include "content/public/browser/certificate_request_result_type.h" | 29 #include "content/public/browser/certificate_request_result_type.h" |
| 30 #include "content/public/browser/render_process_host.h" | 30 #include "content/public/browser/render_process_host.h" |
| 31 #include "content/public/common/content_descriptors.h" | 31 #include "content/public/common/content_descriptors.h" |
| 32 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
| 33 #include "content/public/common/url_constants.h" | 33 #include "content/public/common/url_constants.h" |
| 34 #include "content/public/common/web_preferences.h" | 34 #include "content/public/common/web_preferences.h" |
| 35 #include "net/ssl/ssl_cert_request_info.h" | 35 #include "net/ssl/ssl_cert_request_info.h" |
| 36 | 36 |
| 37 #if defined(OS_ANDROID) | 37 #if defined(OS_ANDROID) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 57 } | 57 } |
| 58 | 58 |
| 59 content::BrowserMainParts* CastContentBrowserClient::CreateBrowserMainParts( | 59 content::BrowserMainParts* CastContentBrowserClient::CreateBrowserMainParts( |
| 60 const content::MainFunctionParams& parameters) { | 60 const content::MainFunctionParams& parameters) { |
| 61 return new CastBrowserMainParts(parameters, | 61 return new CastBrowserMainParts(parameters, |
| 62 url_request_context_factory_.get()); | 62 url_request_context_factory_.get()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void CastContentBrowserClient::RenderProcessWillLaunch( | 65 void CastContentBrowserClient::RenderProcessWillLaunch( |
| 66 content::RenderProcessHost* host) { | 66 content::RenderProcessHost* host) { |
| 67 scoped_refptr<content::BrowserMessageFilter> net_message_filter( | 67 scoped_refptr<content::BrowserMessageFilter> network_hints_message_filter( |
| 68 new dns_prefetch::NetMessageFilter( | 68 new network_hints::NetworkHintsMessageFilter( |
| 69 url_request_context_factory_->host_resolver())); | 69 url_request_context_factory_->host_resolver())); |
| 70 host->AddFilter(net_message_filter.get()); | 70 host->AddFilter(network_hints_message_filter.get()); |
| 71 #if !defined(OS_ANDROID) | 71 #if !defined(OS_ANDROID) |
| 72 scoped_refptr<media::CmaMessageFilterHost> cma_message_filter( | 72 scoped_refptr<media::CmaMessageFilterHost> cma_message_filter( |
| 73 new media::CmaMessageFilterHost(host->GetID())); | 73 new media::CmaMessageFilterHost(host->GetID())); |
| 74 host->AddFilter(cma_message_filter.get()); | 74 host->AddFilter(cma_message_filter.get()); |
| 75 #endif // !defined(OS_ANDROID) | 75 #endif // !defined(OS_ANDROID) |
| 76 } | 76 } |
| 77 | 77 |
| 78 net::URLRequestContextGetter* CastContentBrowserClient::CreateRequestContext( | 78 net::URLRequestContextGetter* CastContentBrowserClient::CreateRequestContext( |
| 79 content::BrowserContext* browser_context, | 79 content::BrowserContext* browser_context, |
| 80 content::ProtocolHandlerMap* protocol_handlers, | 80 content::ProtocolHandlerMap* protocol_handlers, |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 process_type, dumps_path, false /* upload */); | 338 process_type, dumps_path, false /* upload */); |
| 339 // StartUploaderThread() even though upload is diferred. | 339 // StartUploaderThread() even though upload is diferred. |
| 340 // Breakpad-related memory is freed in the uploader thread. | 340 // Breakpad-related memory is freed in the uploader thread. |
| 341 crash_handler->StartUploaderThread(); | 341 crash_handler->StartUploaderThread(); |
| 342 return crash_handler; | 342 return crash_handler; |
| 343 } | 343 } |
| 344 #endif // !defined(OS_ANDROID) | 344 #endif // !defined(OS_ANDROID) |
| 345 | 345 |
| 346 } // namespace shell | 346 } // namespace shell |
| 347 } // namespace chromecast | 347 } // namespace chromecast |
| OLD | NEW |