OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |