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

Side by Side Diff: content/common/gpu/client/command_buffer_proxy_impl.cc

Issue 10662005: Use IPC::Sender and IPC::Listener in content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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/common/gpu/client/command_buffer_proxy_impl.h" 5 #include "content/common/gpu/client/command_buffer_proxy_impl.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 } else { 523 } else {
524 // Flag the command buffer as lost. Defer deleting the channel until 524 // Flag the command buffer as lost. Defer deleting the channel until
525 // OnChannelError is called after returning to the message loop in case 525 // OnChannelError is called after returning to the message loop in case
526 // it is referenced elsewhere. 526 // it is referenced elsewhere.
527 last_state_.error = gpu::error::kLostContext; 527 last_state_.error = gpu::error::kLostContext;
528 return false; 528 return false;
529 } 529 }
530 } 530 }
531 531
532 // Callee takes ownership of message, regardless of whether Send is 532 // Callee takes ownership of message, regardless of whether Send is
533 // successful. See IPC::Message::Sender. 533 // successful. See IPC::Sender.
534 delete msg; 534 delete msg;
535 return false; 535 return false;
536 } 536 }
537 537
538 void CommandBufferProxyImpl::OnUpdateState( 538 void CommandBufferProxyImpl::OnUpdateState(
539 const gpu::CommandBuffer::State& state) { 539 const gpu::CommandBuffer::State& state) {
540 // Handle wraparound. It works as long as we don't have more than 2B state 540 // Handle wraparound. It works as long as we don't have more than 2B state
541 // updates in flight across which reordering occurs. 541 // updates in flight across which reordering occurs.
542 if (state.generation - last_state_.generation < 0x80000000U) 542 if (state.generation - last_state_.generation < 0x80000000U)
543 last_state_ = state; 543 last_state_ = state;
544 } 544 }
545 545
546 void CommandBufferProxyImpl::SetOnConsoleMessageCallback( 546 void CommandBufferProxyImpl::SetOnConsoleMessageCallback(
547 const GpuConsoleMessageCallback& callback) { 547 const GpuConsoleMessageCallback& callback) {
548 console_message_callback_ = callback; 548 console_message_callback_ = callback;
549 } 549 }
550 550
551 void CommandBufferProxyImpl::TryUpdateState() { 551 void CommandBufferProxyImpl::TryUpdateState() {
552 if (last_state_.error == gpu::error::kNoError) 552 if (last_state_.error == gpu::error::kNoError)
553 shared_state_->Read(&last_state_); 553 shared_state_->Read(&last_state_);
554 } 554 }
OLDNEW
« no previous file with comments | « content/common/gpu/client/command_buffer_proxy_impl.h ('k') | content/common/gpu/client/gpu_channel_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698