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/gpu/gpu_process_host_ui_shim.h" | 5 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 namespace content { | 34 namespace content { |
35 | 35 |
36 namespace { | 36 namespace { |
37 | 37 |
38 // One of the linux specific headers defines this as a macro. | 38 // One of the linux specific headers defines this as a macro. |
39 #ifdef DestroyAll | 39 #ifdef DestroyAll |
40 #undef DestroyAll | 40 #undef DestroyAll |
41 #endif | 41 #endif |
42 | 42 |
43 base::LazyInstance<IDMap<GpuProcessHostUIShim*>> g_hosts_by_id = | 43 base::LazyInstance<IDMap<GpuProcessHostUIShim*>>::DestructorAtExit |
44 LAZY_INSTANCE_INITIALIZER; | 44 g_hosts_by_id = LAZY_INSTANCE_INITIALIZER; |
45 | 45 |
46 void StopGpuProcessOnIO(int host_id) { | 46 void StopGpuProcessOnIO(int host_id) { |
47 GpuProcessHost* host = GpuProcessHost::FromID(host_id); | 47 GpuProcessHost* host = GpuProcessHost::FromID(host_id); |
48 if (host) | 48 if (host) |
49 host->StopGpuProcess(); | 49 host->StopGpuProcess(); |
50 } | 50 } |
51 | 51 |
52 } // namespace | 52 } // namespace |
53 | 53 |
54 void RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg) { | 54 void RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg) { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 void GpuProcessHostUIShim::OnGraphicsInfoCollected( | 161 void GpuProcessHostUIShim::OnGraphicsInfoCollected( |
162 const gpu::GPUInfo& gpu_info) { | 162 const gpu::GPUInfo& gpu_info) { |
163 // OnGraphicsInfoCollected is sent back after the GPU process successfully | 163 // OnGraphicsInfoCollected is sent back after the GPU process successfully |
164 // initializes GL. | 164 // initializes GL. |
165 TRACE_EVENT0("test_gpu", "OnGraphicsInfoCollected"); | 165 TRACE_EVENT0("test_gpu", "OnGraphicsInfoCollected"); |
166 | 166 |
167 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); | 167 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); |
168 } | 168 } |
169 | 169 |
170 } // namespace content | 170 } // namespace content |
OLD | NEW |