| 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/icu_util.h" | 12 #include "base/i18n/icu_util.h" |
| 13 #include "base/i18n/rtl.h" | 13 #include "base/i18n/rtl.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "chromecast/base/cast_paths.h" | 15 #include "chromecast/base/cast_paths.h" |
| 16 #include "chromecast/base/chromecast_switches.h" | 16 #include "chromecast/base/chromecast_switches.h" |
| 17 #include "chromecast/browser/cast_browser_context.h" | 17 #include "chromecast/browser/cast_browser_context.h" |
| 18 #include "chromecast/browser/cast_browser_main_parts.h" | 18 #include "chromecast/browser/cast_browser_main_parts.h" |
| 19 #include "chromecast/browser/cast_browser_process.h" | 19 #include "chromecast/browser/cast_browser_process.h" |
| 20 #include "chromecast/browser/cast_network_delegate.h" | 20 #include "chromecast/browser/cast_network_delegate.h" |
| 21 #include "chromecast/browser/cast_quota_permission_context.h" | 21 #include "chromecast/browser/cast_quota_permission_context.h" |
| 22 #include "chromecast/browser/cast_resource_dispatcher_host_delegate.h" | 22 #include "chromecast/browser/cast_resource_dispatcher_host_delegate.h" |
| 23 #include "chromecast/browser/geolocation/cast_access_token_store.h" | 23 #include "chromecast/browser/geolocation/cast_access_token_store.h" |
| 24 #include "chromecast/browser/media/cma_message_filter_host.h" | 24 #include "chromecast/browser/media/cma_message_filter_host.h" |
| 25 #include "chromecast/browser/url_request_context_factory.h" | 25 #include "chromecast/browser/url_request_context_factory.h" |
| 26 #include "chromecast/common/global_descriptors.h" | 26 #include "chromecast/common/global_descriptors.h" |
| 27 #include "chromecast/media/cma/backend/media_pipeline_device.h" |
| 27 #include "components/crash/app/breakpad_linux.h" | 28 #include "components/crash/app/breakpad_linux.h" |
| 28 #include "components/crash/browser/crash_handler_host_linux.h" | 29 #include "components/crash/browser/crash_handler_host_linux.h" |
| 29 #include "components/network_hints/browser/network_hints_message_filter.h" | 30 #include "components/network_hints/browser/network_hints_message_filter.h" |
| 30 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
| 31 #include "content/public/browser/certificate_request_result_type.h" | 32 #include "content/public/browser/certificate_request_result_type.h" |
| 32 #include "content/public/browser/client_certificate_delegate.h" | 33 #include "content/public/browser/client_certificate_delegate.h" |
| 33 #include "content/public/browser/render_process_host.h" | 34 #include "content/public/browser/render_process_host.h" |
| 34 #include "content/public/browser/resource_dispatcher_host.h" | 35 #include "content/public/browser/resource_dispatcher_host.h" |
| 35 #include "content/public/browser/web_contents.h" | 36 #include "content/public/browser/web_contents.h" |
| 36 #include "content/public/common/content_descriptors.h" | 37 #include "content/public/common/content_descriptors.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 const content::MainFunctionParams& parameters) { | 69 const content::MainFunctionParams& parameters) { |
| 69 return new CastBrowserMainParts(parameters, | 70 return new CastBrowserMainParts(parameters, |
| 70 url_request_context_factory_.get(), | 71 url_request_context_factory_.get(), |
| 71 PlatformCreateAudioManagerFactory()); | 72 PlatformCreateAudioManagerFactory()); |
| 72 } | 73 } |
| 73 | 74 |
| 74 void CastContentBrowserClient::RenderProcessWillLaunch( | 75 void CastContentBrowserClient::RenderProcessWillLaunch( |
| 75 content::RenderProcessHost* host) { | 76 content::RenderProcessHost* host) { |
| 76 #if !defined(OS_ANDROID) | 77 #if !defined(OS_ANDROID) |
| 77 scoped_refptr<media::CmaMessageFilterHost> cma_message_filter( | 78 scoped_refptr<media::CmaMessageFilterHost> cma_message_filter( |
| 78 new media::CmaMessageFilterHost(host->GetID())); | 79 new media::CmaMessageFilterHost( |
| 80 host->GetID(), |
| 81 base::Bind( |
| 82 &CastContentBrowserClient::PlatformCreateMediaPipelineDevice, |
| 83 base::Unretained(this)))); |
| 79 host->AddFilter(cma_message_filter.get()); | 84 host->AddFilter(cma_message_filter.get()); |
| 80 #endif // !defined(OS_ANDROID) | 85 #endif // !defined(OS_ANDROID) |
| 81 | 86 |
| 82 // Forcibly trigger I/O-thread URLRequestContext initialization before | 87 // Forcibly trigger I/O-thread URLRequestContext initialization before |
| 83 // getting HostResolver. | 88 // getting HostResolver. |
| 84 content::BrowserThread::PostTaskAndReplyWithResult( | 89 content::BrowserThread::PostTaskAndReplyWithResult( |
| 85 content::BrowserThread::IO, FROM_HERE, | 90 content::BrowserThread::IO, FROM_HERE, |
| 86 base::Bind(&net::URLRequestContextGetter::GetURLRequestContext, | 91 base::Bind(&net::URLRequestContextGetter::GetURLRequestContext, |
| 87 base::Unretained( | 92 base::Unretained( |
| 88 url_request_context_factory_->GetSystemGetter())), | 93 url_request_context_factory_->GetSystemGetter())), |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 process_type, dumps_path, false /* upload */); | 419 process_type, dumps_path, false /* upload */); |
| 415 // StartUploaderThread() even though upload is diferred. | 420 // StartUploaderThread() even though upload is diferred. |
| 416 // Breakpad-related memory is freed in the uploader thread. | 421 // Breakpad-related memory is freed in the uploader thread. |
| 417 crash_handler->StartUploaderThread(); | 422 crash_handler->StartUploaderThread(); |
| 418 return crash_handler; | 423 return crash_handler; |
| 419 } | 424 } |
| 420 #endif // !defined(OS_ANDROID) | 425 #endif // !defined(OS_ANDROID) |
| 421 | 426 |
| 422 } // namespace shell | 427 } // namespace shell |
| 423 } // namespace chromecast | 428 } // namespace chromecast |
| OLD | NEW |