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

Side by Side Diff: base/memory/shared_memory_win.cc

Issue 2496783002: gpu: Reuse existing code for shared memory allocation. (Closed)
Patch Set: . Created 4 years, 1 month 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/memory/shared_memory.h" 5 #include "base/memory/shared_memory.h"
6 6
7 #include <aclapi.h> 7 #include <aclapi.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 372
373 373
374 void SharedMemory::Close() { 374 void SharedMemory::Close() {
375 mapped_file_.Close(); 375 mapped_file_.Close();
376 } 376 }
377 377
378 SharedMemoryHandle SharedMemory::handle() const { 378 SharedMemoryHandle SharedMemory::handle() const {
379 return SharedMemoryHandle(mapped_file_.Get(), base::GetCurrentProcId()); 379 return SharedMemoryHandle(mapped_file_.Get(), base::GetCurrentProcId());
380 } 380 }
381 381
382 SharedMemoryHandle SharedMemory::TakeHandle() {
383 SharedMemoryHandle handle(mapped_file_.Take(), base::GetCurrentProcId());
384 handle.SetOwnershipPassesToIPC(true);
385 memory_ = nullptr;
386 mapped_size_ = 0;
387 return handle;
388 }
389
382 } // namespace base 390 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698