| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "chromecast/media/base/media_resource_tracker.h" | 43 #include "chromecast/media/base/media_resource_tracker.h" |
| 44 #include "chromecast/media/base/video_plane_controller.h" | 44 #include "chromecast/media/base/video_plane_controller.h" |
| 45 #include "chromecast/media/cma/backend/media_pipeline_backend_manager.h" | 45 #include "chromecast/media/cma/backend/media_pipeline_backend_manager.h" |
| 46 #include "chromecast/net/connectivity_checker.h" | 46 #include "chromecast/net/connectivity_checker.h" |
| 47 #include "chromecast/public/cast_media_shlib.h" | 47 #include "chromecast/public/cast_media_shlib.h" |
| 48 #include "chromecast/public/cast_sys_info.h" | 48 #include "chromecast/public/cast_sys_info.h" |
| 49 #include "chromecast/service/cast_service.h" | 49 #include "chromecast/service/cast_service.h" |
| 50 #include "components/prefs/pref_registry_simple.h" | 50 #include "components/prefs/pref_registry_simple.h" |
| 51 #include "content/public/browser/browser_thread.h" | 51 #include "content/public/browser/browser_thread.h" |
| 52 #include "content/public/browser/child_process_security_policy.h" | 52 #include "content/public/browser/child_process_security_policy.h" |
| 53 #include "content/public/browser/geolocation_delegate.h" |
| 54 #include "content/public/browser/geolocation_provider.h" |
| 53 #include "content/public/browser/gpu_data_manager.h" | 55 #include "content/public/browser/gpu_data_manager.h" |
| 54 #include "content/public/browser/storage_partition.h" | 56 #include "content/public/browser/storage_partition.h" |
| 55 #include "content/public/common/content_switches.h" | 57 #include "content/public/common/content_switches.h" |
| 56 #include "device/geolocation/geolocation_delegate.h" | |
| 57 #include "device/geolocation/geolocation_provider.h" | |
| 58 #include "gpu/command_buffer/service/gpu_switches.h" | 58 #include "gpu/command_buffer/service/gpu_switches.h" |
| 59 #include "media/base/media.h" | 59 #include "media/base/media.h" |
| 60 #include "ui/compositor/compositor_switches.h" | 60 #include "ui/compositor/compositor_switches.h" |
| 61 | 61 |
| 62 #if !defined(OS_ANDROID) | 62 #if !defined(OS_ANDROID) |
| 63 #include <signal.h> | 63 #include <signal.h> |
| 64 #include <sys/prctl.h> | 64 #include <sys/prctl.h> |
| 65 #endif | 65 #endif |
| 66 #if defined(OS_LINUX) | 66 #if defined(OS_LINUX) |
| 67 #include <fontconfig/fontconfig.h> | 67 #include <fontconfig/fontconfig.h> |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 #endif // !defined(OS_ANDROID) | 181 #endif // !defined(OS_ANDROID) |
| 182 | 182 |
| 183 } // namespace | 183 } // namespace |
| 184 | 184 |
| 185 namespace chromecast { | 185 namespace chromecast { |
| 186 namespace shell { | 186 namespace shell { |
| 187 | 187 |
| 188 namespace { | 188 namespace { |
| 189 | 189 |
| 190 // A provider of services for Geolocation. | 190 // A provider of services for Geolocation. |
| 191 class CastGeolocationDelegate : public device::GeolocationDelegate { | 191 class CastGeolocationDelegate : public content::GeolocationDelegate { |
| 192 public: | 192 public: |
| 193 explicit CastGeolocationDelegate(CastBrowserContext* context) | 193 explicit CastGeolocationDelegate(CastBrowserContext* context) |
| 194 : context_(context) {} | 194 : context_(context) {} |
| 195 | 195 |
| 196 scoped_refptr<device::AccessTokenStore> CreateAccessTokenStore() override { | 196 scoped_refptr<content::AccessTokenStore> CreateAccessTokenStore() override { |
| 197 return new CastAccessTokenStore(context_); | 197 return new CastAccessTokenStore(context_); |
| 198 } | 198 } |
| 199 | 199 |
| 200 private: | 200 private: |
| 201 CastBrowserContext* context_; | 201 CastBrowserContext* context_; |
| 202 | 202 |
| 203 DISALLOW_COPY_AND_ASSIGN(CastGeolocationDelegate); | 203 DISALLOW_COPY_AND_ASSIGN(CastGeolocationDelegate); |
| 204 }; | 204 }; |
| 205 | 205 |
| 206 struct DefaultCommandLineSwitch { | 206 struct DefaultCommandLineSwitch { |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 cast_browser_process_->pref_service(), | 463 cast_browser_process_->pref_service(), |
| 464 url_request_context_factory_->GetSystemGetter(), | 464 url_request_context_factory_->GetSystemGetter(), |
| 465 video_plane_controller_.get())); | 465 video_plane_controller_.get())); |
| 466 cast_browser_process_->cast_service()->Initialize(); | 466 cast_browser_process_->cast_service()->Initialize(); |
| 467 | 467 |
| 468 #if !defined(OS_ANDROID) | 468 #if !defined(OS_ANDROID) |
| 469 media_resource_tracker()->InitializeMediaLib(); | 469 media_resource_tracker()->InitializeMediaLib(); |
| 470 #endif | 470 #endif |
| 471 ::media::InitializeMediaLibrary(); | 471 ::media::InitializeMediaLibrary(); |
| 472 | 472 |
| 473 device::GeolocationProvider::SetGeolocationDelegate( | 473 content::GeolocationProvider::SetGeolocationDelegate( |
| 474 new CastGeolocationDelegate(cast_browser_process_->browser_context())); | 474 new CastGeolocationDelegate(cast_browser_process_->browser_context())); |
| 475 | 475 |
| 476 // Initializing metrics service and network delegates must happen after cast | 476 // Initializing metrics service and network delegates must happen after cast |
| 477 // service is intialized because CastMetricsServiceClient and | 477 // service is intialized because CastMetricsServiceClient and |
| 478 // CastNetworkDelegate may use components initialized by cast service. | 478 // CastNetworkDelegate may use components initialized by cast service. |
| 479 cast_browser_process_->metrics_service_client() | 479 cast_browser_process_->metrics_service_client() |
| 480 ->Initialize(cast_browser_process_->cast_service()); | 480 ->Initialize(cast_browser_process_->cast_service()); |
| 481 url_request_context_factory_->InitializeNetworkDelegates(); | 481 url_request_context_factory_->InitializeNetworkDelegates(); |
| 482 | 482 |
| 483 cast_browser_process_->cast_service()->Start(); | 483 cast_browser_process_->cast_service()->Start(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 | 528 |
| 529 void CastBrowserMainParts::PostDestroyThreads() { | 529 void CastBrowserMainParts::PostDestroyThreads() { |
| 530 #if !defined(OS_ANDROID) | 530 #if !defined(OS_ANDROID) |
| 531 media_resource_tracker_->FinalizeAndDestroy(); | 531 media_resource_tracker_->FinalizeAndDestroy(); |
| 532 media_resource_tracker_ = nullptr; | 532 media_resource_tracker_ = nullptr; |
| 533 #endif | 533 #endif |
| 534 } | 534 } |
| 535 | 535 |
| 536 } // namespace shell | 536 } // namespace shell |
| 537 } // namespace chromecast | 537 } // namespace chromecast |
| OLD | NEW |