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

Unified Diff: mojo/edk/system/channel.cc

Issue 1353683005: EDK: Convert remaining scoped_ptr -> std::unique_ptr in //mojo/edk/system. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « mojo/edk/system/channel.h ('k') | mojo/edk/system/channel_endpoint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/channel.cc
diff --git a/mojo/edk/system/channel.cc b/mojo/edk/system/channel.cc
index 8c184afa6286fe8633b088527217c39aac29cc53..e70ca216753608ae8f7486a1e0e881cc1bf5279f 100644
--- a/mojo/edk/system/channel.cc
+++ b/mojo/edk/system/channel.cc
@@ -125,7 +125,7 @@ void Channel::SetBootstrapEndpointWithIds(
endpoint->AttachAndRun(this, local_id, remote_id);
}
-bool Channel::WriteMessage(scoped_ptr<MessageInTransit> message) {
+bool Channel::WriteMessage(std::unique_ptr<MessageInTransit> message) {
MutexLocker locker(&mutex_);
if (!is_running_) {
// TODO(vtl): I think this is probably not an error condition, but I should
@@ -135,7 +135,7 @@ bool Channel::WriteMessage(scoped_ptr<MessageInTransit> message) {
}
DLOG_IF(WARNING, is_shutting_down_) << "WriteMessage() while shutting down";
- return raw_channel_->WriteMessage(message.Pass());
+ return raw_channel_->WriteMessage(std::move(message));
}
bool Channel::IsWriteBufferEmpty() {
@@ -391,7 +391,7 @@ void Channel::OnReadMessageForEndpoint(
return;
}
- scoped_ptr<MessageInTransit> message(new MessageInTransit(message_view));
+ std::unique_ptr<MessageInTransit> message(new MessageInTransit(message_view));
if (message_view.transport_data_buffer_size() > 0) {
DCHECK(message_view.transport_data_buffer());
message->SetDispatchers(TransportData::DeserializeDispatchers(
@@ -400,7 +400,7 @@ void Channel::OnReadMessageForEndpoint(
this));
}
- endpoint->OnReadMessage(message.Pass());
+ endpoint->OnReadMessage(std::move(message));
}
void Channel::OnReadMessageForChannel(
@@ -624,11 +624,11 @@ bool Channel::SendControlMessage(MessageInTransit::Subtype subtype,
const void* bytes) {
DVLOG(2) << "Sending channel control message: subtype " << subtype
<< ", local ID " << local_id << ", remote ID " << remote_id;
- scoped_ptr<MessageInTransit> message(new MessageInTransit(
+ std::unique_ptr<MessageInTransit> message(new MessageInTransit(
MessageInTransit::Type::CHANNEL, subtype, num_bytes, bytes));
message->set_source_id(local_id);
message->set_destination_id(remote_id);
- return WriteMessage(message.Pass());
+ return WriteMessage(std::move(message));
}
} // namespace system
« no previous file with comments | « mojo/edk/system/channel.h ('k') | mojo/edk/system/channel_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698