Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / mojo / system / data_pipe_producer_dispatcher.cc
index 52ffd8e..d3c69b6 100644 (file)
@@ -19,6 +19,10 @@ void DataPipeProducerDispatcher::Init(scoped_refptr<DataPipe> data_pipe) {
   data_pipe_ = data_pipe;
 }
 
+Dispatcher::Type DataPipeProducerDispatcher::GetType() const {
+  return kTypeDataPipeProducer;
+}
+
 DataPipeProducerDispatcher::~DataPipeProducerDispatcher() {
   // |Close()|/|CloseImplNoLock()| should have taken care of the pipe.
   DCHECK(!data_pipe_.get());
@@ -29,11 +33,21 @@ void DataPipeProducerDispatcher::CancelAllWaitersNoLock() {
   data_pipe_->ProducerCancelAllWaiters();
 }
 
-MojoResult DataPipeProducerDispatcher::CloseImplNoLock() {
+void DataPipeProducerDispatcher::CloseImplNoLock() {
   lock().AssertAcquired();
   data_pipe_->ProducerClose();
   data_pipe_ = NULL;
-  return MOJO_RESULT_OK;
+}
+
+scoped_refptr<Dispatcher>
+DataPipeProducerDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() {
+  lock().AssertAcquired();
+
+  scoped_refptr<DataPipeProducerDispatcher> rv =
+      new DataPipeProducerDispatcher();
+  rv->Init(data_pipe_);
+  data_pipe_ = NULL;
+  return scoped_refptr<Dispatcher>(rv.get());
 }
 
 MojoResult DataPipeProducerDispatcher::WriteDataImplNoLock(
@@ -86,15 +100,9 @@ void DataPipeProducerDispatcher::RemoveWaiterImplNoLock(Waiter* waiter) {
   data_pipe_->ProducerRemoveWaiter(waiter);
 }
 
-scoped_refptr<Dispatcher>
-DataPipeProducerDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() {
+bool DataPipeProducerDispatcher::IsBusyNoLock() const {
   lock().AssertAcquired();
-
-  scoped_refptr<DataPipeProducerDispatcher> rv =
-      new DataPipeProducerDispatcher();
-  rv->Init(data_pipe_);
-  data_pipe_ = NULL;
-  return scoped_refptr<Dispatcher>(rv.get());
+  return data_pipe_->ProducerIsBusy();
 }
 
 }  // namespace system