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_SESSION_MESSAGE_H_ | |
6 #define CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_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 ARRAY_BUFFER, | |
21 BLOB, | |
22 }; | |
23 | |
24 // Represents a presentation session message. | |
25 // If this is a text message, |data| is null; otherwise, |message| is null. | |
26 // Empty messages are allowed. | |
27 struct CONTENT_EXPORT PresentationSessionMessage { | |
28 public: | |
29 explicit PresentationSessionMessage(PresentationMessageType type); | |
30 ~PresentationSessionMessage(); | |
31 | |
32 bool is_binary() const; | |
33 const PresentationMessageType type; | |
34 std::string message; | |
35 std::unique_ptr<std::vector<uint8_t>> data; | |
36 }; | |
37 | |
38 } // namespace content | |
39 | |
40 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_SESSION_H_ | |
OLD | NEW |