OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/proximity_auth/fake_connection.h" | 5 #include "components/proximity_auth/fake_connection.h" |
6 | 6 |
7 #include "components/proximity_auth/wire_message.h" | 7 #include "components/proximity_auth/wire_message.h" |
8 | 8 |
9 namespace proximity_auth { | 9 namespace proximity_auth { |
10 | 10 |
11 FakeConnection::FakeConnection(const RemoteDevice& remote_device) | 11 FakeConnection::FakeConnection(const RemoteDevice& remote_device) |
12 : Connection(RemoteDevice()) { | 12 : Connection(remote_device) { |
13 Connect(); | 13 Connect(); |
14 } | 14 } |
15 | 15 |
16 FakeConnection::~FakeConnection() { | 16 FakeConnection::~FakeConnection() { |
17 Disconnect(); | 17 Disconnect(); |
18 } | 18 } |
19 | 19 |
20 void FakeConnection::Connect() { | 20 void FakeConnection::Connect() { |
21 SetStatus(CONNECTED); | 21 SetStatus(CONNECTED); |
22 } | 22 } |
(...skipping 21 matching lines...) Expand all Loading... |
44 current_message_ = message.Pass(); | 44 current_message_ = message.Pass(); |
45 } | 45 } |
46 | 46 |
47 scoped_ptr<WireMessage> FakeConnection::DeserializeWireMessage( | 47 scoped_ptr<WireMessage> FakeConnection::DeserializeWireMessage( |
48 bool* is_incomplete_message) { | 48 bool* is_incomplete_message) { |
49 *is_incomplete_message = false; | 49 *is_incomplete_message = false; |
50 return make_scoped_ptr(new WireMessage(pending_payload_)); | 50 return make_scoped_ptr(new WireMessage(pending_payload_)); |
51 } | 51 } |
52 | 52 |
53 } // namespace proximity_auth | 53 } // namespace proximity_auth |
OLD | NEW |