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 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 // session. If the default session is started by the embedder before this | 66 // session. If the default session is started by the embedder before this |
| 67 // call, the embedder may queue it and run the callback when the call is | 67 // call, the embedder may queue it and run the callback when the call is |
| 68 // performed. | 68 // performed. |
| 69 ListenForDefaultSessionStart() | 69 ListenForDefaultSessionStart() |
| 70 => (PresentationSessionInfo? defaultSessionInfo); | 70 => (PresentationSessionInfo? defaultSessionInfo); |
| 71 | 71 |
| 72 // Called when startSession() is called by the frame. The result callback | 72 // Called when startSession() is called by the frame. The result callback |
| 73 // will return a non-null and valid PresentationSessionInfo if starting the | 73 // will return a non-null and valid PresentationSessionInfo if starting the |
| 74 // session succeeded, or null with a PresentationError if starting the | 74 // session succeeded, or null with a PresentationError if starting the |
| 75 // session failed. | 75 // session failed. |
| 76 // The presentation id is always returned along with the initialized | 76 // The presentation id is always returned along with the initialized |
|
whywhat
2015/07/02 19:54:31
Perhaps, you should mention that the presentation
mlamouri (slow - plz ping)
2015/07/08 14:37:09
Done.
| |
| 77 // session on success. | 77 // session on success. |
| 78 // If the UA identifies a matching session (same presentation url and id), | 78 // If the UA identifies a matching session (same presentation url), the user |
| 79 // the user may choose this existing session and the page will join it | 79 // may choose this existing session and the page will join it rather than get |
| 80 // rather than get a new one. An empty presentation id means that the | 80 // a new one. |
| 81 // UA will generate the presentation id. | 81 StartSession(string presentation_url) |
| 82 StartSession(string presentation_url, string? presentation_id) | |
| 83 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 82 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
| 84 | 83 |
| 85 // Called when joinSession() is called by the frame. The result callback | 84 // Called when joinSession() is called by the frame. The result callback |
| 86 // works the same as for the method above. JoinSession will join a known | 85 // works the same as for the method above. JoinSession will join a known |
| 87 // session (i.e. when the page navigates or the user opens another tab) | 86 // session (i.e. when the page navigates or the user opens another tab) |
| 88 // silently and without user action. | 87 // silently and without user action. |
| 89 JoinSession(string presentation_url, string? presentation_id) | 88 JoinSession(string presentation_url, string? presentation_id) |
| 90 => (PresentationSessionInfo? sessionInfo, PresentationError? error); | 89 => (PresentationSessionInfo? sessionInfo, PresentationError? error); |
| 91 | 90 |
| 92 // Called when send() is called by the frame. The true in the | 91 // Called when send() is called by the frame. The true in the |
| 93 // result callback notifies that the service is ready for next message. | 92 // result callback notifies that the service is ready for next message. |
| 94 // The false in the result callback notifies the renderer to stop sending | 93 // The false in the result callback notifies the renderer to stop sending |
| 95 // the send requests and invalidate all pending requests. This occurs | 94 // the send requests and invalidate all pending requests. This occurs |
| 96 // for eg., when frame is deleted or navigated away. | 95 // for eg., when frame is deleted or navigated away. |
| 97 SendSessionMessage(SessionMessage message_request) => (bool success); | 96 SendSessionMessage(SessionMessage message_request) => (bool success); |
| 98 | 97 |
|
whywhat
2015/07/02 19:54:31
what's this diff?
mlamouri (slow - plz ping)
2015/07/08 14:37:09
Can't find that in my diff locally.
| |
| 99 // Called when closeSession() is called by the frame. | 98 // Called when closeSession() is called by the frame. |
| 100 CloseSession(string presentation_url, string presentation_id); | 99 CloseSession(string presentation_url, string presentation_id); |
| 101 | 100 |
| 102 // Called when the frame is ready to process the next state change. Returns | 101 // Called when the frame is ready to process the next state change. Returns |
| 103 // the last session state if it’s changed since the last time the callback | 102 // the last session state if it’s changed since the last time the callback |
| 104 // was called. Might cause the event fired with the initial state change. | 103 // was called. Might cause the event fired with the initial state change. |
| 105 ListenForSessionStateChange() | 104 ListenForSessionStateChange() |
| 106 => (PresentationSessionInfo sessionInfo, | 105 => (PresentationSessionInfo sessionInfo, |
| 107 PresentationSessionState newState); | 106 PresentationSessionState newState); |
| 108 | 107 |
| 109 // Called when the frame is ready to process the next batch of messages. | 108 // Called when the frame is ready to process the next batch of messages. |
| 110 // When the callback carries null messages, there is an error | 109 // When the callback carries null messages, there is an error |
| 111 // at the presentation service side. | 110 // at the presentation service side. |
| 112 ListenForSessionMessages() | 111 ListenForSessionMessages() |
| 113 => (array<SessionMessage>? messages); | 112 => (array<SessionMessage>? messages); |
| 114 }; | 113 }; |
| 115 | 114 |
| 116 interface PresentationServiceClient { | 115 interface PresentationServiceClient { |
| 117 OnScreenAvailabilityUpdated(bool available); | 116 OnScreenAvailabilityUpdated(bool available); |
| 118 }; | 117 }; |
| OLD | NEW |