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

Side by Side Diff: content/child/child_gpu_memory_buffer_manager.cc

Issue 1815363002: Add RetainedRef uses where needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/child/child_gpu_memory_buffer_manager.h" 5 #include "content/child/child_gpu_memory_buffer_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/common/child_process_messages.h" 9 #include "content/common/child_process_messages.h"
10 #include "content/common/generic_shared_memory_id_generator.h" 10 #include "content/common/generic_shared_memory_id_generator.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 gfx::GpuMemoryBufferHandle handle; 45 gfx::GpuMemoryBufferHandle handle;
46 IPC::Message* message = new ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer( 46 IPC::Message* message = new ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer(
47 content::GetNextGenericSharedMemoryId(), size.width(), size.height(), 47 content::GetNextGenericSharedMemoryId(), size.width(), size.height(),
48 format, usage, &handle); 48 format, usage, &handle);
49 bool success = sender_->Send(message); 49 bool success = sender_->Send(message);
50 if (!success || handle.is_null()) 50 if (!success || handle.is_null())
51 return nullptr; 51 return nullptr;
52 52
53 scoped_ptr<GpuMemoryBufferImpl> buffer(GpuMemoryBufferImpl::CreateFromHandle( 53 scoped_ptr<GpuMemoryBufferImpl> buffer(GpuMemoryBufferImpl::CreateFromHandle(
54 handle, size, format, usage, 54 handle, size, format, usage,
55 base::Bind(&DeletedGpuMemoryBuffer, sender_, handle.id))); 55 base::Bind(&DeletedGpuMemoryBuffer, base::RetainedRef(sender_),
56 handle.id)));
56 if (!buffer) { 57 if (!buffer) {
57 sender_->Send(new ChildProcessHostMsg_DeletedGpuMemoryBuffer( 58 sender_->Send(new ChildProcessHostMsg_DeletedGpuMemoryBuffer(
58 handle.id, gpu::SyncToken())); 59 handle.id, gpu::SyncToken()));
59 return nullptr; 60 return nullptr;
60 } 61 }
61 62
62 return std::move(buffer); 63 return std::move(buffer);
63 } 64 }
64 65
65 scoped_ptr<gfx::GpuMemoryBuffer> 66 scoped_ptr<gfx::GpuMemoryBuffer>
(...skipping 12 matching lines...) Expand all
78 } 79 }
79 80
80 void ChildGpuMemoryBufferManager::SetDestructionSyncToken( 81 void ChildGpuMemoryBufferManager::SetDestructionSyncToken(
81 gfx::GpuMemoryBuffer* buffer, 82 gfx::GpuMemoryBuffer* buffer,
82 const gpu::SyncToken& sync_token) { 83 const gpu::SyncToken& sync_token) {
83 static_cast<GpuMemoryBufferImpl*>(buffer) 84 static_cast<GpuMemoryBufferImpl*>(buffer)
84 ->set_destruction_sync_token(sync_token); 85 ->set_destruction_sync_token(sync_token);
85 } 86 }
86 87
87 } // namespace content 88 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/webui/url_data_manager_backend.cc ('k') | content/child/fileapi/webfilesystem_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698