Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 2971083002: gpu: Reduce direct use of BrowserGpuMemoryBufferManager (Closed)
Patch Set: . Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 #include "components/viz/host/host_frame_sink_manager.h" 56 #include "components/viz/host/host_frame_sink_manager.h"
57 #include "components/viz/service/display_embedder/server_shared_bitmap_manager.h " 57 #include "components/viz/service/display_embedder/server_shared_bitmap_manager.h "
58 #include "components/viz/service/frame_sinks/frame_sink_manager_impl.h" 58 #include "components/viz/service/frame_sinks/frame_sink_manager_impl.h"
59 #include "content/browser/browser_thread_impl.h" 59 #include "content/browser/browser_thread_impl.h"
60 #include "content/browser/child_process_security_policy_impl.h" 60 #include "content/browser/child_process_security_policy_impl.h"
61 #include "content/browser/compositor/surface_utils.h" 61 #include "content/browser/compositor/surface_utils.h"
62 #include "content/browser/dom_storage/dom_storage_area.h" 62 #include "content/browser/dom_storage/dom_storage_area.h"
63 #include "content/browser/download/download_resource_handler.h" 63 #include "content/browser/download/download_resource_handler.h"
64 #include "content/browser/download/save_file_manager.h" 64 #include "content/browser/download/save_file_manager.h"
65 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 65 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
66 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
67 #include "content/browser/gpu/compositor_util.h" 66 #include "content/browser/gpu/compositor_util.h"
68 #include "content/browser/gpu/gpu_data_manager_impl.h" 67 #include "content/browser/gpu/gpu_data_manager_impl.h"
69 #include "content/browser/gpu/gpu_process_host.h" 68 #include "content/browser/gpu/gpu_process_host.h"
70 #include "content/browser/gpu/shader_cache_factory.h" 69 #include "content/browser/gpu/shader_cache_factory.h"
71 #include "content/browser/histogram_synchronizer.h" 70 #include "content/browser/histogram_synchronizer.h"
72 #include "content/browser/leveldb_wrapper_impl.h" 71 #include "content/browser/leveldb_wrapper_impl.h"
73 #include "content/browser/loader/resource_dispatcher_host_impl.h" 72 #include "content/browser/loader/resource_dispatcher_host_impl.h"
74 #include "content/browser/loader_delegate_impl.h" 73 #include "content/browser/loader_delegate_impl.h"
75 #include "content/browser/media/media_internals.h" 74 #include "content/browser/media/media_internals.h"
76 #include "content/browser/memory/memory_coordinator_impl.h" 75 #include "content/browser/memory/memory_coordinator_impl.h"
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 // them before |system_monitor_| goes away. 1221 // them before |system_monitor_| goes away.
1223 // On Mac and windows, the monitor needs to be destroyed on the same thread 1222 // On Mac and windows, the monitor needs to be destroyed on the same thread
1224 // as they were created. On Linux, the monitor will be deleted when IO thread 1223 // as they were created. On Linux, the monitor will be deleted when IO thread
1225 // goes away. 1224 // goes away.
1226 #if defined(OS_WIN) 1225 #if defined(OS_WIN)
1227 system_message_window_.reset(); 1226 system_message_window_.reset();
1228 #elif defined(OS_MACOSX) 1227 #elif defined(OS_MACOSX)
1229 device_monitor_mac_.reset(); 1228 device_monitor_mac_.reset();
1230 #endif 1229 #endif
1231 1230
1232 if (BrowserGpuChannelHostFactory::instance()) {
1233 BrowserGpuChannelHostFactory::instance()->CloseChannel();
piman 2017/07/07 03:57:10 I'm surprised we don't need this. The GpuChannelHo
sadrul 2017/07/08 03:19:33 What kind of failures do you think we might have?
1234 }
1235
1236 // Shutdown the Service Manager and IPC. 1231 // Shutdown the Service Manager and IPC.
1237 service_manager_context_.reset(); 1232 service_manager_context_.reset();
1238 mojo_ipc_support_.reset(); 1233 mojo_ipc_support_.reset();
1239 1234
1240 { 1235 {
1241 base::ThreadRestrictions::ScopedAllowWait allow_wait_for_join; 1236 base::ThreadRestrictions::ScopedAllowWait allow_wait_for_join;
1242 1237
1243 // Must be size_t so we can subtract from it. 1238 // Must be size_t so we can subtract from it.
1244 for (size_t thread_id = BrowserThread::ID_COUNT - 1; 1239 for (size_t thread_id = BrowserThread::ID_COUNT - 1;
1245 thread_id >= (BrowserThread::UI + 1); --thread_id) { 1240 thread_id >= (BrowserThread::UI + 1); --thread_id) {
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 ImageTransportFactory::Initialize(); 1463 ImageTransportFactory::Initialize();
1469 ImageTransportFactory::GetInstance()->SetGpuChannelEstablishFactory(factory); 1464 ImageTransportFactory::GetInstance()->SetGpuChannelEstablishFactory(factory);
1470 #if defined(USE_AURA) 1465 #if defined(USE_AURA)
1471 if (env_->mode() == aura::Env::Mode::LOCAL) { 1466 if (env_->mode() == aura::Env::Mode::LOCAL) {
1472 env_->set_context_factory(GetContextFactory()); 1467 env_->set_context_factory(GetContextFactory());
1473 env_->set_context_factory_private(GetContextFactoryPrivate()); 1468 env_->set_context_factory_private(GetContextFactoryPrivate());
1474 } 1469 }
1475 #endif // defined(USE_AURA) 1470 #endif // defined(USE_AURA)
1476 #endif // defined(OS_ANDROID) 1471 #endif // defined(OS_ANDROID)
1477 1472
1478 // Enable the GpuMemoryBuffer dump provider with IO thread affinity. Note that
1479 // unregistration happens on the IO thread (See
1480 // BrowserProcessSubThread::IOThreadPreCleanUp).
1481 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
1482 BrowserGpuMemoryBufferManager::current(), "BrowserGpuMemoryBufferManager",
1483 io_thread_->task_runner());
1484 #if defined(OS_ANDROID) 1473 #if defined(OS_ANDROID)
1485 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 1474 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
1486 tracing::GraphicsMemoryDumpProvider::GetInstance(), "AndroidGraphics", 1475 tracing::GraphicsMemoryDumpProvider::GetInstance(), "AndroidGraphics",
1487 nullptr); 1476 nullptr);
1488 #endif 1477 #endif
1489 1478
1490 { 1479 {
1491 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:AudioMan"); 1480 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:AudioMan");
1492 CreateAudioManager(); 1481 CreateAudioManager();
1493 } 1482 }
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1780 base::MakeUnique<media::AudioThreadImpl>(), 1769 base::MakeUnique<media::AudioThreadImpl>(),
1781 MediaInternals::GetInstance()); 1770 MediaInternals::GetInstance());
1782 } 1771 }
1783 CHECK(audio_manager_); 1772 CHECK(audio_manager_);
1784 1773
1785 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); 1774 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get());
1786 CHECK(audio_system_); 1775 CHECK(audio_system_);
1787 } 1776 }
1788 1777
1789 } // namespace content 1778 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698