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 module presentation; | 5 module presentation; |
6 | 6 |
7 struct PresentationSessionInfo { | 7 struct PresentationSessionInfo { |
8 string url; | 8 string url; |
9 string id; | 9 string id; |
10 }; | 10 }; |
(...skipping 11 matching lines...) Expand all Loading... |
22 }; | 22 }; |
23 | 23 |
24 struct PresentationError { | 24 struct PresentationError { |
25 PresentationErrorType error_type; | 25 PresentationErrorType error_type; |
26 string message; | 26 string message; |
27 }; | 27 }; |
28 | 28 |
29 enum PresentationMessageType { | 29 enum PresentationMessageType { |
30 TEXT, | 30 TEXT, |
31 ARRAY_BUFFER, | 31 ARRAY_BUFFER, |
| 32 BLOB, |
32 }; | 33 }; |
33 | 34 |
34 struct SessionMessage { | 35 struct SessionMessage { |
35 string presentation_url; | 36 string presentation_url; |
36 string presentation_id; | 37 string presentation_id; |
37 PresentationMessageType type; | 38 PresentationMessageType type; |
| 39 // Used when message type is TEXT. |
38 string? message; | 40 string? message; |
| 41 // Used when message type is ARRAY_BUFFER or BLOB. |
39 array<uint8>? data; | 42 array<uint8>? data; |
40 }; | 43 }; |
41 | 44 |
42 interface PresentationService { | 45 interface PresentationService { |
43 // Called when the frame sets or changes the default presentation URL or | 46 // Called when the frame sets or changes the default presentation URL or |
44 // presentation ID. | 47 // presentation ID. |
45 SetDefaultPresentationURL( | 48 SetDefaultPresentationURL( |
46 string default_presentation_url, | 49 string default_presentation_url, |
47 string? default_presentation_id); | 50 string? default_presentation_id); |
48 | 51 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // Called when the frame is ready to process the next batch of messages. | 109 // Called when the frame is ready to process the next batch of messages. |
107 // When the callback carries null messages, there is an error | 110 // When the callback carries null messages, there is an error |
108 // at the presentation service side. | 111 // at the presentation service side. |
109 ListenForSessionMessages() | 112 ListenForSessionMessages() |
110 => (array<SessionMessage>? messages); | 113 => (array<SessionMessage>? messages); |
111 }; | 114 }; |
112 | 115 |
113 interface PresentationServiceClient { | 116 interface PresentationServiceClient { |
114 OnScreenAvailabilityUpdated(bool available); | 117 OnScreenAvailabilityUpdated(bool available); |
115 }; | 118 }; |
OLD | NEW |