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_browser_main_parts.h" | 5 #include "chromecast/browser/cast_browser_main_parts.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 DISALLOW_COPY_AND_ASSIGN(CastGeolocationDelegate); | 209 DISALLOW_COPY_AND_ASSIGN(CastGeolocationDelegate); |
210 }; | 210 }; |
211 | 211 |
212 struct DefaultCommandLineSwitch { | 212 struct DefaultCommandLineSwitch { |
213 const char* const switch_name; | 213 const char* const switch_name; |
214 const char* const switch_value; | 214 const char* const switch_value; |
215 }; | 215 }; |
216 | 216 |
217 DefaultCommandLineSwitch g_default_switches[] = { | 217 DefaultCommandLineSwitch g_default_switches[] = { |
218 #if defined(OS_ANDROID) | 218 #if defined(OS_ANDROID) |
219 // Disables Chromecast-specific WiFi-related features on ATV for now. | 219 // Disables Chromecast-specific WiFi-related features on ATV for now. |
220 { switches::kNoWifi, "" }, | 220 {switches::kNoWifi, ""}, |
221 { switches::kDisableGestureRequirementForMediaPlayback, ""}, | 221 // TODO(714676): this should probably set the no restrictions autoplay |
222 { switches::kDisableMediaSuspend, ""}, | 222 // policy instead. |
| 223 {switches::kIgnoreAutoplayRestrictionsForTests, ""}, |
| 224 {switches::kDisableMediaSuspend, ""}, |
223 #else | 225 #else |
224 // GPU shader disk cache disabling is largely to conserve disk space. | 226 // GPU shader disk cache disabling is largely to conserve disk space. |
225 { switches::kDisableGpuShaderDiskCache, "" }, | 227 {switches::kDisableGpuShaderDiskCache, ""}, |
226 // Enable media sessions by default (even on non-Android platforms). | 228 // Enable media sessions by default (even on non-Android platforms). |
227 { switches::kEnableDefaultMediaSession, "" }, | 229 {switches::kEnableDefaultMediaSession, ""}, |
228 #endif | 230 #endif |
229 #if BUILDFLAG(IS_CAST_AUDIO_ONLY) | 231 #if BUILDFLAG(IS_CAST_AUDIO_ONLY) |
230 #if defined(OS_ANDROID) | 232 #if defined(OS_ANDROID) |
231 { switches::kDisableGLDrawingForTests, "" }, | 233 {switches::kDisableGLDrawingForTests, ""}, |
232 #else | 234 #else |
233 { switches::kDisableGpu, "" }, | 235 {switches::kDisableGpu, ""}, |
234 #endif // defined(OS_ANDROID) | 236 #endif // defined(OS_ANDROID) |
235 #endif // BUILDFLAG(IS_CAST_AUDIO_ONLY) | 237 #endif // BUILDFLAG(IS_CAST_AUDIO_ONLY) |
236 #if defined(OS_LINUX) | 238 #if defined(OS_LINUX) |
237 #if defined(ARCH_CPU_X86_FAMILY) | 239 #if defined(ARCH_CPU_X86_FAMILY) |
238 // This is needed for now to enable the x11 Ozone platform to work with | 240 // This is needed for now to enable the x11 Ozone platform to work with |
239 // current Linux/NVidia OpenGL drivers. | 241 // current Linux/NVidia OpenGL drivers. |
240 { switches::kIgnoreGpuBlacklist, ""}, | 242 {switches::kIgnoreGpuBlacklist, ""}, |
241 #elif defined(ARCH_CPU_ARM_FAMILY) | 243 #elif defined(ARCH_CPU_ARM_FAMILY) |
242 #if !BUILDFLAG(IS_CAST_AUDIO_ONLY) | 244 #if !BUILDFLAG(IS_CAST_AUDIO_ONLY) |
243 {switches::kEnableHardwareOverlays, "cast"}, | 245 {switches::kEnableHardwareOverlays, "cast"}, |
244 #endif | 246 #endif |
245 #endif | 247 #endif |
246 #endif // defined(OS_LINUX) | 248 #endif // defined(OS_LINUX) |
247 // Needed so that our call to GpuDataManager::SetGLStrings doesn't race | 249 // Needed so that our call to GpuDataManager::SetGLStrings doesn't race |
248 // against GPU process creation (which is otherwise triggered from | 250 // against GPU process creation (which is otherwise triggered from |
249 // BrowserThreadsStarted). The GPU process will be created as soon as a | 251 // BrowserThreadsStarted). The GPU process will be created as soon as a |
250 // renderer needs it, which always happens after main loop starts. | 252 // renderer needs it, which always happens after main loop starts. |
251 { switches::kDisableGpuEarlyInit, "" }, | 253 {switches::kDisableGpuEarlyInit, ""}, |
252 // TODO(halliwell): Cast builds don't support ES3. Remove this switch when | 254 // TODO(halliwell): Cast builds don't support ES3. Remove this switch when |
253 // support is added (crbug.com/659395) | 255 // support is added (crbug.com/659395) |
254 { switches::kDisableES3GLContext, "" }, | 256 {switches::kDisableES3GLContext, ""}, |
255 // Enable navigator.connection API. | 257 // Enable navigator.connection API. |
256 // TODO(derekjchow): Remove this switch when enabled by default. | 258 // TODO(derekjchow): Remove this switch when enabled by default. |
257 { switches::kEnableNetworkInformation, "" }, | 259 {switches::kEnableNetworkInformation, ""}, |
258 // TODO(halliwell): Remove after fixing b/35422666. | 260 // TODO(halliwell): Remove after fixing b/35422666. |
259 { switches::kEnableUseZoomForDSF, "false" }, | 261 {switches::kEnableUseZoomForDSF, "false"}, |
260 { NULL, NULL }, // Termination | 262 {nullptr, nullptr}, // Termination |
261 }; | 263 }; |
262 | 264 |
263 void AddDefaultCommandLineSwitches(base::CommandLine* command_line) { | 265 void AddDefaultCommandLineSwitches(base::CommandLine* command_line) { |
264 int i = 0; | 266 int i = 0; |
265 while (g_default_switches[i].switch_name != NULL) { | 267 while (g_default_switches[i].switch_name != NULL) { |
266 command_line->AppendSwitchASCII( | 268 command_line->AppendSwitchASCII( |
267 std::string(g_default_switches[i].switch_name), | 269 std::string(g_default_switches[i].switch_name), |
268 std::string(g_default_switches[i].switch_value)); | 270 std::string(g_default_switches[i].switch_value)); |
269 ++i; | 271 ++i; |
270 } | 272 } |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 | 566 |
565 void CastBrowserMainParts::PostDestroyThreads() { | 567 void CastBrowserMainParts::PostDestroyThreads() { |
566 #if !defined(OS_ANDROID) | 568 #if !defined(OS_ANDROID) |
567 media_resource_tracker_->FinalizeAndDestroy(); | 569 media_resource_tracker_->FinalizeAndDestroy(); |
568 media_resource_tracker_ = nullptr; | 570 media_resource_tracker_ = nullptr; |
569 #endif | 571 #endif |
570 } | 572 } |
571 | 573 |
572 } // namespace shell | 574 } // namespace shell |
573 } // namespace chromecast | 575 } // namespace chromecast |
OLD | NEW |