Index: third_party/mojo/src/mojo/edk/system/data_pipe_consumer_dispatcher.cc |
diff --git a/third_party/mojo/src/mojo/edk/system/data_pipe_consumer_dispatcher.cc b/third_party/mojo/src/mojo/edk/system/data_pipe_consumer_dispatcher.cc |
index 65ec8ef55e344b0c9e0ee778d26f3d2faa276c32..bee4b23bb70d2a044a54cf22f9e7db2e3b636041 100644 |
--- a/third_party/mojo/src/mojo/edk/system/data_pipe_consumer_dispatcher.cc |
+++ b/third_party/mojo/src/mojo/edk/system/data_pipe_consumer_dispatcher.cc |
@@ -23,6 +23,22 @@ Dispatcher::Type DataPipeConsumerDispatcher::GetType() const { |
return kTypeDataPipeConsumer; |
} |
+// static |
+scoped_refptr<DataPipeConsumerDispatcher> |
+DataPipeConsumerDispatcher::Deserialize(Channel* channel, |
+ const void* source, |
+ size_t size) { |
+ scoped_refptr<DataPipe> data_pipe; |
+ if (!DataPipe::ConsumerDeserialize(channel, source, size, &data_pipe)) |
+ return nullptr; |
+ DCHECK(data_pipe); |
+ |
+ scoped_refptr<DataPipeConsumerDispatcher> dispatcher( |
+ new DataPipeConsumerDispatcher()); |
+ dispatcher->Init(data_pipe); |
+ return dispatcher; |
+} |
+ |
DataPipeConsumerDispatcher::~DataPipeConsumerDispatcher() { |
// |Close()|/|CloseImplNoLock()| should have taken care of the pipe. |
DCHECK(!data_pipe_); |