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

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

Issue 694463002: Revert of Update mojo sdk to rev e083961bf11fd0c94d40be8853761da529b6d444 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/channel_endpoint.h ('k') | mojo/edk/system/remote_message_pipe_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/channel_endpoint.cc
diff --git a/mojo/edk/system/channel_endpoint.cc b/mojo/edk/system/channel_endpoint.cc
index ac2005603ee8a26d182637f6037c5c6e27d972de..0318f2f90c6426ec848ca4ccd6d9b10674ce0a5b 100644
--- a/mojo/edk/system/channel_endpoint.cc
+++ b/mojo/edk/system/channel_endpoint.cc
@@ -62,6 +62,34 @@
channel_ = nullptr;
local_id_ = ChannelEndpointId();
remote_id_ = ChannelEndpointId();
+ }
+}
+
+void ChannelEndpoint::AttachToChannel(Channel* channel,
+ ChannelEndpointId local_id) {
+ DCHECK(channel);
+ DCHECK(local_id.is_valid());
+
+ base::AutoLock locker(lock_);
+ DCHECK(!channel_);
+ DCHECK(!local_id_.is_valid());
+ channel_ = channel;
+ local_id_ = local_id;
+}
+
+void ChannelEndpoint::Run(ChannelEndpointId remote_id) {
+ DCHECK(remote_id.is_valid());
+
+ base::AutoLock locker(lock_);
+ if (!channel_)
+ return;
+
+ DCHECK(!remote_id_.is_valid());
+ remote_id_ = remote_id;
+
+ while (!paused_message_queue_.IsEmpty()) {
+ LOG_IF(WARNING, !WriteMessageNoLock(paused_message_queue_.GetMessage()))
+ << "Failed to write enqueue message to channel";
}
}
« no previous file with comments | « mojo/edk/system/channel_endpoint.h ('k') | mojo/edk/system/remote_message_pipe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698