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

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

Issue 9619017: Fix context sharing between channels to be order-independent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 410
411 void GpuProcessHost::OnChannelConnected(int32 peer_pid) { 411 void GpuProcessHost::OnChannelConnected(int32 peer_pid) {
412 while (!queued_messages_.empty()) { 412 while (!queued_messages_.empty()) {
413 Send(queued_messages_.front()); 413 Send(queued_messages_.front());
414 queued_messages_.pop(); 414 queued_messages_.pop();
415 } 415 }
416 } 416 }
417 417
418 void GpuProcessHost::EstablishGpuChannel( 418 void GpuProcessHost::EstablishGpuChannel(
419 int client_id, 419 int client_id,
420 int share_client_id, 420 bool share_context,
421 const EstablishChannelCallback& callback) { 421 const EstablishChannelCallback& callback) {
422 DCHECK(CalledOnValidThread()); 422 DCHECK(CalledOnValidThread());
423 TRACE_EVENT0("gpu", "GpuProcessHostUIShim::EstablishGpuChannel"); 423 TRACE_EVENT0("gpu", "GpuProcessHostUIShim::EstablishGpuChannel");
424 424
425 // If GPU features are already blacklisted, no need to establish the channel. 425 // If GPU features are already blacklisted, no need to establish the channel.
426 if (!GpuDataManagerImpl::GetInstance()->GpuAccessAllowed()) { 426 if (!GpuDataManagerImpl::GetInstance()->GpuAccessAllowed()) {
427 EstablishChannelError( 427 EstablishChannelError(
428 callback, IPC::ChannelHandle(), 428 callback, IPC::ChannelHandle(),
429 base::kNullProcessHandle, content::GPUInfo()); 429 base::kNullProcessHandle, content::GPUInfo());
430 return; 430 return;
431 } 431 }
432 432
433 if (Send(new GpuMsg_EstablishChannel(client_id, share_client_id))) { 433 if (Send(new GpuMsg_EstablishChannel(client_id, share_context))) {
434 channel_requests_.push(callback); 434 channel_requests_.push(callback);
435 } else { 435 } else {
436 EstablishChannelError( 436 EstablishChannelError(
437 callback, IPC::ChannelHandle(), 437 callback, IPC::ChannelHandle(),
438 base::kNullProcessHandle, content::GPUInfo()); 438 base::kNullProcessHandle, content::GPUInfo());
439 } 439 }
440 } 440 }
441 441
442 void GpuProcessHost::CreateViewCommandBuffer( 442 void GpuProcessHost::CreateViewCommandBuffer(
443 const gfx::GLSurfaceHandle& compositing_surface, 443 const gfx::GLSurfaceHandle& compositing_surface,
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 const IPC::ChannelHandle& channel_handle, 691 const IPC::ChannelHandle& channel_handle,
692 base::ProcessHandle renderer_process_for_gpu, 692 base::ProcessHandle renderer_process_for_gpu,
693 const content::GPUInfo& gpu_info) { 693 const content::GPUInfo& gpu_info) {
694 callback.Run(channel_handle, renderer_process_for_gpu, gpu_info); 694 callback.Run(channel_handle, renderer_process_for_gpu, gpu_info);
695 } 695 }
696 696
697 void GpuProcessHost::CreateCommandBufferError( 697 void GpuProcessHost::CreateCommandBufferError(
698 const CreateCommandBufferCallback& callback, int32 route_id) { 698 const CreateCommandBufferCallback& callback, int32 route_id) {
699 callback.Run(route_id); 699 callback.Run(route_id);
700 } 700 }
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_process_host.h ('k') | content/browser/renderer_host/gpu_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698