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

Issue 1259073004: [Presentation API] Change ListenForSessionMessages API to client-style. (Closed)

Created:
5 years, 4 months ago by imcheng (use chromium acct)
Modified:
5 years, 4 months ago
CC:
mark a. foltz, Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, darin (slow to review), darin-cc_chromium.org, extensions-reviews_chromium.org, feature-media-reviews_chromium.org, jam, mcasas+watch_chromium.org, media-router+watch_chromium.org, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, wjia+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[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 Committed: https://crrev.com/a0b6dc9205a195a4fa8c52a71fa1cb2ae8abb591 Cr-Commit-Position: refs/heads/master@{#342249}

Patch Set 1 #

Patch Set 2 : Fixed tests #

Patch Set 3 : Compile fix #

Total comments: 16

Patch Set 4 : Addressed Haibin's comments #

Patch Set 5 : Rebase #

Total comments: 32

Patch Set 6 : Addressed comments #

Patch Set 7 : add cr bug comment #

Patch Set 8 : update comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+733 lines, -681 lines) Patch
M chrome/browser/media/android/router/media_router_android.h View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/media/android/router/media_router_android.cc View 1 2 3 4 2 chunks +8 lines, -8 lines 0 comments Download
M chrome/browser/media/router/create_presentation_session_request.h View 1 2 3 4 5 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/media/router/create_presentation_session_request.cc View 1 2 3 4 5 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/media/router/create_presentation_session_request_unittest.cc View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/media/router/media_route.h View 1 chunk +0 lines, -5 lines 0 comments Download
M chrome/browser/media/router/media_route.cc View 1 2 2 chunks +0 lines, -37 lines 0 comments Download
M chrome/browser/media/router/media_route_unittest.cc View 1 1 chunk +0 lines, -15 lines 0 comments Download
M chrome/browser/media/router/media_router.h View 1 2 3 4 5 5 chunks +35 lines, -19 lines 0 comments Download
M chrome/browser/media/router/media_router.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/media/router/media_router.mojom View 1 2 3 4 2 chunks +2 lines, -5 lines 0 comments Download
M chrome/browser/media/router/media_router_mojo_impl.h View 1 2 3 4 5 7 chunks +33 lines, -15 lines 0 comments Download
M chrome/browser/media/router/media_router_mojo_impl.cc View 1 2 3 4 5 6 7 12 chunks +97 lines, -37 lines 0 comments Download
M chrome/browser/media/router/media_router_mojo_impl_unittest.cc View 1 2 3 4 10 chunks +67 lines, -46 lines 0 comments Download
M chrome/browser/media/router/mock_media_router.h View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/media/router/presentation_service_delegate_impl.h View 1 3 chunks +11 lines, -7 lines 0 comments Download
M chrome/browser/media/router/presentation_service_delegate_impl.cc View 1 2 3 4 13 chunks +55 lines, -20 lines 0 comments Download
A chrome/browser/media/router/presentation_session_messages_observer.h View 1 2 3 1 chunk +50 lines, -0 lines 0 comments Download
A chrome/browser/media/router/presentation_session_messages_observer.cc View 1 2 3 1 chunk +33 lines, -0 lines 0 comments Download
M chrome/browser/media/router/test_helper.h View 1 2 3 4 1 chunk +2 lines, -6 lines 0 comments Download
M chrome/browser/ui/webui/media_router/media_router_ui.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/webui/media_router/media_router_ui.cc View 1 2 3 4 5 2 chunks +4 lines, -1 line 0 comments Download
M chrome/test/media_router/media_router_e2e_browsertest.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/media_router/media_router_e2e_browsertest.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/presentation/presentation_service_impl.h View 1 2 chunks +6 lines, -7 lines 0 comments Download
M content/browser/presentation/presentation_service_impl.cc View 1 2 3 4 4 chunks +37 lines, -56 lines 0 comments Download
M content/browser/presentation/presentation_service_impl_unittest.cc View 1 2 3 4 5 12 chunks +127 lines, -153 lines 0 comments Download
M content/browser/presentation/presentation_type_converters.h View 1 chunk +9 lines, -0 lines 0 comments Download
M content/common/presentation/presentation_service.mojom View 1 2 3 4 chunks +10 lines, -8 lines 0 comments Download
M content/public/browser/presentation_service_delegate.h View 1 3 chunks +15 lines, -11 lines 0 comments Download
M content/public/browser/presentation_session_message.h View 1 2 3 4 1 chunk +3 lines, -31 lines 0 comments Download
M content/public/browser/presentation_session_message.cc View 1 2 3 4 1 chunk +3 lines, -55 lines 0 comments Download
M content/renderer/presentation/presentation_dispatcher.h View 1 2 3 4 5 5 chunks +29 lines, -9 lines 0 comments Download
M content/renderer/presentation/presentation_dispatcher.cc View 1 2 3 4 5 12 chunks +74 lines, -112 lines 0 comments Download
M extensions/renderer/resources/media_router_bindings.js View 1 2 3 4 3 chunks +4 lines, -6 lines 0 comments Download

Messages

Total messages: 29 (8 generated)
imcheng
mark, Haibin: PTAL, thanks. I'm not sure on the PresentationSessionMessagesObserver naming so I am open ...
5 years, 4 months ago (2015-07-29 21:40:13 UTC) #2
mark a. foltz
On 2015/07/29 at 21:40:13, imcheng wrote: > mark, Haibin: PTAL, thanks. I'm not sure on ...
5 years, 4 months ago (2015-07-30 22:52:44 UTC) #3
imcheng
Move mfoltz@ to CC Add kmarshall@ as reviewer. Kevin, PTAL at everything. Thanks.
5 years, 4 months ago (2015-07-30 22:58:00 UTC) #5
haibinlu
send out first few comments. https://codereview.chromium.org/1259073004/diff/40001/content/common/presentation/presentation_service.mojom File content/common/presentation/presentation_service.mojom (right): https://codereview.chromium.org/1259073004/diff/40001/content/common/presentation/presentation_service.mojom#newcode104 content/common/presentation/presentation_service.mojom:104: ListenForSessionMessages(PresentationSessionInfo sessionInfo); when will ...
5 years, 4 months ago (2015-07-30 23:16:31 UTC) #6
haibinlu
https://codereview.chromium.org/1259073004/diff/40001/chrome/browser/media/router/media_router.h File chrome/browser/media/router/media_router.h (right): https://codereview.chromium.org/1259073004/diff/40001/chrome/browser/media/router/media_router.h#newcode30 chrome/browser/media/router/media_router.h:30: // |presentation_id|: The presentation ID of the route created, ...
5 years, 4 months ago (2015-07-30 23:59:11 UTC) #7
imcheng
PTAL. I will rebase in a separate PS. https://codereview.chromium.org/1259073004/diff/40001/chrome/browser/media/router/media_router.h File chrome/browser/media/router/media_router.h (right): https://codereview.chromium.org/1259073004/diff/40001/chrome/browser/media/router/media_router.h#newcode30 chrome/browser/media/router/media_router.h:30: // ...
5 years, 4 months ago (2015-08-03 18:56:33 UTC) #9
imcheng
Ping
5 years, 4 months ago (2015-08-04 23:06:59 UTC) #10
mark a. foltz
Looks good overall, mostly minor comments on naming and documentation. This API makes more sense ...
5 years, 4 months ago (2015-08-04 23:47:02 UTC) #12
mark a. foltz
Couple of more things: - Please file a crbug motivating the change and update the ...
5 years, 4 months ago (2015-08-04 23:48:06 UTC) #13
haibinlu
https://codereview.chromium.org/1259073004/diff/80001/content/browser/presentation/presentation_service_impl.cc File content/browser/presentation/presentation_service_impl.cc (right): https://codereview.chromium.org/1259073004/diff/80001/content/browser/presentation/presentation_service_impl.cc#newcode38 content/browser/presentation/presentation_service_impl.cc:38: PRESENTATION_MESSAGE_TYPE_ARRAY_BUFFER; The majority of cases are one-to-one, not one-to-many. ...
5 years, 4 months ago (2015-08-05 17:19:52 UTC) #14
imcheng
PTAL. Updated descriptions and comments. Verified the SendMessage only copies once in PresentationDispatcher. Note that ...
5 years, 4 months ago (2015-08-05 21:38:35 UTC) #15
haibinlu
lgtm
5 years, 4 months ago (2015-08-05 22:17:20 UTC) #16
mark a. foltz
I'm not a fan of the design that relies on the extension to pass an ...
5 years, 4 months ago (2015-08-06 00:39:52 UTC) #17
imcheng
Chatted with mark offline yesterday. There is currently no mechanism to cancel the mojo callback ...
5 years, 4 months ago (2015-08-06 18:05:29 UTC) #18
mark a. foltz
lgtm
5 years, 4 months ago (2015-08-06 18:54:01 UTC) #19
Kevin M
lgtm
5 years, 4 months ago (2015-08-06 19:52:00 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1259073004/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1259073004/140001
5 years, 4 months ago (2015-08-06 20:17:11 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/89951)
5 years, 4 months ago (2015-08-06 22:16:48 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1259073004/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1259073004/140001
5 years, 4 months ago (2015-08-06 23:04:41 UTC) #27
commit-bot: I haz the power
Committed patchset #8 (id:140001)
5 years, 4 months ago (2015-08-07 01:00:55 UTC) #28
commit-bot: I haz the power
5 years, 4 months ago (2015-08-07 01:01:48 UTC) #29
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/a0b6dc9205a195a4fa8c52a71fa1cb2ae8abb591
Cr-Commit-Position: refs/heads/master@{#342249}

Powered by Google App Engine
This is Rietveld 408576698