Index: base/memory/shared_memory_handle_win.cc |
diff --git a/base/memory/shared_memory_handle_win.cc b/base/memory/shared_memory_handle_win.cc |
index 7480151b1ab3a8bd0474f576e898fc3e9ce85102..4fe8e7e6b38d45ea5c0797245b3c3a0bf9e4b8d4 100644 |
--- a/base/memory/shared_memory_handle_win.cc |
+++ b/base/memory/shared_memory_handle_win.cc |
@@ -5,28 +5,15 @@ |
#include "base/memory/shared_memory_handle.h" |
#include "base/logging.h" |
+#include "base/unguessable_token.h" |
namespace base { |
SharedMemoryHandle::SharedMemoryHandle() |
: handle_(nullptr), ownership_passes_to_ipc_(false) {} |
-SharedMemoryHandle::SharedMemoryHandle(HANDLE h) |
- : handle_(h), ownership_passes_to_ipc_(false) {} |
- |
-SharedMemoryHandle::SharedMemoryHandle(const SharedMemoryHandle& handle) |
- : handle_(handle.handle_), |
- ownership_passes_to_ipc_(handle.ownership_passes_to_ipc_) {} |
- |
-SharedMemoryHandle& SharedMemoryHandle::operator=( |
- const SharedMemoryHandle& handle) { |
- if (this == &handle) |
- return *this; |
- |
- handle_ = handle.handle_; |
- ownership_passes_to_ipc_ = handle.ownership_passes_to_ipc_; |
- return *this; |
-} |
+SharedMemoryHandle(HANDLE h, const base::UnguessableToken& guid) |
+ : handle_(h), ownership_passes_to_ipc_(false), guid_(guid) {} |
void SharedMemoryHandle::Close() const { |
DCHECK(handle_ != nullptr); |
@@ -45,7 +32,7 @@ SharedMemoryHandle SharedMemoryHandle::Duplicate() const { |
if (!success) |
return SharedMemoryHandle(); |
- base::SharedMemoryHandle handle(duped_handle); |
+ base::SharedMemoryHandle handle(duped_handle, GetGUID()); |
Nico
2017/05/04 17:42:13
So several handles can have the same guid? Documen
erikchen
2017/05/04 19:21:13
Done.
|
handle.SetOwnershipPassesToIPC(true); |
return handle; |
} |