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

Unified Diff: content/browser/gpu/gpu_process_host_ui_shim.cc

Issue 2817503005: gpu: Allow GpuProcessHostUIShim to leak during teardown. (Closed)
Patch Set: . Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_process_host_ui_shim.cc
diff --git a/content/browser/gpu/gpu_process_host_ui_shim.cc b/content/browser/gpu/gpu_process_host_ui_shim.cc
index 8c3afc95aa2b20a06204a1d7ebbf78225942cbdd..e4fd84206c6b3657635aecee613dea8d81370072 100644
--- a/content/browser/gpu/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu/gpu_process_host_ui_shim.cc
@@ -43,13 +43,8 @@ namespace content {
namespace {
-// One of the linux specific headers defines this as a macro.
-#ifdef DestroyAll
-#undef DestroyAll
-#endif
-
-base::LazyInstance<IDMap<GpuProcessHostUIShim*>>::DestructorAtExit
- g_hosts_by_id = LAZY_INSTANCE_INITIALIZER;
+base::LazyInstance<IDMap<GpuProcessHostUIShim*>>::Leaky g_hosts_by_id =
+ LAZY_INSTANCE_INITIALIZER;
#if defined(OS_ANDROID)
template <typename Interface>
@@ -101,35 +96,24 @@ void GpuProcessHostUIShim::Destroy(int host_id, const std::string& message) {
}
// static
-void GpuProcessHostUIShim::DestroyAll() {
- DCHECK_CURRENTLY_ON(BrowserThread::UI);
- while (!g_hosts_by_id.Pointer()->IsEmpty()) {
- IDMap<GpuProcessHostUIShim*>::iterator it(g_hosts_by_id.Pointer());
- delete it.GetCurrentValue();
- }
-}
-
-// static
GpuProcessHostUIShim* GpuProcessHostUIShim::FromID(int host_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
return g_hosts_by_id.Pointer()->Lookup(host_id);
}
-bool GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) {
+void GpuProcessHostUIShim::OnMessageReceived(const IPC::Message& message) {
DCHECK(CalledOnValidThread());
#if defined(USE_OZONE)
if (ui::OzonePlatform::GetInstance()
->GetGpuPlatformSupportHost()
->OnMessageReceived(message))
- return true;
+ return;
#endif
- if (message.routing_id() != MSG_ROUTING_CONTROL)
- return false;
-
- NOTREACHED() << "Invalid message with type = " << message.type();
- return true;
+ if (message.routing_id() == MSG_ROUTING_CONTROL) {
+ NOTREACHED() << "Invalid message with type = " << message.type();
+ }
}
GpuProcessHostUIShim::~GpuProcessHostUIShim() {
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698