| 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 } | 384 } |
| 384 | 385 |
| 385 int CastBrowserMainParts::PreCreateThreads() { | 386 int CastBrowserMainParts::PreCreateThreads() { |
| 386 #if defined(OS_ANDROID) | 387 #if defined(OS_ANDROID) |
| 387 // GPU process is started immediately after threads are created, requiring | 388 // GPU process is started immediately after threads are created, requiring |
| 388 // CrashDumpManager to be initialized beforehand. | 389 // CrashDumpManager to be initialized beforehand. |
| 389 base::FilePath crash_dumps_dir; | 390 base::FilePath crash_dumps_dir; |
| 390 if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) { | 391 if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) { |
| 391 LOG(ERROR) << "Could not find crash dump location."; | 392 LOG(ERROR) << "Could not find crash dump location."; |
| 392 } | 393 } |
| 393 cast_browser_process_->SetCrashDumpManager( | 394 breakpad::CrashDumpObserver::Create(); |
| 394 base::MakeUnique<breakpad::CrashDumpManager>(crash_dumps_dir)); | 395 breakpad::CrashDumpObserver::GetInstance()->RegisterClient( |
| 396 base::MakeUnique<breakpad::CrashDumpManager>(crash_dumps_dir, |
| 397 kAndroidMinidumpDescriptor)); |
| 395 #else | 398 #else |
| 396 base::FilePath home_dir; | 399 base::FilePath home_dir; |
| 397 CHECK(PathService::Get(DIR_CAST_HOME, &home_dir)); | 400 CHECK(PathService::Get(DIR_CAST_HOME, &home_dir)); |
| 398 if (!base::CreateDirectory(home_dir)) | 401 if (!base::CreateDirectory(home_dir)) |
| 399 return 1; | 402 return 1; |
| 400 | 403 |
| 401 // Hook for internal code | 404 // Hook for internal code |
| 402 cast_browser_process_->browser_client()->PreCreateThreads(); | 405 cast_browser_process_->browser_client()->PreCreateThreads(); |
| 403 | 406 |
| 404 // Set GL strings so GPU config code can make correct feature blacklisting/ | 407 // 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... |
| 541 | 544 |
| 542 void CastBrowserMainParts::PostDestroyThreads() { | 545 void CastBrowserMainParts::PostDestroyThreads() { |
| 543 #if !defined(OS_ANDROID) | 546 #if !defined(OS_ANDROID) |
| 544 media_resource_tracker_->FinalizeAndDestroy(); | 547 media_resource_tracker_->FinalizeAndDestroy(); |
| 545 media_resource_tracker_ = nullptr; | 548 media_resource_tracker_ = nullptr; |
| 546 #endif | 549 #endif |
| 547 } | 550 } |
| 548 | 551 |
| 549 } // namespace shell | 552 } // namespace shell |
| 550 } // namespace chromecast | 553 } // namespace chromecast |
| OLD | NEW |