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

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

Issue 600693002: content: Cleanup GpuMemoryBufferImpl destruction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove scoped_refptr<> from sender param of DeletedGpuMemoryBuffer Created 6 years, 2 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 "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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 } 340 }
341 341
342 void CommandBufferProxyImpl::DestroyGpuMemoryBuffer(int32 id) { 342 void CommandBufferProxyImpl::DestroyGpuMemoryBuffer(int32 id) {
343 if (last_state_.error != gpu::error::kNoError) 343 if (last_state_.error != gpu::error::kNoError)
344 return; 344 return;
345 345
346 Send(new GpuCommandBufferMsg_UnregisterGpuMemoryBuffer(route_id_, id)); 346 Send(new GpuCommandBufferMsg_UnregisterGpuMemoryBuffer(route_id_, id));
347 347
348 // Remove the gpu memory buffer from the client side cache. 348 // Remove the gpu memory buffer from the client side cache.
349 DCHECK(gpu_memory_buffers_.find(id) != gpu_memory_buffers_.end()); 349 DCHECK(gpu_memory_buffers_.find(id) != gpu_memory_buffers_.end());
350 channel_->factory()->DeleteGpuMemoryBuffer(gpu_memory_buffers_.take(id)); 350 gpu_memory_buffers_.take(id);
351 } 351 }
352 352
353 int CommandBufferProxyImpl::GetRouteID() const { 353 int CommandBufferProxyImpl::GetRouteID() const {
354 return route_id_; 354 return route_id_;
355 } 355 }
356 356
357 void CommandBufferProxyImpl::Echo(const base::Closure& callback) { 357 void CommandBufferProxyImpl::Echo(const base::Closure& callback) {
358 if (last_state_.error != gpu::error::kNoError) { 358 if (last_state_.error != gpu::error::kNoError) {
359 return; 359 return;
360 } 360 }
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 if (last_state_.error == gpu::error::kNoError) 519 if (last_state_.error == gpu::error::kNoError)
520 shared_state()->Read(&last_state_); 520 shared_state()->Read(&last_state_);
521 } 521 }
522 522
523 gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const { 523 gpu::CommandBufferSharedState* CommandBufferProxyImpl::shared_state() const {
524 return reinterpret_cast<gpu::CommandBufferSharedState*>( 524 return reinterpret_cast<gpu::CommandBufferSharedState*>(
525 shared_state_shm_->memory()); 525 shared_state_shm_->memory());
526 } 526 }
527 527
528 } // namespace content 528 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/browser_gpu_channel_host_factory.cc ('k') | content/common/gpu/client/gpu_channel_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698