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

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

Issue 1664863002: base: Fix copy contructor SharedMemoryHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | 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 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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698