Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: third_party/WebKit/public/platform/modules/presentation/presentation.mojom

Issue 2379703002: [Presentation API] (alternative) 1-UA: send message between controller and receiver page (Closed)
Patch Set: resolve code review comments from Mark Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 // TODO(crbug.com/647290): Rename "Session" to "Connection" 5 // TODO(crbug.com/647290): Rename "Session" to "Connection"
6 6
7 module blink.mojom; 7 module blink.mojom;
8 8
9 import "url/mojo/url.mojom"; 9 import "url/mojo/url.mojom";
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 }; 45 };
46 46
47 struct SessionMessage { 47 struct SessionMessage {
48 PresentationMessageType type; 48 PresentationMessageType type;
49 // Used when message type is TEXT. 49 // Used when message type is TEXT.
50 string? message; 50 string? message;
51 // Used when message type is ARRAY_BUFFER or BLOB. 51 // Used when message type is ARRAY_BUFFER or BLOB.
52 array<uint8>? data; 52 array<uint8>? data;
53 }; 53 };
54 54
55 interface PresentationConnection {
56 // Called to set the PresentationConnection interface that sends
mark a. foltz 2016/10/10 18:28:52 Called to set the PresentationConnection that is t
zhaobin 2016/10/12 02:27:34 Done.
57 // messages in the opposite direction.
58 SetTargetConnection(PresentationConnection connection);
59
60 // Called when connection.send() is invoked at the other end of the
mark a. foltz 2016/10/10 18:28:52 Called when a message is sent by the target connec
zhaobin 2016/10/12 02:27:34 Done.
61 // connection.
62 OnSessionMessageReceived(SessionMessage message);
mark a. foltz 2016/10/10 18:28:52 OnConnectionMessageReceived (we'll rename the para
zhaobin 2016/10/12 02:27:34 Done.
63 };
64
55 interface PresentationService { 65 interface PresentationService {
56 // Sets the PresentationServiceClient. 66 // Sets the PresentationServiceClient.
57 SetClient(PresentationServiceClient client); 67 SetClient(PresentationServiceClient client);
58 68
59 // Called when the frame sets or changes the default presentation URLs. 69 // Called when the frame sets or changes the default presentation URLs.
60 // When the default presentation is started on this frame, 70 // When the default presentation is started on this frame,
61 // PresentationServiceClient::OnDefaultSessionStarted will be invoked. 71 // PresentationServiceClient::OnDefaultSessionStarted will be invoked.
62 SetDefaultPresentationUrls(array<url.mojom.Url> presentation_urls); 72 SetDefaultPresentationUrls(array<url.mojom.Url> presentation_urls);
63 73
64 // Starts listening for screen availability for presentation of 74 // Starts listening for screen availability for presentation of
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 CloseConnection(url.mojom.Url presentation_url, string presentation_id); 112 CloseConnection(url.mojom.Url presentation_url, string presentation_id);
103 113
104 // Called when terminate() is called by the frame. 114 // Called when terminate() is called by the frame.
105 Terminate(url.mojom.Url presentation_url, string presentation_id); 115 Terminate(url.mojom.Url presentation_url, string presentation_id);
106 116
107 // Starts listening for messages for session with |sessionInfo|. 117 // Starts listening for messages for session with |sessionInfo|.
108 // Messages will be received in 118 // Messages will be received in
109 // PresentationServiceClient::OnSessionMessagesReceived. 119 // PresentationServiceClient::OnSessionMessagesReceived.
110 // This is called after a presentation session is created. 120 // This is called after a presentation session is created.
111 ListenForSessionMessages(PresentationSessionInfo sessionInfo); 121 ListenForSessionMessages(PresentationSessionInfo sessionInfo);
122
123 SetPresentationConnection(PresentationSessionInfo sessionInfo,
124 PresentationConnection connection);
112 }; 125 };
113 126
114 interface PresentationServiceClient { 127 interface PresentationServiceClient {
115 // Called when the client tries to listen for screen availability changes for 128 // Called when the client tries to listen for screen availability changes for
116 // presentation of |url| but it is not supported by the device or underlying 129 // presentation of |url| but it is not supported by the device or underlying
117 // platform. This can also be called if the device is currently in a mode 130 // platform. This can also be called if the device is currently in a mode
118 // where it can't do screen discoveries (eg. low battery). 131 // where it can't do screen discoveries (eg. low battery).
119 OnScreenAvailabilityNotSupported(url.mojom.Url url); 132 OnScreenAvailabilityNotSupported(url.mojom.Url url);
120 133
121 // Called when the client is listening for screen availability for 134 // Called when the client is listening for screen availability for
(...skipping 13 matching lines...) Expand all
135 PresentationConnectionCloseReason reason, 148 PresentationConnectionCloseReason reason,
136 string message); 149 string message);
137 150
138 // See PresentationService::ListenForSessionMessages. 151 // See PresentationService::ListenForSessionMessages.
139 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, 152 OnSessionMessagesReceived(PresentationSessionInfo sessionInfo,
140 array<SessionMessage> messages); 153 array<SessionMessage> messages);
141 154
142 // See PresentationService::SetDefaultPresentationURL. 155 // See PresentationService::SetDefaultPresentationURL.
143 OnDefaultSessionStarted(PresentationSessionInfo sessionInfo); 156 OnDefaultSessionStarted(PresentationSessionInfo sessionInfo);
144 157
145 // See PresentationService::ListeningForReceiverPageRendered. 158 // See PresentationService::ListeningForReceiverPageRendered.
mark a. foltz 2016/10/10 18:28:53 Can you describe the meaning of this here? e.g.
zhaobin 2016/10/12 02:27:34 Done.
146 OnReceiverConnectionAvailable(PresentationSessionInfo sessionInfo); 159 OnReceiverConnectionAvailable(PresentationSessionInfo sessionInfo,
160 PresentationConnection connection);
147 }; 161 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698