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

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

Issue 377723002: Fixes for re-enabling more MSVC level 4 warnings: content/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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/memory/shared_memory.h" 10 #include "base/memory/shared_memory.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 shared_state()->Initialize(); 140 shared_state()->Initialize();
141 141
142 // This handle is owned by the GPU process and must be passed to it or it 142 // This handle is owned by the GPU process and must be passed to it or it
143 // will leak. In otherwords, do not early out on error between here and the 143 // will leak. In otherwords, do not early out on error between here and the
144 // sending of the Initialize IPC below. 144 // sending of the Initialize IPC below.
145 base::SharedMemoryHandle handle = 145 base::SharedMemoryHandle handle =
146 channel_->ShareToGpuProcess(shared_state_shm_->handle()); 146 channel_->ShareToGpuProcess(shared_state_shm_->handle());
147 if (!base::SharedMemory::IsHandleValid(handle)) 147 if (!base::SharedMemory::IsHandleValid(handle))
148 return false; 148 return false;
149 149
150 bool result; 150 bool result = false;
151 if (!Send(new GpuCommandBufferMsg_Initialize( 151 if (!Send(new GpuCommandBufferMsg_Initialize(
152 route_id_, handle, &result, &capabilities_))) { 152 route_id_, handle, &result, &capabilities_))) {
153 LOG(ERROR) << "Could not send GpuCommandBufferMsg_Initialize."; 153 LOG(ERROR) << "Could not send GpuCommandBufferMsg_Initialize.";
154 return false; 154 return false;
155 } 155 }
156 156
157 if (!result) { 157 if (!result) {
158 LOG(ERROR) << "Failed to initialize command buffer service."; 158 LOG(ERROR) << "Failed to initialize command buffer service.";
159 return false; 159 return false;
160 } 160 }
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 } 370 }
371 371
372 echo_tasks_.push(callback); 372 echo_tasks_.push(callback);
373 } 373 }
374 374
375 uint32 CommandBufferProxyImpl::CreateStreamTexture(uint32 texture_id) { 375 uint32 CommandBufferProxyImpl::CreateStreamTexture(uint32 texture_id) {
376 if (last_state_.error != gpu::error::kNoError) 376 if (last_state_.error != gpu::error::kNoError)
377 return 0; 377 return 0;
378 378
379 int32 stream_id = channel_->GenerateRouteID(); 379 int32 stream_id = channel_->GenerateRouteID();
380 bool succeeded; 380 bool succeeded = false;
381 Send(new GpuCommandBufferMsg_CreateStreamTexture( 381 Send(new GpuCommandBufferMsg_CreateStreamTexture(
382 route_id_, texture_id, stream_id, &succeeded)); 382 route_id_, texture_id, stream_id, &succeeded));
383 if (!succeeded) { 383 if (!succeeded) {
384 DLOG(ERROR) << "GpuCommandBufferMsg_CreateStreamTexture returned failure"; 384 DLOG(ERROR) << "GpuCommandBufferMsg_CreateStreamTexture returned failure";
385 return 0; 385 return 0;
386 } 386 }
387 return stream_id; 387 return stream_id;
388 } 388 }
389 389
390 uint32 CommandBufferProxyImpl::InsertSyncPoint() { 390 uint32 CommandBufferProxyImpl::InsertSyncPoint() {
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 if (last_state_.error == gpu::error::kNoError) 524 if (last_state_.error == gpu::error::kNoError)
525 shared_state()->Read(&last_state_); 525 shared_state()->Read(&last_state_);
526 } 526 }
527 527
528 gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const { 528 gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const {
529 return reinterpret_cast<gpu::CommandBufferSharedState*>( 529 return reinterpret_cast<gpu::CommandBufferSharedState*>(
530 shared_state_shm_->memory()); 530 shared_state_shm_->memory());
531 } 531 }
532 532
533 } // namespace content 533 } // namespace content
OLDNEW
« no previous file with comments | « content/common/child_process_host_impl.cc ('k') | content/common/gpu/media/dxva_video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698