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

Side by Side Diff: ppapi/proxy/resource_message_test_sink.cc

Issue 1864293002: Convert //ppapi to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more nullptr Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « ppapi/proxy/resource_message_test_sink.h ('k') | ppapi/proxy/serialized_var.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/proxy/resource_message_test_sink.h" 5 #include "ppapi/proxy/resource_message_test_sink.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <tuple> 9 #include <tuple>
10 10
(...skipping 30 matching lines...) Expand all
41 } // namespace 41 } // namespace
42 42
43 ResourceMessageTestSink::ResourceMessageTestSink() { 43 ResourceMessageTestSink::ResourceMessageTestSink() {
44 } 44 }
45 45
46 ResourceMessageTestSink::~ResourceMessageTestSink() { 46 ResourceMessageTestSink::~ResourceMessageTestSink() {
47 } 47 }
48 48
49 bool ResourceMessageTestSink::Send(IPC::Message* msg) { 49 bool ResourceMessageTestSink::Send(IPC::Message* msg) {
50 int message_id = 0; 50 int message_id = 0;
51 scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer; 51 std::unique_ptr<IPC::MessageReplyDeserializer> reply_deserializer;
52 if (msg->is_sync()) { 52 if (msg->is_sync()) {
53 reply_deserializer.reset( 53 reply_deserializer.reset(
54 static_cast<IPC::SyncMessage*>(msg)->GetReplyDeserializer()); 54 static_cast<IPC::SyncMessage*>(msg)->GetReplyDeserializer());
55 message_id = IPC::SyncMessage::GetMessageId(*msg); 55 message_id = IPC::SyncMessage::GetMessageId(*msg);
56 } 56 }
57 bool result = IPC::TestSink::Send(msg); // Deletes |msg|. 57 bool result = IPC::TestSink::Send(msg); // Deletes |msg|.
58 if (sync_reply_msg_.get()) { 58 if (sync_reply_msg_.get()) {
59 // |sync_reply_msg_| should always be a reply to the pending sync message. 59 // |sync_reply_msg_| should always be a reply to the pending sync message.
60 DCHECK(IPC::SyncMessage::IsMessageReplyTo(*sync_reply_msg_.get(), 60 DCHECK(IPC::SyncMessage::IsMessageReplyTo(*sync_reply_msg_.get(),
61 message_id)); 61 message_id));
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 wrapper_reply_msg, reply_params, reply_msg_); 147 wrapper_reply_msg, reply_params, reply_msg_);
148 test_sink_->SetSyncReplyMessage(wrapper_reply_msg); 148 test_sink_->SetSyncReplyMessage(wrapper_reply_msg);
149 149
150 // Stash a copy of the message for inspection later. 150 // Stash a copy of the message for inspection later.
151 last_handled_msg_ = call_msg; 151 last_handled_msg_ = call_msg;
152 return true; 152 return true;
153 } 153 }
154 154
155 } // namespace proxy 155 } // namespace proxy
156 } // namespace ppapi 156 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/resource_message_test_sink.h ('k') | ppapi/proxy/serialized_var.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698