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

Side by Side Diff: ppapi/proxy/ppapi_command_buffer_proxy.cc

Issue 1864293002: Convert //ppapi to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more nullptr Created 4 years, 8 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
« no previous file with comments | « ppapi/proxy/ppapi_command_buffer_proxy.h ('k') | ppapi/proxy/ppapi_proxy_test.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) 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 "ppapi/proxy/ppapi_command_buffer_proxy.h" 5 #include "ppapi/proxy/ppapi_command_buffer_proxy.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/numerics/safe_conversions.h" 9 #include "base/numerics/safe_conversions.h"
10 #include "ppapi/proxy/ppapi_messages.h" 10 #include "ppapi/proxy/ppapi_messages.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 last_state_.error = gpu::error::kLostContext; 143 last_state_.error = gpu::error::kLostContext;
144 return NULL; 144 return NULL;
145 } 145 }
146 146
147 if (*id <= 0 || !handle.is_shmem()) { 147 if (*id <= 0 || !handle.is_shmem()) {
148 if (last_state_.error == gpu::error::kNoError) 148 if (last_state_.error == gpu::error::kNoError)
149 last_state_.error = gpu::error::kOutOfBounds; 149 last_state_.error = gpu::error::kOutOfBounds;
150 return NULL; 150 return NULL;
151 } 151 }
152 152
153 scoped_ptr<base::SharedMemory> shared_memory( 153 std::unique_ptr<base::SharedMemory> shared_memory(
154 new base::SharedMemory(handle.shmem(), false)); 154 new base::SharedMemory(handle.shmem(), false));
155 155
156 // Map the shared memory on demand. 156 // Map the shared memory on demand.
157 if (!shared_memory->memory()) { 157 if (!shared_memory->memory()) {
158 if (!shared_memory->Map(handle.size())) { 158 if (!shared_memory->Map(handle.size())) {
159 if (last_state_.error == gpu::error::kNoError) 159 if (last_state_.error == gpu::error::kNoError)
160 last_state_.error = gpu::error::kOutOfBounds; 160 last_state_.error = gpu::error::kOutOfBounds;
161 *id = -1; 161 *id = -1;
162 return NULL; 162 return NULL;
163 } 163 }
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 message->set_unblock(true); 321 message->set_unblock(true);
322 Send(message); 322 Send(message);
323 323
324 flush_info_->flush_pending = false; 324 flush_info_->flush_pending = false;
325 flush_info_->resource.SetHostResource(0, 0); 325 flush_info_->resource.SetHostResource(0, 0);
326 flushed_fence_sync_release_ = pending_fence_sync_release_; 326 flushed_fence_sync_release_ = pending_fence_sync_release_;
327 } 327 }
328 328
329 } // namespace proxy 329 } // namespace proxy
330 } // namespace ppapi 330 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppapi_command_buffer_proxy.h ('k') | ppapi/proxy/ppapi_proxy_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698