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

Side by Side Diff: gpu/command_buffer/client/mapped_memory.cc

Issue 3743001: FBTF: Fix more ctor/dtors found by clang plugin. (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: Rebase to pick up mac fix on ToT Created 10 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 | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/client/mapped_memory.h ('k') | gpu/command_buffer/common/id_allocator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <algorithm> 5 #include <algorithm>
6 #include <functional> 6 #include <functional>
7 7
8 #include "../client/mapped_memory.h" 8 #include "../client/mapped_memory.h"
9 #include "../client/cmd_buffer_helper.h" 9 #include "../client/cmd_buffer_helper.h"
10 10
11 namespace gpu { 11 namespace gpu {
12 namespace { 12 namespace {
13 void DeleteMemoryChunk(MemoryChunk* chunk) { 13 void DeleteMemoryChunk(MemoryChunk* chunk) {
14 delete chunk; 14 delete chunk;
15 } 15 }
16 } 16 }
17 17
18 MemoryChunk::MemoryChunk( 18 MemoryChunk::MemoryChunk(
19 int32 shm_id, gpu::Buffer shm, CommandBufferHelper* helper) 19 int32 shm_id, gpu::Buffer shm, CommandBufferHelper* helper)
20 : shm_id_(shm_id), 20 : shm_id_(shm_id),
21 shm_(shm), 21 shm_(shm),
22 allocator_(shm.size, helper, shm.ptr) { 22 allocator_(shm.size, helper, shm.ptr) {
23 } 23 }
24 24
25 MappedMemoryManager::MappedMemoryManager(CommandBufferHelper* helper)
26 : helper_(helper) {
27 }
28
25 MappedMemoryManager::~MappedMemoryManager() { 29 MappedMemoryManager::~MappedMemoryManager() {
26 std::for_each(chunks_.begin(), 30 std::for_each(chunks_.begin(),
27 chunks_.end(), 31 chunks_.end(),
28 std::pointer_to_unary_function<MemoryChunk*, void>( 32 std::pointer_to_unary_function<MemoryChunk*, void>(
29 DeleteMemoryChunk)); 33 DeleteMemoryChunk));
30 } 34 }
31 35
32 void* MappedMemoryManager::Alloc( 36 void* MappedMemoryManager::Alloc(
33 unsigned int size, int32* shm_id, unsigned int* shm_offset) { 37 unsigned int size, int32* shm_id, unsigned int* shm_offset) {
34 GPU_DCHECK(shm_id); 38 GPU_DCHECK(shm_id);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 return; 85 return;
82 } 86 }
83 } 87 }
84 GPU_NOTREACHED(); 88 GPU_NOTREACHED();
85 } 89 }
86 90
87 } // namespace gpu 91 } // namespace gpu
88 92
89 93
90 94
OLDNEW
« no previous file with comments | « gpu/command_buffer/client/mapped_memory.h ('k') | gpu/command_buffer/common/id_allocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698