diff options
author | imcheng <imcheng@google.com> | 2015-08-06 18:00:14 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-07 01:01:39 +0000 |
commit | a0b6dc9205a195a4fa8c52a71fa1cb2ae8abb591 (patch) | |
tree | d14fc535a1efb5d7667b496920e6a82926f42497 /chrome/browser/media/router/create_presentation_session_request.h | |
parent | bb1fa29f61337a14332e6a038b6b09f23d8098b5 (diff) | |
download | chromium_src-a0b6dc9205a195a4fa8c52a71fa1cb2ae8abb591.zip chromium_src-a0b6dc9205a195a4fa8c52a71fa1cb2ae8abb591.tar.gz chromium_src-a0b6dc9205a195a4fa8c52a71fa1cb2ae8abb591.tar.bz2 |
[Presentation API] Change ListenForSessionMessages API to observers.
ListenForSessionMessages is now observer style and listens for a single
presentation as opposed to all sessions in that frame.
This change also separate presentation url / id from the
various SessionMessage structs from presentation mojom / content.
Now SendSessionMessage / ListenForSessionMessages must pass in an
explicit PresentationSessionInfo. Doing this allows us to avoid parsing
presenation url/id from route id for presentation session - MediaRoute
association, because previously we would have to fill out the url/id
field of content::PresentationSessionMessage struct and there was no
good way to do it without parsing. Now we simply bind the
PresentationSessionInfo to the callback that receives the messages.
Removing the pres url/id from the message struct also avoids
duplication when sending a batch of messages for the same session.
Added PresentationSessionMessagesObserver class and MediaRouter API
to implement the observer style API. MediaRouterMojoImpl contains
logic to adapt the observer stlye API to the getNext style API for
listening for route messages from the Media Route Provider.
Another change that were needed to completely remove the route id
parsing logic is to invoke MediaRouteResponseCallbacks with the
resulting presentation id generated by MediaRouter. This is needed
due to browser-initiated presentations where the presentation id is
not known in advance.
BUG=510297,510267
Review URL: https://codereview.chromium.org/1259073004
Cr-Commit-Position: refs/heads/master@{#342249}
Diffstat (limited to 'chrome/browser/media/router/create_presentation_session_request.h')
-rw-r--r-- | chrome/browser/media/router/create_presentation_session_request.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/chrome/browser/media/router/create_presentation_session_request.h b/chrome/browser/media/router/create_presentation_session_request.h index a6e4281..3b076fd 100644 --- a/chrome/browser/media/router/create_presentation_session_request.h +++ b/chrome/browser/media/router/create_presentation_session_request.h @@ -53,7 +53,8 @@ class CreatePresentationSessionRequest { // Invokes |success_cb_| or |error_cb_| with the given arguments. // These functions can only be invoked once per instance. Further invocations // are no-op. - void MaybeInvokeSuccessCallback(const MediaRoute::Id& route_id); + void MaybeInvokeSuccessCallback(const std::string& presentation_id, + const MediaRoute::Id& route_id); void MaybeInvokeErrorCallback(const content::PresentationError& error); private: |