| 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/wire_message.h" | 5 #include "components/proximity_auth/wire_message.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 std::string payload; | 105 std::string payload; |
| 106 if (!base::Base64Decode(payload_base64, &payload)) { | 106 if (!base::Base64Decode(payload_base64, &payload)) { |
| 107 VLOG(1) << "Error: Invalid base64 encoding for payload."; | 107 VLOG(1) << "Error: Invalid base64 encoding for payload."; |
| 108 return scoped_ptr<WireMessage>(); | 108 return scoped_ptr<WireMessage>(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 return scoped_ptr<WireMessage>(new WireMessage(permit_id, payload)); | 111 return scoped_ptr<WireMessage>(new WireMessage(permit_id, payload)); |
| 112 } | 112 } |
| 113 | 113 |
| 114 std::string WireMessage::Serialize() const { |
| 115 // TODO(isherman): Implement. |
| 116 return "This method is not yet implemented."; |
| 117 } |
| 118 |
| 114 WireMessage::WireMessage(const std::string& permit_id, | 119 WireMessage::WireMessage(const std::string& permit_id, |
| 115 const std::string& payload) | 120 const std::string& payload) |
| 116 : permit_id_(permit_id), | 121 : permit_id_(permit_id), |
| 117 payload_(payload) { | 122 payload_(payload) { |
| 118 } | 123 } |
| 119 | 124 |
| 120 } // namespace proximity_auth | 125 } // namespace proximity_auth |
| OLD | NEW |