| 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 22 matching lines...) Expand all Loading... |
| 33 #include "chromecast/browser/cast_memory_pressure_monitor.h" | 33 #include "chromecast/browser/cast_memory_pressure_monitor.h" |
| 34 #include "chromecast/browser/cast_net_log.h" | 34 #include "chromecast/browser/cast_net_log.h" |
| 35 #include "chromecast/browser/devtools/remote_debugging_server.h" | 35 #include "chromecast/browser/devtools/remote_debugging_server.h" |
| 36 #include "chromecast/browser/geolocation/cast_access_token_store.h" | 36 #include "chromecast/browser/geolocation/cast_access_token_store.h" |
| 37 #include "chromecast/browser/media/media_caps_impl.h" | 37 #include "chromecast/browser/media/media_caps_impl.h" |
| 38 #include "chromecast/browser/metrics/cast_metrics_prefs.h" | 38 #include "chromecast/browser/metrics/cast_metrics_prefs.h" |
| 39 #include "chromecast/browser/metrics/cast_metrics_service_client.h" | 39 #include "chromecast/browser/metrics/cast_metrics_service_client.h" |
| 40 #include "chromecast/browser/pref_service_helper.h" | 40 #include "chromecast/browser/pref_service_helper.h" |
| 41 #include "chromecast/browser/url_request_context_factory.h" | 41 #include "chromecast/browser/url_request_context_factory.h" |
| 42 #include "chromecast/chromecast_features.h" | 42 #include "chromecast/chromecast_features.h" |
| 43 #include "chromecast/common/global_descriptors.h" |
| 43 #include "chromecast/common/platform_client_auth.h" | 44 #include "chromecast/common/platform_client_auth.h" |
| 44 #include "chromecast/media/base/key_systems_common.h" | 45 #include "chromecast/media/base/key_systems_common.h" |
| 45 #include "chromecast/media/base/media_resource_tracker.h" | 46 #include "chromecast/media/base/media_resource_tracker.h" |
| 46 #include "chromecast/media/base/video_plane_controller.h" | 47 #include "chromecast/media/base/video_plane_controller.h" |
| 47 #include "chromecast/media/cma/backend/media_pipeline_backend_manager.h" | 48 #include "chromecast/media/cma/backend/media_pipeline_backend_manager.h" |
| 48 #include "chromecast/net/connectivity_checker.h" | 49 #include "chromecast/net/connectivity_checker.h" |
| 49 #include "chromecast/public/cast_media_shlib.h" | 50 #include "chromecast/public/cast_media_shlib.h" |
| 50 #include "chromecast/public/cast_sys_info.h" | 51 #include "chromecast/public/cast_sys_info.h" |
| 51 #include "chromecast/service/cast_service.h" | 52 #include "chromecast/service/cast_service.h" |
| 52 #include "components/prefs/pref_registry_simple.h" | 53 #include "components/prefs/pref_registry_simple.h" |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 } | 380 } |
| 380 | 381 |
| 381 int CastBrowserMainParts::PreCreateThreads() { | 382 int CastBrowserMainParts::PreCreateThreads() { |
| 382 #if defined(OS_ANDROID) | 383 #if defined(OS_ANDROID) |
| 383 // GPU process is started immediately after threads are created, requiring | 384 // GPU process is started immediately after threads are created, requiring |
| 384 // CrashDumpManager to be initialized beforehand. | 385 // CrashDumpManager to be initialized beforehand. |
| 385 base::FilePath crash_dumps_dir; | 386 base::FilePath crash_dumps_dir; |
| 386 if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) { | 387 if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) { |
| 387 LOG(ERROR) << "Could not find crash dump location."; | 388 LOG(ERROR) << "Could not find crash dump location."; |
| 388 } | 389 } |
| 389 cast_browser_process_->SetCrashDumpManager( | 390 crash_dump_observer_ = base::MakeUnique<breakpad::CrashDumpObserver>(); |
| 390 base::MakeUnique<breakpad::CrashDumpManager>(crash_dumps_dir)); | 391 crash_dump_observer_->RegisterClient(new breakpad::CrashDumpManager( |
| 392 crash_dumps_dir, kAndroidMinidumpDescriptor)); |
| 391 #else | 393 #else |
| 392 base::FilePath home_dir; | 394 base::FilePath home_dir; |
| 393 CHECK(PathService::Get(DIR_CAST_HOME, &home_dir)); | 395 CHECK(PathService::Get(DIR_CAST_HOME, &home_dir)); |
| 394 if (!base::CreateDirectory(home_dir)) | 396 if (!base::CreateDirectory(home_dir)) |
| 395 return 1; | 397 return 1; |
| 396 | 398 |
| 397 // Hook for internal code | 399 // Hook for internal code |
| 398 cast_browser_process_->browser_client()->PreCreateThreads(); | 400 cast_browser_process_->browser_client()->PreCreateThreads(); |
| 399 | 401 |
| 400 // Set GL strings so GPU config code can make correct feature blacklisting/ | 402 // Set GL strings so GPU config code can make correct feature blacklisting/ |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 | 539 |
| 538 void CastBrowserMainParts::PostDestroyThreads() { | 540 void CastBrowserMainParts::PostDestroyThreads() { |
| 539 #if !defined(OS_ANDROID) | 541 #if !defined(OS_ANDROID) |
| 540 media_resource_tracker_->FinalizeAndDestroy(); | 542 media_resource_tracker_->FinalizeAndDestroy(); |
| 541 media_resource_tracker_ = nullptr; | 543 media_resource_tracker_ = nullptr; |
| 542 #endif | 544 #endif |
| 543 } | 545 } |
| 544 | 546 |
| 545 } // namespace shell | 547 } // namespace shell |
| 546 } // namespace chromecast | 548 } // namespace chromecast |
| OLD | NEW |