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

Unified Diff: third_party/mojo/src/mojo/edk/system/incoming_endpoint.cc

Issue 975973002: Update mojo sdk to rev f68e697e389943cd9bf9652397312280e96b127a (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: shake fist at msvc Created 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/mojo/src/mojo/edk/system/incoming_endpoint.cc
diff --git a/third_party/mojo/src/mojo/edk/system/incoming_endpoint.cc b/third_party/mojo/src/mojo/edk/system/incoming_endpoint.cc
index 14f1a71816287e0a4e41dacece0838aac099b036..cd091b1d2e2fee09a49157593a6ff4ce1279cf2c 100644
--- a/third_party/mojo/src/mojo/edk/system/incoming_endpoint.cc
+++ b/third_party/mojo/src/mojo/edk/system/incoming_endpoint.cc
@@ -6,8 +6,10 @@
#include "base/logging.h"
#include "mojo/edk/system/channel_endpoint.h"
+#include "mojo/edk/system/data_pipe.h"
#include "mojo/edk/system/message_in_transit.h"
#include "mojo/edk/system/message_pipe.h"
+#include "mojo/edk/system/remote_producer_data_pipe_impl.h"
namespace mojo {
namespace system {
@@ -30,6 +32,27 @@ scoped_refptr<MessagePipe> IncomingEndpoint::ConvertToMessagePipe() {
return message_pipe;
}
+scoped_refptr<DataPipe> IncomingEndpoint::ConvertToDataPipeProducer(
+ const MojoCreateDataPipeOptions& validated_options,
+ size_t consumer_num_bytes) {
+ base::AutoLock locker(lock_);
+ scoped_refptr<DataPipe> data_pipe(DataPipe::CreateRemoteConsumerFromExisting(
+ validated_options, consumer_num_bytes, &message_queue_, endpoint_.get()));
+ DCHECK(message_queue_.IsEmpty());
+ endpoint_ = nullptr;
+ return data_pipe;
+}
+
+scoped_refptr<DataPipe> IncomingEndpoint::ConvertToDataPipeConsumer(
+ const MojoCreateDataPipeOptions& validated_options) {
+ base::AutoLock locker(lock_);
+ scoped_refptr<DataPipe> data_pipe(DataPipe::CreateRemoteProducerFromExisting(
+ validated_options, &message_queue_, endpoint_.get()));
+ DCHECK(message_queue_.IsEmpty());
+ endpoint_ = nullptr;
+ return data_pipe;
+}
+
void IncomingEndpoint::Close() {
base::AutoLock locker(lock_);
if (endpoint_) {
« no previous file with comments | « third_party/mojo/src/mojo/edk/system/incoming_endpoint.h ('k') | third_party/mojo/src/mojo/edk/system/local_data_pipe_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698