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());
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(
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