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

Unified Diff: mojo/edk/system/node_channel.cc

Issue 2111453002: [mojo-edk] Duplicate process handle and take ownership in NodeChannel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/node_channel.h ('k') | mojo/edk/system/node_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/node_channel.cc
diff --git a/mojo/edk/system/node_channel.cc b/mojo/edk/system/node_channel.cc
index 45e933bccf10876d63ba36603ab5681047a101af..3cd0ecbc34fc8d3d08611af0e0eb2bcc208fa82b 100644
--- a/mojo/edk/system/node_channel.cc
+++ b/mojo/edk/system/node_channel.cc
@@ -223,8 +223,13 @@ void NodeChannel::NotifyBadMessage(const std::string& error) {
void NodeChannel::SetRemoteProcessHandle(base::ProcessHandle process_handle) {
DCHECK(io_task_runner_->RunsTasksOnCurrentThread());
base::AutoLock lock(remote_process_handle_lock_);
+ DCHECK_EQ(base::kNullProcessHandle, remote_process_handle_);
CHECK_NE(remote_process_handle_, base::GetCurrentProcessHandle());
remote_process_handle_ = process_handle;
+#if defined(OS_WIN)
+ DCHECK(!scoped_remote_process_handle_.is_valid());
+ scoped_remote_process_handle_.reset(PlatformHandle(process_handle));
+#endif
}
bool NodeChannel::HasRemoteProcessHandle() {
@@ -243,7 +248,7 @@ base::ProcessHandle NodeChannel::CopyRemoteProcessHandle() {
base::GetCurrentProcessHandle(), remote_process_handle_,
base::GetCurrentProcessHandle(), &handle, 0, FALSE,
DUPLICATE_SAME_ACCESS);
- DCHECK(result);
+ DPCHECK(result);
return handle;
}
return base::kNullProcessHandle;
« no previous file with comments | « mojo/edk/system/node_channel.h ('k') | mojo/edk/system/node_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698