Index: mojo/edk/system/data_pipe_producer_dispatcher.cc |
diff --git a/mojo/edk/system/data_pipe_producer_dispatcher.cc b/mojo/edk/system/data_pipe_producer_dispatcher.cc |
index cb712d39e7bfe4cfab9333cf4a92ffa7e261a2ac..55ee7359631547335556049cd53972077663f598 100644 |
--- a/mojo/edk/system/data_pipe_producer_dispatcher.cc |
+++ b/mojo/edk/system/data_pipe_producer_dispatcher.cc |
@@ -23,16 +23,16 @@ Dispatcher::Type DataPipeProducerDispatcher::GetType() const { |
} |
// static |
-scoped_refptr<DataPipeProducerDispatcher> |
-DataPipeProducerDispatcher::Deserialize(Channel* channel, |
- const void* source, |
- size_t size) { |
+RefPtr<DataPipeProducerDispatcher> DataPipeProducerDispatcher::Deserialize( |
+ Channel* channel, |
+ const void* source, |
+ size_t size) { |
RefPtr<DataPipe> data_pipe; |
if (!DataPipe::ProducerDeserialize(channel, source, size, &data_pipe)) |
return nullptr; |
DCHECK(data_pipe); |
- scoped_refptr<DataPipeProducerDispatcher> dispatcher = Create(); |
+ auto dispatcher = DataPipeProducerDispatcher::Create(); |
dispatcher->Init(std::move(data_pipe)); |
return dispatcher; |
} |
@@ -61,13 +61,13 @@ void DataPipeProducerDispatcher::CloseImplNoLock() { |
data_pipe_ = nullptr; |
} |
-scoped_refptr<Dispatcher> |
+RefPtr<Dispatcher> |
DataPipeProducerDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() { |
mutex().AssertHeld(); |
- scoped_refptr<DataPipeProducerDispatcher> rv = Create(); |
- rv->Init(std::move(data_pipe_)); |
- return scoped_refptr<Dispatcher>(rv.get()); |
+ auto dispatcher = DataPipeProducerDispatcher::Create(); |
+ dispatcher->Init(std::move(data_pipe_)); |
+ return dispatcher; |
} |
MojoResult DataPipeProducerDispatcher::WriteDataImplNoLock( |
@@ -126,7 +126,7 @@ void DataPipeProducerDispatcher::StartSerializeImplNoLock( |
Channel* channel, |
size_t* max_size, |
size_t* max_platform_handles) { |
- DCHECK(HasOneRef()); // Only one ref => no need to take the lock. |
+ AssertHasOneRef(); // Only one ref => no need to take the lock. |
data_pipe_->ProducerStartSerialize(channel, max_size, max_platform_handles); |
} |
@@ -135,7 +135,7 @@ bool DataPipeProducerDispatcher::EndSerializeAndCloseImplNoLock( |
void* destination, |
size_t* actual_size, |
embedder::PlatformHandleVector* platform_handles) { |
- DCHECK(HasOneRef()); // Only one ref => no need to take the lock. |
+ AssertHasOneRef(); // Only one ref => no need to take the lock. |
bool rv = data_pipe_->ProducerEndSerialize(channel, destination, actual_size, |
platform_handles); |