| 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 20 matching lines...) Expand all Loading... |
| 31 #include "chromecast/browser/cast_content_browser_client.h" | 31 #include "chromecast/browser/cast_content_browser_client.h" |
| 32 #include "chromecast/browser/cast_memory_pressure_monitor.h" | 32 #include "chromecast/browser/cast_memory_pressure_monitor.h" |
| 33 #include "chromecast/browser/cast_net_log.h" | 33 #include "chromecast/browser/cast_net_log.h" |
| 34 #include "chromecast/browser/devtools/remote_debugging_server.h" | 34 #include "chromecast/browser/devtools/remote_debugging_server.h" |
| 35 #include "chromecast/browser/geolocation/cast_access_token_store.h" | 35 #include "chromecast/browser/geolocation/cast_access_token_store.h" |
| 36 #include "chromecast/browser/metrics/cast_metrics_prefs.h" | 36 #include "chromecast/browser/metrics/cast_metrics_prefs.h" |
| 37 #include "chromecast/browser/metrics/cast_metrics_service_client.h" | 37 #include "chromecast/browser/metrics/cast_metrics_service_client.h" |
| 38 #include "chromecast/browser/pref_service_helper.h" | 38 #include "chromecast/browser/pref_service_helper.h" |
| 39 #include "chromecast/browser/url_request_context_factory.h" | 39 #include "chromecast/browser/url_request_context_factory.h" |
| 40 #include "chromecast/chromecast_features.h" | 40 #include "chromecast/chromecast_features.h" |
| 41 #include "chromecast/common/global_descriptors.h" |
| 41 #include "chromecast/common/platform_client_auth.h" | 42 #include "chromecast/common/platform_client_auth.h" |
| 42 #include "chromecast/media/base/key_systems_common.h" | 43 #include "chromecast/media/base/key_systems_common.h" |
| 43 #include "chromecast/media/base/media_resource_tracker.h" | 44 #include "chromecast/media/base/media_resource_tracker.h" |
| 44 #include "chromecast/media/base/video_plane_controller.h" | 45 #include "chromecast/media/base/video_plane_controller.h" |
| 45 #include "chromecast/media/cma/backend/media_pipeline_backend_manager.h" | 46 #include "chromecast/media/cma/backend/media_pipeline_backend_manager.h" |
| 46 #include "chromecast/net/connectivity_checker.h" | 47 #include "chromecast/net/connectivity_checker.h" |
| 47 #include "chromecast/public/cast_media_shlib.h" | 48 #include "chromecast/public/cast_media_shlib.h" |
| 48 #include "chromecast/public/cast_sys_info.h" | 49 #include "chromecast/public/cast_sys_info.h" |
| 49 #include "chromecast/service/cast_service.h" | 50 #include "chromecast/service/cast_service.h" |
| 50 #include "components/prefs/pref_registry_simple.h" | 51 #include "components/prefs/pref_registry_simple.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 } | 372 } |
| 372 | 373 |
| 373 int CastBrowserMainParts::PreCreateThreads() { | 374 int CastBrowserMainParts::PreCreateThreads() { |
| 374 #if defined(OS_ANDROID) | 375 #if defined(OS_ANDROID) |
| 375 // GPU process is started immediately after threads are created, requiring | 376 // GPU process is started immediately after threads are created, requiring |
| 376 // CrashDumpManager to be initialized beforehand. | 377 // CrashDumpManager to be initialized beforehand. |
| 377 base::FilePath crash_dumps_dir; | 378 base::FilePath crash_dumps_dir; |
| 378 if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) { | 379 if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) { |
| 379 LOG(ERROR) << "Could not find crash dump location."; | 380 LOG(ERROR) << "Could not find crash dump location."; |
| 380 } | 381 } |
| 381 cast_browser_process_->SetCrashDumpManager( | 382 breakpad::CrashDumpObserver::GetInstance()->RegisterClient( |
| 382 base::WrapUnique(new breakpad::CrashDumpManager(crash_dumps_dir))); | 383 base::MakeUnique<breakpad::CrashDumpManager>(crash_dumps_dir, |
| 384 kAndroidMinidumpDescriptor)); |
| 383 #else | 385 #else |
| 384 base::FilePath home_dir; | 386 base::FilePath home_dir; |
| 385 CHECK(PathService::Get(DIR_CAST_HOME, &home_dir)); | 387 CHECK(PathService::Get(DIR_CAST_HOME, &home_dir)); |
| 386 if (!base::CreateDirectory(home_dir)) | 388 if (!base::CreateDirectory(home_dir)) |
| 387 return 1; | 389 return 1; |
| 388 | 390 |
| 389 // Hook for internal code | 391 // Hook for internal code |
| 390 cast_browser_process_->browser_client()->PreCreateThreads(); | 392 cast_browser_process_->browser_client()->PreCreateThreads(); |
| 391 | 393 |
| 392 // Set GL strings so GPU config code can make correct feature blacklisting/ | 394 // Set GL strings so GPU config code can make correct feature blacklisting/ |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 | 530 |
| 529 void CastBrowserMainParts::PostDestroyThreads() { | 531 void CastBrowserMainParts::PostDestroyThreads() { |
| 530 #if !defined(OS_ANDROID) | 532 #if !defined(OS_ANDROID) |
| 531 media_resource_tracker_->FinalizeAndDestroy(); | 533 media_resource_tracker_->FinalizeAndDestroy(); |
| 532 media_resource_tracker_ = nullptr; | 534 media_resource_tracker_ = nullptr; |
| 533 #endif | 535 #endif |
| 534 } | 536 } |
| 535 | 537 |
| 536 } // namespace shell | 538 } // namespace shell |
| 537 } // namespace chromecast | 539 } // namespace chromecast |
| OLD | NEW |