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

Side by Side Diff: gpu/command_buffer/service/common_decoder.cc

Issue 2163093002: remove linked_ptr from gpu/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix? win32 compile Created 4 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
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/command_buffer/service/common_decoder.h" 5 #include "gpu/command_buffer/service/common_decoder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 172
173 CommonDecoder::Bucket* CommonDecoder::GetBucket(uint32_t bucket_id) const { 173 CommonDecoder::Bucket* CommonDecoder::GetBucket(uint32_t bucket_id) const {
174 BucketMap::const_iterator iter(buckets_.find(bucket_id)); 174 BucketMap::const_iterator iter(buckets_.find(bucket_id));
175 return iter != buckets_.end() ? &(*iter->second) : NULL; 175 return iter != buckets_.end() ? &(*iter->second) : NULL;
176 } 176 }
177 177
178 CommonDecoder::Bucket* CommonDecoder::CreateBucket(uint32_t bucket_id) { 178 CommonDecoder::Bucket* CommonDecoder::CreateBucket(uint32_t bucket_id) {
179 Bucket* bucket = GetBucket(bucket_id); 179 Bucket* bucket = GetBucket(bucket_id);
180 if (!bucket) { 180 if (!bucket) {
181 bucket = new Bucket(); 181 bucket = new Bucket();
182 buckets_[bucket_id] = linked_ptr<Bucket>(bucket); 182 buckets_[bucket_id] = std::unique_ptr<Bucket>(bucket);
183 } 183 }
184 return bucket; 184 return bucket;
185 } 185 }
186 186
187 namespace { 187 namespace {
188 188
189 // Returns the address of the first byte after a struct. 189 // Returns the address of the first byte after a struct.
190 template <typename T> 190 template <typename T>
191 const void* AddressAfterStruct(const T& pod) { 191 const void* AddressAfterStruct(const T& pod) {
192 return reinterpret_cast<const uint8_t*>(&pod) + sizeof(pod); 192 return reinterpret_cast<const uint8_t*>(&pod) + sizeof(pod);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 350 }
351 const void* src = bucket->GetData(offset, size); 351 const void* src = bucket->GetData(offset, size);
352 if (!src) { 352 if (!src) {
353 return error::kInvalidArguments; 353 return error::kInvalidArguments;
354 } 354 }
355 memcpy(data, src, size); 355 memcpy(data, src, size);
356 return error::kNoError; 356 return error::kNoError;
357 } 357 }
358 358
359 } // namespace gpu 359 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/common_decoder.h ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698