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 #ifndef COMPONENTS_PROXIMITY_AUTH_FAKE_CONNECTION_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_FAKE_CONNECTION_H |
6 #define COMPONENTS_PROXIMITY_AUTH_FAKE_CONNECTION_H | 6 #define COMPONENTS_PROXIMITY_AUTH_FAKE_CONNECTION_H |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "components/proximity_auth/connection.h" | 9 #include "components/proximity_auth/connection.h" |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 // container WireMessage format. | 27 // container WireMessage format. |
28 void ReceiveMessageWithPayload(const std::string& payload); | 28 void ReceiveMessageWithPayload(const std::string& payload); |
29 | 29 |
30 // Returns the current message in progress of being sent. | 30 // Returns the current message in progress of being sent. |
31 WireMessage* current_message() { return current_message_.get(); } | 31 WireMessage* current_message() { return current_message_.get(); } |
32 | 32 |
33 using Connection::SetStatus; | 33 using Connection::SetStatus; |
34 | 34 |
35 private: | 35 private: |
36 // Connection: | 36 // Connection: |
37 void SendMessageImpl(scoped_ptr<WireMessage> message) override; | 37 void SendMessageImpl(std::unique_ptr<WireMessage> message) override; |
38 scoped_ptr<WireMessage> DeserializeWireMessage( | 38 std::unique_ptr<WireMessage> DeserializeWireMessage( |
39 bool* is_incomplete_message) override; | 39 bool* is_incomplete_message) override; |
40 | 40 |
41 // The message currently being sent. Only set between a call to | 41 // The message currently being sent. Only set between a call to |
42 // SendMessageImpl() and FinishSendingMessageWithSuccess(). | 42 // SendMessageImpl() and FinishSendingMessageWithSuccess(). |
43 scoped_ptr<WireMessage> current_message_; | 43 std::unique_ptr<WireMessage> current_message_; |
44 | 44 |
45 // The payload that should be returned when DeserializeWireMessage() is | 45 // The payload that should be returned when DeserializeWireMessage() is |
46 // called. | 46 // called. |
47 std::string pending_payload_; | 47 std::string pending_payload_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(FakeConnection); | 49 DISALLOW_COPY_AND_ASSIGN(FakeConnection); |
50 }; | 50 }; |
51 | 51 |
52 } // namespace proximity_auth | 52 } // namespace proximity_auth |
53 | 53 |
54 #endif // COMPONENTS_PROXIMITY_AUTH_FAKE_CONNECTION_H | 54 #endif // COMPONENTS_PROXIMITY_AUTH_FAKE_CONNECTION_H |
OLD | NEW |