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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // Disables Chromecast-specific WiFi-related features on ATV for now. | 216 // Disables Chromecast-specific WiFi-related features on ATV for now. |
217 { switches::kNoWifi, "" }, | 217 { switches::kNoWifi, "" }, |
218 { switches::kDisableGestureRequirementForMediaPlayback, ""}, | 218 { switches::kDisableGestureRequirementForMediaPlayback, ""}, |
219 { switches::kDisableMediaSuspend, ""}, | 219 { switches::kDisableMediaSuspend, ""}, |
220 #else | 220 #else |
221 // GPU shader disk cache disabling is largely to conserve disk space. | 221 // GPU shader disk cache disabling is largely to conserve disk space. |
222 { switches::kDisableGpuShaderDiskCache, "" }, | 222 { switches::kDisableGpuShaderDiskCache, "" }, |
223 // Enable media sessions by default (even on non-Android platforms). | 223 // Enable media sessions by default (even on non-Android platforms). |
224 { switches::kEnableDefaultMediaSession, "" }, | 224 { switches::kEnableDefaultMediaSession, "" }, |
225 #endif | 225 #endif |
226 #if BUILDFLAG(DISABLE_DISPLAY) | 226 #if BUILDFLAG(IS_CAST_AUDIO_ONLY) |
227 { switches::kDisableGpu, "" }, | 227 { switches::kDisableGpu, "" }, |
228 #endif | 228 #endif |
229 #if defined(OS_LINUX) | 229 #if defined(OS_LINUX) |
230 #if defined(ARCH_CPU_X86_FAMILY) | 230 #if defined(ARCH_CPU_X86_FAMILY) |
231 // This is needed for now to enable the x11 Ozone platform to work with | 231 // This is needed for now to enable the x11 Ozone platform to work with |
232 // current Linux/NVidia OpenGL drivers. | 232 // current Linux/NVidia OpenGL drivers. |
233 { switches::kIgnoreGpuBlacklist, ""}, | 233 { switches::kIgnoreGpuBlacklist, ""}, |
234 #elif defined(ARCH_CPU_ARM_FAMILY) | 234 #elif defined(ARCH_CPU_ARM_FAMILY) |
235 // On Linux arm, enable CMA pipeline by default. | 235 // On Linux arm, enable CMA pipeline by default. |
236 { switches::kEnableCmaMediaPipeline, "" }, | 236 { switches::kEnableCmaMediaPipeline, "" }, |
237 #if !BUILDFLAG(DISABLE_DISPLAY) | 237 #if !BUILDFLAG(IS_CAST_AUDIO_ONLY) |
238 { switches::kEnableHardwareOverlays, "" }, | 238 { switches::kEnableHardwareOverlays, "" }, |
239 #endif | 239 #endif |
240 #endif | 240 #endif |
241 #endif // defined(OS_LINUX) | 241 #endif // defined(OS_LINUX) |
242 // Needed so that our call to GpuDataManager::SetGLStrings doesn't race | 242 // Needed so that our call to GpuDataManager::SetGLStrings doesn't race |
243 // against GPU process creation (which is otherwise triggered from | 243 // against GPU process creation (which is otherwise triggered from |
244 // BrowserThreadsStarted). The GPU process will be created as soon as a | 244 // BrowserThreadsStarted). The GPU process will be created as soon as a |
245 // renderer needs it, which always happens after main loop starts. | 245 // renderer needs it, which always happens after main loop starts. |
246 { switches::kDisableGpuEarlyInit, "" }, | 246 { switches::kDisableGpuEarlyInit, "" }, |
247 // Enable navigator.connection API. | 247 // Enable navigator.connection API. |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 GetURLRequestContext())); | 455 GetURLRequestContext())); |
456 | 456 |
457 if (!PlatformClientAuth::Initialize()) | 457 if (!PlatformClientAuth::Initialize()) |
458 LOG(ERROR) << "PlatformClientAuth::Initialize failed."; | 458 LOG(ERROR) << "PlatformClientAuth::Initialize failed."; |
459 | 459 |
460 cast_browser_process_->SetRemoteDebuggingServer( | 460 cast_browser_process_->SetRemoteDebuggingServer( |
461 base::MakeUnique<RemoteDebuggingServer>( | 461 base::MakeUnique<RemoteDebuggingServer>( |
462 cast_browser_process_->browser_client() | 462 cast_browser_process_->browser_client() |
463 ->EnableRemoteDebuggingImmediately())); | 463 ->EnableRemoteDebuggingImmediately())); |
464 | 464 |
465 #if defined(USE_AURA) && !BUILDFLAG(DISABLE_DISPLAY) | 465 #if defined(USE_AURA) && !BUILDFLAG(IS_CAST_AUDIO_ONLY) |
466 // TODO(halliwell) move audio builds to use ozone_platform_cast, then can | 466 // TODO(halliwell) move audio builds to use ozone_platform_cast, then can |
467 // simplify this by removing DISABLE_DISPLAY condition. Should then also | 467 // simplify this by removing IS_CAST_AUDIO_ONLY condition. Should then also |
468 // assert(ozone_platform_cast) in BUILD.gn where it depends on //ui/ozone. | 468 // assert(ozone_platform_cast) in BUILD.gn where it depends on //ui/ozone. |
469 gfx::Size display_size = | 469 gfx::Size display_size = |
470 display::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel(); | 470 display::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel(); |
471 video_plane_controller_.reset(new media::VideoPlaneController( | 471 video_plane_controller_.reset(new media::VideoPlaneController( |
472 Size(display_size.width(), display_size.height()), GetMediaTaskRunner())); | 472 Size(display_size.width(), display_size.height()), GetMediaTaskRunner())); |
473 ui::OverlayManagerCast::SetOverlayCompositedCallback( | 473 ui::OverlayManagerCast::SetOverlayCompositedCallback( |
474 base::Bind(&media::VideoPlaneController::SetGeometry, | 474 base::Bind(&media::VideoPlaneController::SetGeometry, |
475 base::Unretained(video_plane_controller_.get()))); | 475 base::Unretained(video_plane_controller_.get()))); |
476 #endif | 476 #endif |
477 | 477 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 | 546 |
547 void CastBrowserMainParts::PostDestroyThreads() { | 547 void CastBrowserMainParts::PostDestroyThreads() { |
548 #if !defined(OS_ANDROID) | 548 #if !defined(OS_ANDROID) |
549 media_resource_tracker_->FinalizeAndDestroy(); | 549 media_resource_tracker_->FinalizeAndDestroy(); |
550 media_resource_tracker_ = nullptr; | 550 media_resource_tracker_ = nullptr; |
551 #endif | 551 #endif |
552 } | 552 } |
553 | 553 |
554 } // namespace shell | 554 } // namespace shell |
555 } // namespace chromecast | 555 } // namespace chromecast |
OLD | NEW |