| 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_BROWSER_PRESENTATION_CONNECTION_MESSAGE_H_ | |
| 6 #define CONTENT_PUBLIC_BROWSER_PRESENTATION_CONNECTION_MESSAGE_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <memory> | |
| 11 #include <string> | |
| 12 #include <vector> | |
| 13 | |
| 14 #include "content/common/content_export.h" | |
| 15 | |
| 16 namespace content { | |
| 17 | |
| 18 enum PresentationMessageType { | |
| 19 TEXT, | |
| 20 BINARY, | |
| 21 }; | |
| 22 | |
| 23 // Represents a presentation connection message. | |
| 24 // If this is a text message, |data| is null; otherwise, |message| is null. | |
| 25 // Empty messages are allowed. | |
| 26 struct CONTENT_EXPORT PresentationConnectionMessage { | |
| 27 public: | |
| 28 explicit PresentationConnectionMessage(PresentationMessageType type); | |
| 29 ~PresentationConnectionMessage(); | |
| 30 | |
| 31 bool is_binary() const; | |
| 32 const PresentationMessageType type; | |
| 33 std::string message; | |
| 34 std::unique_ptr<std::vector<uint8_t>> data; | |
| 35 }; | |
| 36 | |
| 37 } // namespace content | |
| 38 | |
| 39 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_CONNECTION_MESSAGE_H_ | |
| OLD | NEW |