| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/browser_main_loop.h" | 5 #include "content/browser/browser_main_loop.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "base/timer/hi_res_timer_manager.h" | 46 #include "base/timer/hi_res_timer_manager.h" |
| 47 #include "base/trace_event/memory_dump_manager.h" | 47 #include "base/trace_event/memory_dump_manager.h" |
| 48 #include "base/trace_event/trace_event.h" | 48 #include "base/trace_event/trace_event.h" |
| 49 #include "build/build_config.h" | 49 #include "build/build_config.h" |
| 50 #include "components/discardable_memory/service/discardable_shared_memory_manage
r.h" | 50 #include "components/discardable_memory/service/discardable_shared_memory_manage
r.h" |
| 51 #include "components/tracing/common/process_metrics_memory_dump_provider.h" | 51 #include "components/tracing/common/process_metrics_memory_dump_provider.h" |
| 52 #include "components/tracing/common/trace_config_file.h" | 52 #include "components/tracing/common/trace_config_file.h" |
| 53 #include "components/tracing/common/trace_to_console.h" | 53 #include "components/tracing/common/trace_to_console.h" |
| 54 #include "components/tracing/common/tracing_switches.h" | 54 #include "components/tracing/common/tracing_switches.h" |
| 55 #include "components/viz/display_compositor/host_shared_bitmap_manager.h" | 55 #include "components/viz/display_compositor/host_shared_bitmap_manager.h" |
| 56 #include "components/viz/host/frame_sink_manager_host.h" |
| 56 #include "content/browser/browser_thread_impl.h" | 57 #include "content/browser/browser_thread_impl.h" |
| 57 #include "content/browser/child_process_security_policy_impl.h" | 58 #include "content/browser/child_process_security_policy_impl.h" |
| 58 #include "content/browser/dom_storage/dom_storage_area.h" | 59 #include "content/browser/dom_storage/dom_storage_area.h" |
| 59 #include "content/browser/download/download_resource_handler.h" | 60 #include "content/browser/download/download_resource_handler.h" |
| 60 #include "content/browser/download/save_file_manager.h" | 61 #include "content/browser/download/save_file_manager.h" |
| 61 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 62 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 62 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 63 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 63 #include "content/browser/gpu/compositor_util.h" | 64 #include "content/browser/gpu/compositor_util.h" |
| 64 #include "content/browser/gpu/gpu_data_manager_impl.h" | 65 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 65 #include "content/browser/gpu/gpu_process_host.h" | 66 #include "content/browser/gpu/gpu_process_host.h" |
| (...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1217 "BrowserMainLoop::Subsystem:SpeechRecognitionManager"); | 1218 "BrowserMainLoop::Subsystem:SpeechRecognitionManager"); |
| 1218 io_thread_->task_runner()->DeleteSoon(FROM_HERE, | 1219 io_thread_->task_runner()->DeleteSoon(FROM_HERE, |
| 1219 speech_recognition_manager_.release()); | 1220 speech_recognition_manager_.release()); |
| 1220 | 1221 |
| 1221 memory_pressure_monitor_.reset(); | 1222 memory_pressure_monitor_.reset(); |
| 1222 | 1223 |
| 1223 #if defined(OS_MACOSX) | 1224 #if defined(OS_MACOSX) |
| 1224 BrowserCompositorMac::DisableRecyclingForShutdown(); | 1225 BrowserCompositorMac::DisableRecyclingForShutdown(); |
| 1225 #endif | 1226 #endif |
| 1226 | 1227 |
| 1228 #if !defined(OS_ANDROID) |
| 1229 frame_sink_manager_host_.reset(); |
| 1230 #endif |
| 1231 |
| 1227 #if defined(USE_AURA) || defined(OS_MACOSX) | 1232 #if defined(USE_AURA) || defined(OS_MACOSX) |
| 1228 { | 1233 { |
| 1229 TRACE_EVENT0("shutdown", | 1234 TRACE_EVENT0("shutdown", |
| 1230 "BrowserMainLoop::Subsystem:ImageTransportFactory"); | 1235 "BrowserMainLoop::Subsystem:ImageTransportFactory"); |
| 1231 ImageTransportFactory::Terminate(); | 1236 ImageTransportFactory::Terminate(); |
| 1232 } | 1237 } |
| 1233 #endif | 1238 #endif |
| 1234 | 1239 |
| 1235 // The device monitors are using |system_monitor_| as dependency, so delete | 1240 // The device monitors are using |system_monitor_| as dependency, so delete |
| 1236 // them before |system_monitor_| goes away. | 1241 // them before |system_monitor_| goes away. |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1449 ImageTransportFactory::Initialize(); | 1454 ImageTransportFactory::Initialize(); |
| 1450 ImageTransportFactory::GetInstance()->SetGpuChannelEstablishFactory(factory); | 1455 ImageTransportFactory::GetInstance()->SetGpuChannelEstablishFactory(factory); |
| 1451 #if defined(USE_AURA) | 1456 #if defined(USE_AURA) |
| 1452 if (env_->mode() == aura::Env::Mode::LOCAL) { | 1457 if (env_->mode() == aura::Env::Mode::LOCAL) { |
| 1453 env_->set_context_factory(GetContextFactory()); | 1458 env_->set_context_factory(GetContextFactory()); |
| 1454 env_->set_context_factory_private(GetContextFactoryPrivate()); | 1459 env_->set_context_factory_private(GetContextFactoryPrivate()); |
| 1455 } | 1460 } |
| 1456 #endif // defined(USE_AURA) | 1461 #endif // defined(USE_AURA) |
| 1457 #endif // defined(OS_ANDROID) | 1462 #endif // defined(OS_ANDROID) |
| 1458 | 1463 |
| 1464 #if !defined(OS_ANDROID) |
| 1465 if (!service_manager::ServiceManagerIsRemote()) { |
| 1466 frame_sink_manager_host_ = base::MakeUnique<viz::FrameSinkManagerHost>(); |
| 1467 frame_sink_manager_host_->ConnectToFrameSinkManager(); |
| 1468 } |
| 1469 #endif |
| 1470 |
| 1459 // Enable the GpuMemoryBuffer dump provider with IO thread affinity. Note that | 1471 // Enable the GpuMemoryBuffer dump provider with IO thread affinity. Note that |
| 1460 // unregistration happens on the IO thread (See | 1472 // unregistration happens on the IO thread (See |
| 1461 // BrowserProcessSubThread::IOThreadPreCleanUp). | 1473 // BrowserProcessSubThread::IOThreadPreCleanUp). |
| 1462 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 1474 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
| 1463 BrowserGpuMemoryBufferManager::current(), "BrowserGpuMemoryBufferManager", | 1475 BrowserGpuMemoryBufferManager::current(), "BrowserGpuMemoryBufferManager", |
| 1464 io_thread_->task_runner()); | 1476 io_thread_->task_runner()); |
| 1465 #if defined(OS_ANDROID) | 1477 #if defined(OS_ANDROID) |
| 1466 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( | 1478 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( |
| 1467 tracing::GraphicsMemoryDumpProvider::GetInstance(), "AndroidGraphics", | 1479 tracing::GraphicsMemoryDumpProvider::GetInstance(), "AndroidGraphics", |
| 1468 nullptr); | 1480 nullptr); |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1770 base::MakeUnique<media::AudioThreadImpl>(), | 1782 base::MakeUnique<media::AudioThreadImpl>(), |
| 1771 MediaInternals::GetInstance()); | 1783 MediaInternals::GetInstance()); |
| 1772 } | 1784 } |
| 1773 CHECK(audio_manager_); | 1785 CHECK(audio_manager_); |
| 1774 | 1786 |
| 1775 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); | 1787 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); |
| 1776 CHECK(audio_system_); | 1788 CHECK(audio_system_); |
| 1777 } | 1789 } |
| 1778 | 1790 |
| 1779 } // namespace content | 1791 } // namespace content |
| OLD | NEW |