Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_PUBLIC_COMMON_MESSAGE_PORT_MESSAGE_H_ | |
| 6 #define CONTENT_PUBLIC_COMMON_MESSAGE_PORT_MESSAGE_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/strings/string16.h" | |
| 11 #include "base/values.h" | |
| 12 | |
| 13 namespace content { | |
| 14 | |
| 15 // Struct representing a message sent across a message port. This struct hides | |
| 16 // the fact that messages can be serialized/encoded in multiple ways from code | |
| 17 // that doesn't care about the message contents. | |
| 18 struct MessagePortMessage { | |
| 19 MessagePortMessage(); | |
| 20 explicit MessagePortMessage(const base::string16& message); | |
| 21 explicit MessagePortMessage(const base::Value* message); | |
|
scheib
2015/02/18 21:03:23
Perhaps just take ownership of the message object
Marijn Kruisselbrink
2015/02/26 23:12:54
Done.
| |
| 22 MessagePortMessage(const MessagePortMessage& other); | |
| 23 MessagePortMessage& operator=(const MessagePortMessage& other); | |
| 24 ~MessagePortMessage(); | |
| 25 | |
| 26 // Message serialized using blink::WebSerializedScriptValue. Only one of | |
| 27 // |message_as_string| and |message_as_value| should be non-empty. | |
| 28 base::string16 message_as_string; | |
| 29 // Message as a base::Value. This is either an empty list or a list | |
| 30 // containing exactly one item. | |
| 31 base::ListValue message_as_value; | |
| 32 }; | |
| 33 | |
| 34 } // namespace content | |
| 35 | |
| 36 #endif // CONTENT_PUBLIC_COMMON_MESSAGE_PORT_MESSAGE_H_ | |
| OLD | NEW |