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

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

Issue 2810593003: gpu: Some cleanups. (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.h ('k') | content/browser/renderer_host/render_message_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 16b1f0db35a5dbd3295720daeddaf209207af1e0..7aec4ef6a28854661773fd50d952d8804f95ca69 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -386,26 +386,24 @@ GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind, bool force_create) {
}
// static
-void GpuProcessHost::GetProcessHandles(
- const GpuDataManager::GetGpuProcessHandlesCallback& callback) {
+void GpuProcessHost::GetHasGpuProcess(
+ const base::Callback<void(bool)>& callback) {
if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) {
BrowserThread::PostTask(
- BrowserThread::IO,
- FROM_HERE,
- base::Bind(&GpuProcessHost::GetProcessHandles, callback));
+ BrowserThread::IO, FROM_HERE,
+ base::Bind(&GpuProcessHost::GetHasGpuProcess, callback));
return;
}
- std::list<base::ProcessHandle> handles;
+ bool has_gpu = false;
for (size_t i = 0; i < arraysize(g_gpu_process_hosts); ++i) {
- // TODO(rvargas) crbug/417532: don't store ProcessHandles!.
GpuProcessHost* host = g_gpu_process_hosts[i];
- if (host && ValidateHost(host))
- handles.push_back(host->process_->GetProcess().Handle());
+ if (host && ValidateHost(host)) {
+ has_gpu = true;
+ break;
+ }
}
- BrowserThread::PostTask(
- BrowserThread::UI,
- FROM_HERE,
- base::Bind(callback, handles));
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::Bind(callback, has_gpu));
}
// static
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | content/browser/renderer_host/render_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698