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" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "content/public/browser/certificate_request_result_type.h" | 31 #include "content/public/browser/certificate_request_result_type.h" |
32 #include "content/public/browser/client_certificate_delegate.h" | 32 #include "content/public/browser/client_certificate_delegate.h" |
33 #include "content/public/browser/render_process_host.h" | 33 #include "content/public/browser/render_process_host.h" |
34 #include "content/public/browser/resource_dispatcher_host.h" | 34 #include "content/public/browser/resource_dispatcher_host.h" |
35 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
36 #include "content/public/common/content_descriptors.h" | 36 #include "content/public/common/content_descriptors.h" |
37 #include "content/public/common/content_switches.h" | 37 #include "content/public/common/content_switches.h" |
38 #include "content/public/common/url_constants.h" | 38 #include "content/public/common/url_constants.h" |
39 #include "content/public/common/web_preferences.h" | 39 #include "content/public/common/web_preferences.h" |
40 #include "gin/v8_initializer.h" | 40 #include "gin/v8_initializer.h" |
| 41 #include "media/audio/audio_manager_factory.h" |
41 #include "net/ssl/ssl_cert_request_info.h" | 42 #include "net/ssl/ssl_cert_request_info.h" |
42 #include "net/url_request/url_request_context_getter.h" | 43 #include "net/url_request/url_request_context_getter.h" |
43 #include "ui/gl/gl_switches.h" | 44 #include "ui/gl/gl_switches.h" |
44 | 45 |
45 #if defined(OS_ANDROID) | 46 #if defined(OS_ANDROID) |
46 #include "chromecast/browser/android/external_video_surface_container_impl.h" | 47 #include "chromecast/browser/android/external_video_surface_container_impl.h" |
47 #include "components/crash/browser/crash_dump_manager_android.h" | 48 #include "components/crash/browser/crash_dump_manager_android.h" |
48 #endif // defined(OS_ANDROID) | 49 #endif // defined(OS_ANDROID) |
49 | 50 |
50 namespace chromecast { | 51 namespace chromecast { |
51 namespace shell { | 52 namespace shell { |
52 | 53 |
53 CastContentBrowserClient::CastContentBrowserClient() | 54 CastContentBrowserClient::CastContentBrowserClient() |
54 : v8_natives_fd_(-1), | 55 : v8_natives_fd_(-1), |
55 v8_snapshot_fd_(-1), | 56 v8_snapshot_fd_(-1), |
56 url_request_context_factory_(new URLRequestContextFactory()) { | 57 url_request_context_factory_(new URLRequestContextFactory()) { |
57 } | 58 } |
58 | 59 |
59 CastContentBrowserClient::~CastContentBrowserClient() { | 60 CastContentBrowserClient::~CastContentBrowserClient() { |
60 content::BrowserThread::DeleteSoon( | 61 content::BrowserThread::DeleteSoon( |
61 content::BrowserThread::IO, | 62 content::BrowserThread::IO, |
62 FROM_HERE, | 63 FROM_HERE, |
63 url_request_context_factory_.release()); | 64 url_request_context_factory_.release()); |
64 } | 65 } |
65 | 66 |
66 content::BrowserMainParts* CastContentBrowserClient::CreateBrowserMainParts( | 67 content::BrowserMainParts* CastContentBrowserClient::CreateBrowserMainParts( |
67 const content::MainFunctionParams& parameters) { | 68 const content::MainFunctionParams& parameters) { |
68 return new CastBrowserMainParts(parameters, | 69 return new CastBrowserMainParts(parameters, |
69 url_request_context_factory_.get()); | 70 url_request_context_factory_.get(), |
| 71 PlatformCreateAudioManagerFactory()); |
70 } | 72 } |
71 | 73 |
72 void CastContentBrowserClient::RenderProcessWillLaunch( | 74 void CastContentBrowserClient::RenderProcessWillLaunch( |
73 content::RenderProcessHost* host) { | 75 content::RenderProcessHost* host) { |
74 #if !defined(OS_ANDROID) | 76 #if !defined(OS_ANDROID) |
75 scoped_refptr<media::CmaMessageFilterHost> cma_message_filter( | 77 scoped_refptr<media::CmaMessageFilterHost> cma_message_filter( |
76 new media::CmaMessageFilterHost(host->GetID())); | 78 new media::CmaMessageFilterHost(host->GetID())); |
77 host->AddFilter(cma_message_filter.get()); | 79 host->AddFilter(cma_message_filter.get()); |
78 #endif // !defined(OS_ANDROID) | 80 #endif // !defined(OS_ANDROID) |
79 | 81 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 process_type, dumps_path, false /* upload */); | 413 process_type, dumps_path, false /* upload */); |
412 // StartUploaderThread() even though upload is diferred. | 414 // StartUploaderThread() even though upload is diferred. |
413 // Breakpad-related memory is freed in the uploader thread. | 415 // Breakpad-related memory is freed in the uploader thread. |
414 crash_handler->StartUploaderThread(); | 416 crash_handler->StartUploaderThread(); |
415 return crash_handler; | 417 return crash_handler; |
416 } | 418 } |
417 #endif // !defined(OS_ANDROID) | 419 #endif // !defined(OS_ANDROID) |
418 | 420 |
419 } // namespace shell | 421 } // namespace shell |
420 } // namespace chromecast | 422 } // namespace chromecast |
OLD | NEW |