| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace base { | 9 namespace base { |
| 10 | 10 |
| 11 SharedMemoryHandle::SharedMemoryHandle() | 11 SharedMemoryHandle::SharedMemoryHandle() |
| 12 : handle_(nullptr), pid_(kNullProcessId), ownership_passes_to_ipc_(false) {} | 12 : handle_(nullptr), pid_(kNullProcessId), ownership_passes_to_ipc_(false) {} |
| 13 | 13 |
| 14 SharedMemoryHandle::SharedMemoryHandle(HANDLE h, base::ProcessId pid) | 14 SharedMemoryHandle::SharedMemoryHandle(HANDLE h, base::ProcessId pid) |
| 15 : handle_(h), pid_(pid), ownership_passes_to_ipc_(false) {} | 15 : handle_(h), pid_(pid), ownership_passes_to_ipc_(false) {} |
| 16 | 16 |
| 17 SharedMemoryHandle::SharedMemoryHandle(const SharedMemoryHandle& handle) | 17 SharedMemoryHandle::SharedMemoryHandle(const SharedMemoryHandle& handle) |
| 18 : handle_(handle.handle_), | 18 : handle_(handle.handle_), |
| 19 pid_(handle.pid_), | 19 pid_(handle.pid_), |
| 20 ownership_passes_to_ipc_(false) {} | 20 ownership_passes_to_ipc_(handle.ownership_passes_to_ipc_) {} |
| 21 | 21 |
| 22 SharedMemoryHandle& SharedMemoryHandle::operator=( | 22 SharedMemoryHandle& SharedMemoryHandle::operator=( |
| 23 const SharedMemoryHandle& handle) { | 23 const SharedMemoryHandle& handle) { |
| 24 if (this == &handle) | 24 if (this == &handle) |
| 25 return *this; | 25 return *this; |
| 26 | 26 |
| 27 handle_ = handle.handle_; | 27 handle_ = handle.handle_; |
| 28 pid_ = handle.pid_; | 28 pid_ = handle.pid_; |
| 29 ownership_passes_to_ipc_ = handle.ownership_passes_to_ipc_; | 29 ownership_passes_to_ipc_ = handle.ownership_passes_to_ipc_; |
| 30 return *this; | 30 return *this; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 void SharedMemoryHandle::SetOwnershipPassesToIPC(bool ownership_passes) { | 71 void SharedMemoryHandle::SetOwnershipPassesToIPC(bool ownership_passes) { |
| 72 ownership_passes_to_ipc_ = ownership_passes; | 72 ownership_passes_to_ipc_ = ownership_passes; |
| 73 } | 73 } |
| 74 | 74 |
| 75 bool SharedMemoryHandle::OwnershipPassesToIPC() const { | 75 bool SharedMemoryHandle::OwnershipPassesToIPC() const { |
| 76 return ownership_passes_to_ipc_; | 76 return ownership_passes_to_ipc_; |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace base | 79 } // namespace base |
| OLD | NEW |