Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CONTENT_PUBLIC_BROWSER_PRESENTATION_CONNECTION_MESSAGE_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_PRESENTATION_CONNECTION_MESSAGE_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_PRESENTATION_CONNECTION_MESSAGE_H_ | 6 #define CONTENT_PUBLIC_COMMON_PRESENTATION_CONNECTION_MESSAGE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 enum PresentationMessageType { | 18 enum PresentationMessageType { |
| 19 TEXT, | 19 TEXT, |
| 20 BINARY, | 20 BINARY, |
| 21 }; | 21 }; |
| 22 | 22 |
| 23 // Represents a presentation connection message. | 23 // Represents a presentation connection message. |
| 24 // If this is a text message, |data| is null; otherwise, |message| is null. | 24 // If this is a text message, |data| is null; otherwise, |message| is null. |
| 25 // Empty messages are allowed. | 25 // Empty messages are allowed. |
| 26 struct CONTENT_EXPORT PresentationConnectionMessage { | 26 struct CONTENT_EXPORT PresentationConnectionMessage { |
|
nasko
2017/01/09 23:53:01
Can this really be used both from the browser and
| |
| 27 public: | 27 public: |
| 28 explicit PresentationConnectionMessage(PresentationMessageType type); | 28 explicit PresentationConnectionMessage(PresentationMessageType type); |
| 29 ~PresentationConnectionMessage(); | 29 ~PresentationConnectionMessage(); |
| 30 | 30 |
| 31 bool is_binary() const; | 31 bool is_binary() const; |
| 32 const PresentationMessageType type; | 32 const PresentationMessageType type; |
| 33 std::string message; | 33 std::string message; |
| 34 std::unique_ptr<std::vector<uint8_t>> data; | 34 std::unique_ptr<std::vector<uint8_t>> data; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 } // namespace content | 37 } // namespace content |
| 38 | 38 |
| 39 #endif // CONTENT_PUBLIC_BROWSER_PRESENTATION_CONNECTION_MESSAGE_H_ | 39 #endif // CONTENT_PUBLIC_COMMON_PRESENTATION_CONNECTION_MESSAGE_H_ |
| OLD | NEW |