Chromium Code Reviews| Index: components/cryptauth/wire_message.h |
| diff --git a/components/cryptauth/wire_message.h b/components/cryptauth/wire_message.h |
| index 2ab1db9a17968935546d09e97a04c4ea5ce4b3d0..5aed96d970ce5c653c6a8d58cf01c68520b91fae 100644 |
| --- a/components/cryptauth/wire_message.h |
| +++ b/components/cryptauth/wire_message.h |
| @@ -16,6 +16,11 @@ class WireMessage { |
| public: |
| // Creates a WireMessage containing |payload| for feature |feature|. |
| explicit WireMessage(const std::string& payload, const std::string& feature); |
| + |
| + // Creates a WireMessage containing |body| (a serialized JSON) as the message |
| + // body. |
| + explicit WireMessage(const std::string& body); |
|
Tim Song
2017/04/28 05:32:20
I think it's cleaner to subclass WireMessage (i.e.
sacomoto
2017/04/28 06:59:01
Discussed offline.
|
| + |
| virtual ~WireMessage(); |
| // Returns the deserialized message from |serialized_message|, or nullptr if |
| @@ -32,6 +37,7 @@ class WireMessage { |
| const std::string& payload() const { return payload_; } |
| const std::string& feature() const { return feature_; } |
| + const std::string& body() const { return body_; } |
| private: |
| // The message payload. |
| @@ -41,6 +47,10 @@ class WireMessage { |
| // EasyUnlock). |
| const std::string feature_; |
| + // The message body. When this is set |payload_| and |feature_| are empty, and |
| + // vice-versa. |
| + const std::string body_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(WireMessage); |
| }; |