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

Side by Side Diff: content/browser/gpu/gpu_process_host.cc

Issue 10891013: Make GpuDataManager thread safe. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
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/gpu/gpu_process_host.h" 5 #include "content/browser/gpu/gpu_process_host.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 // static 261 // static
262 GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind, 262 GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind,
263 content::CauseForGpuLaunch cause) { 263 content::CauseForGpuLaunch cause) {
264 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 264 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
265 265
266 // Don't grant further access to GPU if it is not allowed. 266 // Don't grant further access to GPU if it is not allowed.
267 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance(); 267 GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
268 if (gpu_data_manager != NULL && 268 if (gpu_data_manager != NULL &&
269 (!gpu_data_manager->GpuAccessAllowed() || 269 (!gpu_data_manager->GpuAccessAllowed() ||
270 gpu_data_manager->GetGpuFeatureType() == content::GPU_FEATURE_TYPE_ALL)) 270 gpu_data_manager->GetBlacklistedFeatures() ==
271 content::GPU_FEATURE_TYPE_ALL))
271 return NULL; 272 return NULL;
272 273
273 if (g_gpu_process_hosts[kind] && HostIsValid(g_gpu_process_hosts[kind])) 274 if (g_gpu_process_hosts[kind] && HostIsValid(g_gpu_process_hosts[kind]))
274 return g_gpu_process_hosts[kind]; 275 return g_gpu_process_hosts[kind];
275 276
276 if (cause == content::CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH) 277 if (cause == content::CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH)
277 return NULL; 278 return NULL;
278 279
279 int host_id; 280 int host_id;
280 host_id = ++g_last_host_id; 281 host_id = ++g_last_host_id;
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 const IPC::ChannelHandle& channel_handle, 886 const IPC::ChannelHandle& channel_handle,
886 base::ProcessHandle renderer_process_for_gpu, 887 base::ProcessHandle renderer_process_for_gpu,
887 const content::GPUInfo& gpu_info) { 888 const content::GPUInfo& gpu_info) {
888 callback.Run(channel_handle, gpu_info); 889 callback.Run(channel_handle, gpu_info);
889 } 890 }
890 891
891 void GpuProcessHost::CreateCommandBufferError( 892 void GpuProcessHost::CreateCommandBufferError(
892 const CreateCommandBufferCallback& callback, int32 route_id) { 893 const CreateCommandBufferCallback& callback, int32 route_id) {
893 callback.Run(route_id); 894 callback.Run(route_id);
894 } 895 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698