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

Unified Diff: content/common/presentation/presentation_service.mojom

Issue 1259073004: [Presentation API] Change ListenForSessionMessages API to client-style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: content/common/presentation/presentation_service.mojom
diff --git a/content/common/presentation/presentation_service.mojom b/content/common/presentation/presentation_service.mojom
index 18cb24c902f5ab9392fd2bf6735a63fbb34ca410..ae0126dfac9ba9c7412f831cc51fa422099daddb 100644
--- a/content/common/presentation/presentation_service.mojom
+++ b/content/common/presentation/presentation_service.mojom
@@ -33,8 +33,6 @@ enum PresentationMessageType {
};
struct SessionMessage {
- string presentation_url;
- string presentation_id;
PresentationMessageType type;
// Used when message type is TEXT.
string? message;
@@ -90,7 +88,7 @@ interface PresentationService {
// The false in the result callback notifies the renderer to stop sending
// the send requests and invalidate all pending requests. This occurs
// for eg., when frame is deleted or navigated away.
- SendSessionMessage(SessionMessage message_request) => (bool success);
+ SendSessionMessage(PresentationSessionInfo sessionInfo, SessionMessage message_request) => (bool success);
// Called when closeSession() is called by the frame.
CloseSession(string presentation_url, string presentation_id);
@@ -98,13 +96,14 @@ interface PresentationService {
// Starts listening for state changes for sessions created on this frame.
// When state change occurs, PresentationServiceClient::OnSessionStateChanged
// will be invoked with the session and its new state.
+ // This is called after a presentation session is created.
ListenForSessionStateChange();
- // Called when the frame is ready to process the next batch of messages.
- // When the callback carries null messages, there is an error
- // at the presentation service side.
- ListenForSessionMessages()
- => (array<SessionMessage>? messages);
+ // Starts listening for messages for session with |sessionInfo|.
+ // Messages will be received in
+ // PresentationServiceClient::OnSessionMessagesReceived.
+ // This is called after a presentation session is created.
+ ListenForSessionMessages(PresentationSessionInfo sessionInfo);
};
interface PresentationServiceClient {
@@ -123,4 +122,7 @@ interface PresentationServiceClient {
// See PresentationService::ListenForSessionStateChange.
OnSessionStateChanged(PresentationSessionInfo sessionInfo,
PresentationSessionState newState);
+
+ // See PresentationService::ListenForSessionMessages.
+ OnSessionMessagesReceived(PresentationSessionInfo sessionInfo, array<SessionMessage> messages);
};

Powered by Google App Engine
This is Rietveld 408576698