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

Side by Side Diff: google_apis/gcm/engine/fake_connection_handler.cc

Issue 1873663002: Convert //google_apis from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "google_apis/gcm/engine/fake_connection_handler.h" 5 #include "google_apis/gcm/engine/fake_connection_handler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "google_apis/gcm/base/mcs_util.h" 10 #include "google_apis/gcm/base/mcs_util.h"
11 #include "net/socket/stream_socket.h" 11 #include "net/socket/stream_socket.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 13
14 namespace gcm { 14 namespace gcm {
15 15
16 namespace { 16 namespace {
17 17
18 // Build a basic login response. 18 // Build a basic login response.
19 scoped_ptr<google::protobuf::MessageLite> BuildLoginResponse(bool fail_login) { 19 std::unique_ptr<google::protobuf::MessageLite> BuildLoginResponse(
20 scoped_ptr<mcs_proto::LoginResponse> login_response( 20 bool fail_login) {
21 std::unique_ptr<mcs_proto::LoginResponse> login_response(
21 new mcs_proto::LoginResponse()); 22 new mcs_proto::LoginResponse());
22 login_response->set_id("id"); 23 login_response->set_id("id");
23 if (fail_login) 24 if (fail_login)
24 login_response->mutable_error()->set_code(1); 25 login_response->mutable_error()->set_code(1);
25 return std::move(login_response); 26 return std::move(login_response);
26 } 27 }
27 28
28 } // namespace 29 } // namespace
29 30
30 FakeConnectionHandler::FakeConnectionHandler( 31 FakeConnectionHandler::FakeConnectionHandler(
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 87
87 bool FakeConnectionHandler::AllOutgoingMessagesReceived() const { 88 bool FakeConnectionHandler::AllOutgoingMessagesReceived() const {
88 return expected_outgoing_messages_.empty(); 89 return expected_outgoing_messages_.empty();
89 } 90 }
90 91
91 void FakeConnectionHandler::ReceiveMessage(const MCSMessage& message) { 92 void FakeConnectionHandler::ReceiveMessage(const MCSMessage& message) {
92 read_callback_.Run(message.CloneProtobuf()); 93 read_callback_.Run(message.CloneProtobuf());
93 } 94 }
94 95
95 } // namespace gcm 96 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698