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

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();
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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 1462
1468 // TODO(danakj): Don't make a FrameSinkManagerImpl when display is in the 1463 // TODO(danakj): Don't make a FrameSinkManagerImpl when display is in the
1469 // Gpu process, instead get the mojo pointer from the Gpu process. 1464 // Gpu process, instead get the mojo pointer from the Gpu process.
1470 frame_sink_manager_ = 1465 frame_sink_manager_ =
1471 base::MakeUnique<viz::FrameSinkManagerImpl>(false, nullptr); 1466 base::MakeUnique<viz::FrameSinkManagerImpl>(false, nullptr);
1472 surface_utils::ConnectWithInProcessFrameSinkManager( 1467 surface_utils::ConnectWithInProcessFrameSinkManager(
1473 host_frame_sink_manager_.get(), frame_sink_manager_.get()); 1468 host_frame_sink_manager_.get(), frame_sink_manager_.get());
1474 } 1469 }
1475 #endif 1470 #endif
1476 1471
1477 // Enable the GpuMemoryBuffer dump provider with IO thread affinity. Note that
1478 // unregistration happens on the IO thread (See
1479 // BrowserProcessSubThread::IOThreadPreCleanUp).
1480 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
1481 BrowserGpuMemoryBufferManager::current(), "BrowserGpuMemoryBufferManager",
1482 io_thread_->task_runner());
1483 #if defined(OS_ANDROID) 1472 #if defined(OS_ANDROID)
1484 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider( 1473 base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
1485 tracing::GraphicsMemoryDumpProvider::GetInstance(), "AndroidGraphics", 1474 tracing::GraphicsMemoryDumpProvider::GetInstance(), "AndroidGraphics",
1486 nullptr); 1475 nullptr);
1487 #endif 1476 #endif
1488 1477
1489 { 1478 {
1490 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:AudioMan"); 1479 TRACE_EVENT0("startup", "BrowserThreadsStarted::Subsystem:AudioMan");
1491 CreateAudioManager(); 1480 CreateAudioManager();
1492 } 1481 }
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1779 base::MakeUnique<media::AudioThreadImpl>(), 1768 base::MakeUnique<media::AudioThreadImpl>(),
1780 MediaInternals::GetInstance()); 1769 MediaInternals::GetInstance());
1781 } 1770 }
1782 CHECK(audio_manager_); 1771 CHECK(audio_manager_);
1783 1772
1784 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); 1773 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get());
1785 CHECK(audio_system_); 1774 CHECK(audio_system_);
1786 } 1775 }
1787 1776
1788 } // namespace content 1777 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/browser_process_sub_thread.cc » ('j') | content/browser/gpu/browser_gpu_memory_buffer_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698