| 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 #include "components/proximity_auth/messenger_impl.h" | 5 #include "components/proximity_auth/messenger_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/base64url.h" | 9 #include "base/base64url.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 base::DictionaryValue message; | 147 base::DictionaryValue message; |
| 148 message.SetString(kTypeKey, kMessageTypeUnlockRequest); | 148 message.SetString(kTypeKey, kMessageTypeUnlockRequest); |
| 149 queued_messages_.push_back(PendingMessage(message)); | 149 queued_messages_.push_back(PendingMessage(message)); |
| 150 ProcessMessageQueue(); | 150 ProcessMessageQueue(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 cryptauth::SecureContext* MessengerImpl::GetSecureContext() const { | 153 cryptauth::SecureContext* MessengerImpl::GetSecureContext() const { |
| 154 return secure_context_.get(); | 154 return secure_context_.get(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 cryptauth::Connection* MessengerImpl::GetConnection() const { |
| 158 return connection_.get(); |
| 159 } |
| 160 |
| 157 MessengerImpl::PendingMessage::PendingMessage() {} | 161 MessengerImpl::PendingMessage::PendingMessage() {} |
| 158 | 162 |
| 159 MessengerImpl::PendingMessage::PendingMessage( | 163 MessengerImpl::PendingMessage::PendingMessage( |
| 160 const base::DictionaryValue& message) | 164 const base::DictionaryValue& message) |
| 161 : json_message(SerializeValueToJson(message)), | 165 : json_message(SerializeValueToJson(message)), |
| 162 type(GetMessageType(message)) {} | 166 type(GetMessageType(message)) {} |
| 163 | 167 |
| 164 MessengerImpl::PendingMessage::PendingMessage(const std::string& message) | 168 MessengerImpl::PendingMessage::PendingMessage(const std::string& message) |
| 165 : json_message(message), type(std::string()) {} | 169 : json_message(message), type(std::string()) {} |
| 166 | 170 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 } else { | 365 } else { |
| 362 PA_LOG(ERROR) << "Message of unknown type '" << pending_message_->type | 366 PA_LOG(ERROR) << "Message of unknown type '" << pending_message_->type |
| 363 << "' sent."; | 367 << "' sent."; |
| 364 } | 368 } |
| 365 | 369 |
| 366 pending_message_.reset(); | 370 pending_message_.reset(); |
| 367 ProcessMessageQueue(); | 371 ProcessMessageQueue(); |
| 368 } | 372 } |
| 369 | 373 |
| 370 } // namespace proximity_auth | 374 } // namespace proximity_auth |
| OLD | NEW |