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 #ifndef CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ |
6 #define CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ | 6 #define CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 class CastContentBrowserClient: public content::ContentBrowserClient { | 43 class CastContentBrowserClient: public content::ContentBrowserClient { |
44 public: | 44 public: |
45 // Creates an implementation of CastContentBrowserClient. Platform should | 45 // Creates an implementation of CastContentBrowserClient. Platform should |
46 // link in an implementation as needed. | 46 // link in an implementation as needed. |
47 static scoped_ptr<CastContentBrowserClient> Create(); | 47 static scoped_ptr<CastContentBrowserClient> Create(); |
48 | 48 |
49 ~CastContentBrowserClient() override; | 49 ~CastContentBrowserClient() override; |
50 | 50 |
51 // Appends extra command line arguments before launching a new process. | 51 // Appends extra command line arguments before launching a new process. |
52 void PlatformAppendExtraCommandLineSwitches(base::CommandLine* command_line); | 52 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line); |
53 | 53 |
54 // Returns any BrowserMessageFilters from the platform implementation that | 54 // Returns any BrowserMessageFilters that should be added when launching a |
55 // should be added when launching a new render process. | 55 // new render process. |
56 std::vector<scoped_refptr<content::BrowserMessageFilter>> | 56 virtual std::vector<scoped_refptr<content::BrowserMessageFilter>> |
57 PlatformGetBrowserMessageFilters(); | 57 GetBrowserMessageFilters(); |
| 58 |
| 59 // Provide an AudioManagerFactory instance for WebAudio playback. |
| 60 virtual scoped_ptr<::media::AudioManagerFactory> CreateAudioManagerFactory(); |
58 | 61 |
59 #if !defined(OS_ANDROID) | 62 #if !defined(OS_ANDROID) |
60 // Creates a MediaPipelineDevice (CMA backend) for media playback, called | 63 // Creates a MediaPipelineDevice (CMA backend) for media playback, called |
61 // once per media player instance. | 64 // once per media player instance. |
62 scoped_ptr<media::MediaPipelineDevice> PlatformCreateMediaPipelineDevice( | 65 virtual scoped_ptr<media::MediaPipelineDevice> CreateMediaPipelineDevice( |
63 const media::MediaPipelineDeviceParams& params); | 66 const media::MediaPipelineDeviceParams& params); |
64 #endif | 67 #endif |
65 | 68 |
66 // content::ContentBrowserClient implementation: | 69 // content::ContentBrowserClient implementation: |
67 content::BrowserMainParts* CreateBrowserMainParts( | 70 content::BrowserMainParts* CreateBrowserMainParts( |
68 const content::MainFunctionParams& parameters) override; | 71 const content::MainFunctionParams& parameters) override; |
69 void RenderProcessWillLaunch(content::RenderProcessHost* host) override; | 72 void RenderProcessWillLaunch(content::RenderProcessHost* host) override; |
70 net::URLRequestContextGetter* CreateRequestContext( | 73 net::URLRequestContextGetter* CreateRequestContext( |
71 content::BrowserContext* browser_context, | 74 content::BrowserContext* browser_context, |
72 content::ProtocolHandlerMap* protocol_handlers, | 75 content::ProtocolHandlerMap* protocol_handlers, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 CastContentBrowserClient(); | 131 CastContentBrowserClient(); |
129 | 132 |
130 private: | 133 private: |
131 void AddNetworkHintsMessageFilter(int render_process_id, | 134 void AddNetworkHintsMessageFilter(int render_process_id, |
132 net::URLRequestContext* context); | 135 net::URLRequestContext* context); |
133 | 136 |
134 net::X509Certificate* SelectClientCertificateOnIOThread( | 137 net::X509Certificate* SelectClientCertificateOnIOThread( |
135 GURL requesting_url, | 138 GURL requesting_url, |
136 int render_process_id); | 139 int render_process_id); |
137 | 140 |
138 scoped_ptr<::media::AudioManagerFactory> PlatformCreateAudioManagerFactory(); | |
139 | |
140 #if !defined(OS_ANDROID) | 141 #if !defined(OS_ANDROID) |
141 // Returns the crash signal FD corresponding to the current process type. | 142 // Returns the crash signal FD corresponding to the current process type. |
142 int GetCrashSignalFD(const base::CommandLine& command_line); | 143 int GetCrashSignalFD(const base::CommandLine& command_line); |
143 | 144 |
144 // Creates a CrashHandlerHost instance for the given process type. | 145 // Creates a CrashHandlerHost instance for the given process type. |
145 breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost( | 146 breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost( |
146 const std::string& process_type); | 147 const std::string& process_type); |
147 | 148 |
148 // A static cache to hold crash_handlers for each process_type | 149 // A static cache to hold crash_handlers for each process_type |
149 std::map<std::string, breakpad::CrashHandlerHostLinux*> crash_handlers_; | 150 std::map<std::string, breakpad::CrashHandlerHostLinux*> crash_handlers_; |
150 #endif | 151 #endif |
151 | 152 |
152 base::ScopedFD v8_natives_fd_; | 153 base::ScopedFD v8_natives_fd_; |
153 base::ScopedFD v8_snapshot_fd_; | 154 base::ScopedFD v8_snapshot_fd_; |
154 bool natives_fd_exists() { return v8_natives_fd_ != -1; } | 155 bool natives_fd_exists() { return v8_natives_fd_ != -1; } |
155 bool snapshot_fd_exists() { return v8_snapshot_fd_ != -1; } | 156 bool snapshot_fd_exists() { return v8_snapshot_fd_ != -1; } |
156 | 157 |
157 scoped_ptr<URLRequestContextFactory> url_request_context_factory_; | 158 scoped_ptr<URLRequestContextFactory> url_request_context_factory_; |
158 | 159 |
159 DISALLOW_COPY_AND_ASSIGN(CastContentBrowserClient); | 160 DISALLOW_COPY_AND_ASSIGN(CastContentBrowserClient); |
160 }; | 161 }; |
161 | 162 |
162 } // namespace shell | 163 } // namespace shell |
163 } // namespace chromecast | 164 } // namespace chromecast |
164 | 165 |
165 #endif // CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ | 166 #endif // CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |