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

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

Issue 935083002: [PresentationAPI] Implementing start/joinSession from WebPresentationClient to PresentationService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: is_null() checks for StructPtr's instead of get() Created 5 years, 10 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 2ff381a41cb5d2f7affb681cf2cc65dfddadd909..a82ba591b95bdd2f34ddd4dd68dc6a8a72653088 100644
--- a/content/common/presentation/presentation_service.mojom
+++ b/content/common/presentation/presentation_service.mojom
@@ -4,6 +4,19 @@
module presentation;
+import "presentation_session.mojom";
+
+struct PresentationSessionInfo {
+ PresentationSession session;
+ string url;
+ string id;
+};
+
+struct PresentationError {
+ int32 errorCode;
mlamouri (slow - plz ping) 2015/02/23 14:07:39 Could you have an enum called PresentationErroryTy
whywhat 2015/02/25 14:12:41 Done.
+ string message;
+};
+
interface PresentationService {
// Returns the last screen availability state if it’s changed since the last
// time the method was called. The client has to call this method again when
@@ -18,4 +31,24 @@ interface PresentationService {
// Called when the frame no longer listens to the
// |availablechange| event.
OnScreenAvailabilityListenerRemoved();
+
+ // Called when startSession() is called by the frame. The result callback
+ // will return a non-null PresentationSessionInfo if starting the session
+ // succeeded (so the session object is valid) or an error message if
+ // starting the session failed.
+ // The presentation id is always returned along with the initialized
+ // session on success.
+ // If the UA identifies a matching session (same presentation url and id),
+ // the user may choose this existing session and the page will join it
+ // rather than get a new one. An empty presentation id means that the
+ // UA will generate the presentation id.
+ StartSession(string presentation_url, string? presentation_id) => (
+ PresentationSessionInfo? sessionInfo, PresentationError? error);
mlamouri (slow - plz ping) 2015/02/23 14:07:39 nit: this looks more readable: StartSession(string
whywhat 2015/02/25 14:12:41 Done.
+
+ // Called when joinSession() is called by the frame. The result callback
+ // works the same as for the method above. JoinSession is used to silently
+ // (no user action needed) join a known session (i.e. when the page
+ // navigates or the user opens another tab).
+ JoinSession(string presentation_url, string? presentation_id) => (
+ PresentationSessionInfo? sessionInfo, PresentationError? error);
mlamouri (slow - plz ping) 2015/02/23 14:07:39 ditto
whywhat 2015/02/25 14:12:41 Done.
};

Powered by Google App Engine
This is Rietveld 408576698