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 <memory> |
9 #include <string> | 10 #include <string> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/macros.h" | 13 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "content/public/browser/content_browser_client.h" | 15 #include "content/public/browser/content_browser_client.h" |
16 | 16 |
17 class PrefService; | 17 class PrefService; |
18 | 18 |
19 namespace breakpad { | 19 namespace breakpad { |
20 class CrashHandlerHostLinux; | 20 class CrashHandlerHostLinux; |
21 } | 21 } |
22 | 22 |
23 namespace media { | 23 namespace media { |
(...skipping 17 matching lines...) Expand all Loading... |
41 | 41 |
42 namespace shell { | 42 namespace shell { |
43 | 43 |
44 class CastBrowserMainParts; | 44 class CastBrowserMainParts; |
45 class URLRequestContextFactory; | 45 class URLRequestContextFactory; |
46 | 46 |
47 class CastContentBrowserClient : public content::ContentBrowserClient { | 47 class CastContentBrowserClient : public content::ContentBrowserClient { |
48 public: | 48 public: |
49 // Creates an implementation of CastContentBrowserClient. Platform should | 49 // Creates an implementation of CastContentBrowserClient. Platform should |
50 // link in an implementation as needed. | 50 // link in an implementation as needed. |
51 static scoped_ptr<CastContentBrowserClient> Create(); | 51 static std::unique_ptr<CastContentBrowserClient> Create(); |
52 | 52 |
53 ~CastContentBrowserClient() override; | 53 ~CastContentBrowserClient() override; |
54 | 54 |
55 // Appends extra command line arguments before launching a new process. | 55 // Appends extra command line arguments before launching a new process. |
56 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line); | 56 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line); |
57 | 57 |
58 // Hook for code to run before browser threads created. | 58 // Hook for code to run before browser threads created. |
59 virtual void PreCreateThreads(); | 59 virtual void PreCreateThreads(); |
60 | 60 |
61 // Creates and returns the CastService instance for the current process. | 61 // Creates and returns the CastService instance for the current process. |
62 // Note: |request_context_getter| might be different than the main request | 62 // Note: |request_context_getter| might be different than the main request |
63 // getter accessible via CastBrowserProcess. | 63 // getter accessible via CastBrowserProcess. |
64 virtual scoped_ptr<CastService> CreateCastService( | 64 virtual std::unique_ptr<CastService> CreateCastService( |
65 content::BrowserContext* browser_context, | 65 content::BrowserContext* browser_context, |
66 PrefService* pref_service, | 66 PrefService* pref_service, |
67 net::URLRequestContextGetter* request_context_getter, | 67 net::URLRequestContextGetter* request_context_getter, |
68 media::VideoPlaneController* video_plane_controller); | 68 media::VideoPlaneController* video_plane_controller); |
69 | 69 |
70 #if !defined(OS_ANDROID) | 70 #if !defined(OS_ANDROID) |
71 // Returns the task runner that must be used for media IO. | 71 // Returns the task runner that must be used for media IO. |
72 scoped_refptr<base::SingleThreadTaskRunner> GetMediaTaskRunner(); | 72 scoped_refptr<base::SingleThreadTaskRunner> GetMediaTaskRunner(); |
73 | 73 |
74 // Creates a MediaPipelineDevice (CMA backend) for media playback, called | 74 // Creates a MediaPipelineDevice (CMA backend) for media playback, called |
75 // once per media player instance. | 75 // once per media player instance. |
76 virtual scoped_ptr<media::MediaPipelineBackend> CreateMediaPipelineBackend( | 76 virtual std::unique_ptr<media::MediaPipelineBackend> |
77 const media::MediaPipelineDeviceParams& params); | 77 CreateMediaPipelineBackend(const media::MediaPipelineDeviceParams& params); |
78 | 78 |
79 media::MediaResourceTracker* media_resource_tracker(); | 79 media::MediaResourceTracker* media_resource_tracker(); |
80 | 80 |
81 media::MediaPipelineBackendManager* media_pipeline_backend_manager(); | 81 media::MediaPipelineBackendManager* media_pipeline_backend_manager(); |
82 #endif | 82 #endif |
83 | 83 |
84 // Invoked when the metrics client ID changes. | 84 // Invoked when the metrics client ID changes. |
85 virtual void SetMetricsClientId(const std::string& client_id); | 85 virtual void SetMetricsClientId(const std::string& client_id); |
86 | 86 |
87 // Allows registration of extra metrics providers. | 87 // Allows registration of extra metrics providers. |
(...skipping 24 matching lines...) Expand all Loading... |
112 const GURL& request_url, | 112 const GURL& request_url, |
113 content::ResourceType resource_type, | 113 content::ResourceType resource_type, |
114 bool overridable, | 114 bool overridable, |
115 bool strict_enforcement, | 115 bool strict_enforcement, |
116 bool expired_previous_decision, | 116 bool expired_previous_decision, |
117 const base::Callback<void(bool)>& callback, | 117 const base::Callback<void(bool)>& callback, |
118 content::CertificateRequestResultType* result) override; | 118 content::CertificateRequestResultType* result) override; |
119 void SelectClientCertificate( | 119 void SelectClientCertificate( |
120 content::WebContents* web_contents, | 120 content::WebContents* web_contents, |
121 net::SSLCertRequestInfo* cert_request_info, | 121 net::SSLCertRequestInfo* cert_request_info, |
122 scoped_ptr<content::ClientCertificateDelegate> delegate) override; | 122 std::unique_ptr<content::ClientCertificateDelegate> delegate) override; |
123 bool CanCreateWindow( | 123 bool CanCreateWindow( |
124 const GURL& opener_url, | 124 const GURL& opener_url, |
125 const GURL& opener_top_level_frame_url, | 125 const GURL& opener_top_level_frame_url, |
126 const GURL& source_origin, | 126 const GURL& source_origin, |
127 WindowContainerType container_type, | 127 WindowContainerType container_type, |
128 const GURL& target_url, | 128 const GURL& target_url, |
129 const content::Referrer& referrer, | 129 const content::Referrer& referrer, |
130 WindowOpenDisposition disposition, | 130 WindowOpenDisposition disposition, |
131 const blink::WebWindowFeatures& features, | 131 const blink::WebWindowFeatures& features, |
132 bool user_gesture, | 132 bool user_gesture, |
133 bool opener_suppressed, | 133 bool opener_suppressed, |
134 content::ResourceContext* context, | 134 content::ResourceContext* context, |
135 int render_process_id, | 135 int render_process_id, |
136 int opener_render_view_id, | 136 int opener_render_view_id, |
137 int opener_render_frame_id, | 137 int opener_render_frame_id, |
138 bool* no_javascript_access) override; | 138 bool* no_javascript_access) override; |
139 void RegisterInProcessMojoApplications( | 139 void RegisterInProcessMojoApplications( |
140 StaticMojoApplicationMap* apps) override; | 140 StaticMojoApplicationMap* apps) override; |
141 #if defined(OS_ANDROID) | 141 #if defined(OS_ANDROID) |
142 void GetAdditionalMappedFilesForChildProcess( | 142 void GetAdditionalMappedFilesForChildProcess( |
143 const base::CommandLine& command_line, | 143 const base::CommandLine& command_line, |
144 int child_process_id, | 144 int child_process_id, |
145 content::FileDescriptorInfo* mappings, | 145 content::FileDescriptorInfo* mappings, |
146 std::map<int, base::MemoryMappedFile::Region>* regions) override; | 146 std::map<int, base::MemoryMappedFile::Region>* regions) override; |
147 #else | 147 #else |
148 scoped_ptr<::media::CdmFactory> CreateCdmFactory() override; | 148 std::unique_ptr<::media::CdmFactory> CreateCdmFactory() override; |
149 void GetAdditionalMappedFilesForChildProcess( | 149 void GetAdditionalMappedFilesForChildProcess( |
150 const base::CommandLine& command_line, | 150 const base::CommandLine& command_line, |
151 int child_process_id, | 151 int child_process_id, |
152 content::FileDescriptorInfo* mappings) override; | 152 content::FileDescriptorInfo* mappings) override; |
153 #endif // defined(OS_ANDROID) | 153 #endif // defined(OS_ANDROID) |
154 void GetAdditionalWebUISchemes( | 154 void GetAdditionalWebUISchemes( |
155 std::vector<std::string>* additional_schemes) override; | 155 std::vector<std::string>* additional_schemes) override; |
156 #if defined(OS_ANDROID) && defined(VIDEO_HOLE) | 156 #if defined(OS_ANDROID) && defined(VIDEO_HOLE) |
157 content::ExternalVideoSurfaceContainer* | 157 content::ExternalVideoSurfaceContainer* |
158 OverrideCreateExternalVideoSurfaceContainer( | 158 OverrideCreateExternalVideoSurfaceContainer( |
(...skipping 22 matching lines...) Expand all Loading... |
181 // Creates a CrashHandlerHost instance for the given process type. | 181 // Creates a CrashHandlerHost instance for the given process type. |
182 breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost( | 182 breakpad::CrashHandlerHostLinux* CreateCrashHandlerHost( |
183 const std::string& process_type); | 183 const std::string& process_type); |
184 | 184 |
185 // A static cache to hold crash_handlers for each process_type | 185 // A static cache to hold crash_handlers for each process_type |
186 std::map<std::string, breakpad::CrashHandlerHostLinux*> crash_handlers_; | 186 std::map<std::string, breakpad::CrashHandlerHostLinux*> crash_handlers_; |
187 #endif // !defined(OS_ANDROID) | 187 #endif // !defined(OS_ANDROID) |
188 | 188 |
189 // Created by CastContentBrowserClient but owned by BrowserMainLoop. | 189 // Created by CastContentBrowserClient but owned by BrowserMainLoop. |
190 CastBrowserMainParts* cast_browser_main_parts_; | 190 CastBrowserMainParts* cast_browser_main_parts_; |
191 scoped_ptr<URLRequestContextFactory> url_request_context_factory_; | 191 std::unique_ptr<URLRequestContextFactory> url_request_context_factory_; |
192 | 192 |
193 DISALLOW_COPY_AND_ASSIGN(CastContentBrowserClient); | 193 DISALLOW_COPY_AND_ASSIGN(CastContentBrowserClient); |
194 }; | 194 }; |
195 | 195 |
196 } // namespace shell | 196 } // namespace shell |
197 } // namespace chromecast | 197 } // namespace chromecast |
198 | 198 |
199 #endif // CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ | 199 #endif // CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |