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