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

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

Issue 1547233002: Convert Pass()→std::move() in //google_apis (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "google_apis/gcm/base/mcs_util.h" 10 #include "google_apis/gcm/base/mcs_util.h"
9 #include "net/socket/stream_socket.h" 11 #include "net/socket/stream_socket.h"
10 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
11 13
12 namespace gcm { 14 namespace gcm {
13 15
14 namespace { 16 namespace {
15 17
16 // Build a basic login response. 18 // Build a basic login response.
17 scoped_ptr<google::protobuf::MessageLite> BuildLoginResponse(bool fail_login) { 19 scoped_ptr<google::protobuf::MessageLite> BuildLoginResponse(bool fail_login) {
18 scoped_ptr<mcs_proto::LoginResponse> login_response( 20 scoped_ptr<mcs_proto::LoginResponse> login_response(
19 new mcs_proto::LoginResponse()); 21 new mcs_proto::LoginResponse());
20 login_response->set_id("id"); 22 login_response->set_id("id");
21 if (fail_login) 23 if (fail_login)
22 login_response->mutable_error()->set_code(1); 24 login_response->mutable_error()->set_code(1);
23 return login_response.Pass(); 25 return std::move(login_response);
24 } 26 }
25 27
26 } // namespace 28 } // namespace
27 29
28 FakeConnectionHandler::FakeConnectionHandler( 30 FakeConnectionHandler::FakeConnectionHandler(
29 const ConnectionHandler::ProtoReceivedCallback& read_callback, 31 const ConnectionHandler::ProtoReceivedCallback& read_callback,
30 const ConnectionHandler::ProtoSentCallback& write_callback) 32 const ConnectionHandler::ProtoSentCallback& write_callback)
31 : read_callback_(read_callback), 33 : read_callback_(read_callback),
32 write_callback_(write_callback), 34 write_callback_(write_callback),
33 fail_login_(false), 35 fail_login_(false),
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 86
85 bool FakeConnectionHandler::AllOutgoingMessagesReceived() const { 87 bool FakeConnectionHandler::AllOutgoingMessagesReceived() const {
86 return expected_outgoing_messages_.empty(); 88 return expected_outgoing_messages_.empty();
87 } 89 }
88 90
89 void FakeConnectionHandler::ReceiveMessage(const MCSMessage& message) { 91 void FakeConnectionHandler::ReceiveMessage(const MCSMessage& message) {
90 read_callback_.Run(message.CloneProtobuf()); 92 read_callback_.Run(message.CloneProtobuf());
91 } 93 }
92 94
93 } // namespace gcm 95 } // namespace gcm
OLDNEW
« no previous file with comments | « google_apis/gcm/engine/connection_handler_impl_unittest.cc ('k') | google_apis/gcm/engine/gcm_store_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698