| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MESSENGER_IMPL_H | 5 #ifndef COMPONENTS_PROXIMITY_AUTH_MESSENGER_IMPL_H |
| 6 #define COMPONENTS_PROXIMITY_AUTH_MESSENGER_IMPL_H | 6 #define COMPONENTS_PROXIMITY_AUTH_MESSENGER_IMPL_H |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 protected: | 48 protected: |
| 49 SecureContext* secure_context() { return secure_context_.get(); } | 49 SecureContext* secure_context() { return secure_context_.get(); } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 // Internal data structure to represent a pending message that either hasn't | 52 // Internal data structure to represent a pending message that either hasn't |
| 53 // been sent yet or is waiting for a response from the remote device. | 53 // been sent yet or is waiting for a response from the remote device. |
| 54 struct PendingMessage { | 54 struct PendingMessage { |
| 55 PendingMessage(); | 55 PendingMessage(); |
| 56 PendingMessage(const base::DictionaryValue& message); | 56 PendingMessage(const base::DictionaryValue& message); |
| 57 PendingMessage(const std::string& message); |
| 57 ~PendingMessage(); | 58 ~PendingMessage(); |
| 58 | 59 |
| 59 // The message, serialized as JSON. | 60 // The message, serialized as JSON. |
| 60 const std::string json_message; | 61 const std::string json_message; |
| 61 | 62 |
| 62 // The message type. This is possible to parse from the |json_message|; it's | 63 // The message type. This is possible to parse from the |json_message|; it's |
| 63 // stored redundantly for convenience. | 64 // stored redundantly for convenience. |
| 64 const std::string type; | 65 const std::string type; |
| 65 }; | 66 }; |
| 66 | 67 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 scoped_ptr<PendingMessage> pending_message_; | 118 scoped_ptr<PendingMessage> pending_message_; |
| 118 | 119 |
| 119 base::WeakPtrFactory<MessengerImpl> weak_ptr_factory_; | 120 base::WeakPtrFactory<MessengerImpl> weak_ptr_factory_; |
| 120 | 121 |
| 121 DISALLOW_COPY_AND_ASSIGN(MessengerImpl); | 122 DISALLOW_COPY_AND_ASSIGN(MessengerImpl); |
| 122 }; | 123 }; |
| 123 | 124 |
| 124 } // namespace proximity_auth | 125 } // namespace proximity_auth |
| 125 | 126 |
| 126 #endif // COMPONENTS_PROXIMITY_AUTH_MESSENGER_IMPL_H | 127 #endif // COMPONENTS_PROXIMITY_AUTH_MESSENGER_IMPL_H |
| OLD | NEW |