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

Side by Side Diff: gpu/ipc/service/gpu_command_buffer_stub.cc

Issue 2257713003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 "gpu/ipc/service/gpu_command_buffer_stub.h" 5 #include "gpu/ipc/service/gpu_command_buffer_stub.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 704
705 void GpuCommandBufferStub::OnWaitForTokenInRange(int32_t start, 705 void GpuCommandBufferStub::OnWaitForTokenInRange(int32_t start,
706 int32_t end, 706 int32_t end,
707 IPC::Message* reply_message) { 707 IPC::Message* reply_message) {
708 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnWaitForTokenInRange"); 708 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnWaitForTokenInRange");
709 DCHECK(command_buffer_.get()); 709 DCHECK(command_buffer_.get());
710 CheckContextLost(); 710 CheckContextLost();
711 if (wait_for_token_) 711 if (wait_for_token_)
712 LOG(ERROR) << "Got WaitForToken command while currently waiting for token."; 712 LOG(ERROR) << "Got WaitForToken command while currently waiting for token.";
713 wait_for_token_ = 713 wait_for_token_ =
714 base::WrapUnique(new WaitForCommandState(start, end, reply_message)); 714 base::MakeUnique<WaitForCommandState>(start, end, reply_message);
715 CheckCompleteWaits(); 715 CheckCompleteWaits();
716 } 716 }
717 717
718 void GpuCommandBufferStub::OnWaitForGetOffsetInRange( 718 void GpuCommandBufferStub::OnWaitForGetOffsetInRange(
719 int32_t start, 719 int32_t start,
720 int32_t end, 720 int32_t end,
721 IPC::Message* reply_message) { 721 IPC::Message* reply_message) {
722 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnWaitForGetOffsetInRange"); 722 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnWaitForGetOffsetInRange");
723 DCHECK(command_buffer_.get()); 723 DCHECK(command_buffer_.get());
724 CheckContextLost(); 724 CheckContextLost();
725 if (wait_for_get_offset_) { 725 if (wait_for_get_offset_) {
726 LOG(ERROR) 726 LOG(ERROR)
727 << "Got WaitForGetOffset command while currently waiting for offset."; 727 << "Got WaitForGetOffset command while currently waiting for offset.";
728 } 728 }
729 wait_for_get_offset_ = 729 wait_for_get_offset_ =
730 base::WrapUnique(new WaitForCommandState(start, end, reply_message)); 730 base::MakeUnique<WaitForCommandState>(start, end, reply_message);
731 CheckCompleteWaits(); 731 CheckCompleteWaits();
732 } 732 }
733 733
734 void GpuCommandBufferStub::CheckCompleteWaits() { 734 void GpuCommandBufferStub::CheckCompleteWaits() {
735 if (wait_for_token_ || wait_for_get_offset_) { 735 if (wait_for_token_ || wait_for_get_offset_) {
736 CommandBuffer::State state = command_buffer_->GetLastState(); 736 CommandBuffer::State state = command_buffer_->GetLastState();
737 if (wait_for_token_ && 737 if (wait_for_token_ &&
738 (CommandBuffer::InRange( 738 (CommandBuffer::InRange(
739 wait_for_token_->start, wait_for_token_->end, state.token) || 739 wait_for_token_->start, wait_for_token_->end, state.token) ||
740 state.error != error::kNoError)) { 740 state.error != error::kNoError)) {
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params)); 1113 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params));
1114 } 1114 }
1115 1115
1116 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, 1116 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase,
1117 base::TimeDelta interval) { 1117 base::TimeDelta interval) {
1118 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, 1118 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase,
1119 interval)); 1119 interval));
1120 } 1120 }
1121 1121
1122 } // namespace gpu 1122 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/service/gpu_channel_test_common.cc ('k') | gpu/tools/compositor_model_bench/render_models.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698