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

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

Issue 2846893003: Used a single class for SharedMemoryHandle. (Closed)
Patch Set: Rebase. Created 3 years, 7 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 | « base/memory/shared_memory_handle.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_handle.h" 5 #include "base/memory/shared_memory_handle.h"
6 6
7 #include <unistd.h> 7 #include <unistd.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/posix/eintr_wrapper.h" 10 #include "base/posix/eintr_wrapper.h"
11 11
12 namespace base { 12 namespace base {
13 13
14 SharedMemoryHandle::SharedMemoryHandle() = default; 14 SharedMemoryHandle::SharedMemoryHandle() = default;
15 SharedMemoryHandle::SharedMemoryHandle(const SharedMemoryHandle& handle) =
16 default;
17 SharedMemoryHandle& SharedMemoryHandle::operator=(
18 const SharedMemoryHandle& handle) = default;
15 19
16 SharedMemoryHandle::SharedMemoryHandle( 20 SharedMemoryHandle::SharedMemoryHandle(
17 const base::FileDescriptor& file_descriptor) 21 const base::FileDescriptor& file_descriptor)
18 : file_descriptor_(file_descriptor) {} 22 : file_descriptor_(file_descriptor) {}
19 23
20 // static 24 // static
21 SharedMemoryHandle SharedMemoryHandle::ImportHandle(int fd) { 25 SharedMemoryHandle SharedMemoryHandle::ImportHandle(int fd) {
22 SharedMemoryHandle handle; 26 SharedMemoryHandle handle;
23 handle.file_descriptor_.fd = fd; 27 handle.file_descriptor_.fd = fd;
24 handle.file_descriptor_.auto_close = false; 28 handle.file_descriptor_.auto_close = false;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 64
61 void SharedMemoryHandle::SetOwnershipPassesToIPC(bool ownership_passes) { 65 void SharedMemoryHandle::SetOwnershipPassesToIPC(bool ownership_passes) {
62 file_descriptor_.auto_close = ownership_passes; 66 file_descriptor_.auto_close = ownership_passes;
63 } 67 }
64 68
65 bool SharedMemoryHandle::OwnershipPassesToIPC() const { 69 bool SharedMemoryHandle::OwnershipPassesToIPC() const {
66 return file_descriptor_.auto_close; 70 return file_descriptor_.auto_close;
67 } 71 }
68 72
69 } // namespace base 73 } // namespace base
OLDNEW
« no previous file with comments | « base/memory/shared_memory_handle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698