| 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/media/base/key_systems_common.h" | 44 #include "chromecast/media/base/key_systems_common.h" |
| 44 #include "chromecast/media/base/media_resource_tracker.h" | 45 #include "chromecast/media/base/media_resource_tracker.h" |
| 45 #include "chromecast/media/base/video_plane_controller.h" | 46 #include "chromecast/media/base/video_plane_controller.h" |
| 46 #include "chromecast/media/cma/backend/media_pipeline_backend_manager.h" | 47 #include "chromecast/media/cma/backend/media_pipeline_backend_manager.h" |
| 47 #include "chromecast/net/connectivity_checker.h" | 48 #include "chromecast/net/connectivity_checker.h" |
| 48 #include "chromecast/public/cast_media_shlib.h" | 49 #include "chromecast/public/cast_media_shlib.h" |
| 49 #include "chromecast/public/cast_sys_info.h" | 50 #include "chromecast/public/cast_sys_info.h" |
| 50 #include "chromecast/service/cast_service.h" | 51 #include "chromecast/service/cast_service.h" |
| 51 #include "components/prefs/pref_registry_simple.h" | 52 #include "components/prefs/pref_registry_simple.h" |
| 52 #include "content/public/browser/browser_thread.h" | 53 #include "content/public/browser/browser_thread.h" |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 } | 383 } |
| 383 | 384 |
| 384 int CastBrowserMainParts::PreCreateThreads() { | 385 int CastBrowserMainParts::PreCreateThreads() { |
| 385 #if defined(OS_ANDROID) | 386 #if defined(OS_ANDROID) |
| 386 // GPU process is started immediately after threads are created, requiring | 387 // GPU process is started immediately after threads are created, requiring |
| 387 // CrashDumpManager to be initialized beforehand. | 388 // CrashDumpManager to be initialized beforehand. |
| 388 base::FilePath crash_dumps_dir; | 389 base::FilePath crash_dumps_dir; |
| 389 if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) { | 390 if (!chromecast::CrashHandler::GetCrashDumpLocation(&crash_dumps_dir)) { |
| 390 LOG(ERROR) << "Could not find crash dump location."; | 391 LOG(ERROR) << "Could not find crash dump location."; |
| 391 } | 392 } |
| 392 cast_browser_process_->SetCrashDumpManager( | 393 breakpad::CrashDumpObserver::Create(); |
| 393 base::MakeUnique<breakpad::CrashDumpManager>(crash_dumps_dir)); | 394 breakpad::CrashDumpObserver::GetInstance()->RegisterClient( |
| 395 base::MakeUnique<breakpad::CrashDumpManager>(crash_dumps_dir, |
| 396 kAndroidMinidumpDescriptor)); |
| 394 #else | 397 #else |
| 395 base::FilePath home_dir; | 398 base::FilePath home_dir; |
| 396 CHECK(PathService::Get(DIR_CAST_HOME, &home_dir)); | 399 CHECK(PathService::Get(DIR_CAST_HOME, &home_dir)); |
| 397 if (!base::CreateDirectory(home_dir)) | 400 if (!base::CreateDirectory(home_dir)) |
| 398 return 1; | 401 return 1; |
| 399 | 402 |
| 400 // Hook for internal code | 403 // Hook for internal code |
| 401 cast_browser_process_->browser_client()->PreCreateThreads(); | 404 cast_browser_process_->browser_client()->PreCreateThreads(); |
| 402 | 405 |
| 403 // Set GL strings so GPU config code can make correct feature blacklisting/ | 406 // Set GL strings so GPU config code can make correct feature blacklisting/ |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 | 540 |
| 538 void CastBrowserMainParts::PostDestroyThreads() { | 541 void CastBrowserMainParts::PostDestroyThreads() { |
| 539 #if !defined(OS_ANDROID) | 542 #if !defined(OS_ANDROID) |
| 540 media_resource_tracker_->FinalizeAndDestroy(); | 543 media_resource_tracker_->FinalizeAndDestroy(); |
| 541 media_resource_tracker_ = nullptr; | 544 media_resource_tracker_ = nullptr; |
| 542 #endif | 545 #endif |
| 543 } | 546 } |
| 544 | 547 |
| 545 } // namespace shell | 548 } // namespace shell |
| 546 } // namespace chromecast | 549 } // namespace chromecast |
| OLD | NEW |