Index: base/win/scoped_process_information.cc |
diff --git a/base/win/scoped_process_information.cc b/base/win/scoped_process_information.cc |
index cb7a30e2f542b4ca1426b3e2ab4de67a667bc5d8..7635b36e3bc3d1c7124e86cd1639220c66ad9a6b 100644 |
--- a/base/win/scoped_process_information.cc |
+++ b/base/win/scoped_process_information.cc |
@@ -15,7 +15,7 @@ namespace { |
// Duplicates source into target, returning true upon success. |target| is |
// guaranteed to be untouched in case of failure. Succeeds with no side-effects |
// if source is NULL. |
-bool CheckAndDuplicateHandle(HANDLE source, HANDLE* target) { |
+bool CheckAndDuplicateHandle(HANDLE source, ScopedHandle* target) { |
if (!source) |
return true; |
@@ -26,7 +26,7 @@ bool CheckAndDuplicateHandle(HANDLE source, HANDLE* target) { |
DPLOG(ERROR) << "Failed to duplicate a handle."; |
return false; |
} |
- *target = temp; |
+ target->Set(temp); |
return true; |
} |
@@ -40,11 +40,6 @@ ScopedProcessInformation::~ScopedProcessInformation() { |
Close(); |
} |
-ScopedProcessInformation::Receiver ScopedProcessInformation::Receive() { |
- DCHECK(!IsValid()) << "process_information_ must be NULL"; |
- return Receiver(this); |
-} |
- |
bool ScopedProcessInformation::IsValid() const { |
return process_id_ || process_handle_.Get() || |
thread_id_ || thread_handle_.Get(); |
@@ -72,10 +67,8 @@ bool ScopedProcessInformation::DuplicateFrom( |
DCHECK(!IsValid()) << "target ScopedProcessInformation must be NULL"; |
DCHECK(other.IsValid()) << "source ScopedProcessInformation must be valid"; |
- if (CheckAndDuplicateHandle(other.process_handle(), |
- process_handle_.Receive()) && |
- CheckAndDuplicateHandle(other.thread_handle(), |
- thread_handle_.Receive())) { |
+ if (CheckAndDuplicateHandle(other.process_handle(), &process_handle_) && |
+ CheckAndDuplicateHandle(other.thread_handle(), &thread_handle_)) { |
process_id_ = other.process_id(); |
thread_id_ = other.thread_id(); |
return true; |