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

Issue 2731043002: [Media Router] Add a presentation id to MediaRoute mapping in the MR (Closed)

Created:
3 years, 9 months ago by zhaobin
Modified:
3 years, 9 months ago
Reviewers:
mark a. foltz, imcheng
CC:
chfremer+watch_chromium.org, chromium-reviews, feature-media-reviews_chromium.org, mcasas+watch+vc_chromium.org, media-router+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Media Router] Add a presentation id to MediaRoute mapping in the MR Address comments from https://codereview.chromium.org/2714783002/ "High level sketch: - The mapping could be kept in InternalMediaRoutesObserver inside MediaRouterBase - Either keep a std::map<> inside, or add presentation ID to MediaRoute and search the list kept by the observer - Watch out for special IDs passed by Cast" BUG=688233

Patch Set 1 #

Total comments: 9

Patch Set 2 : Add optional presentation_id field to MediaRoute #

Total comments: 4

Patch Set 3 : resolve code review comments from Mark #

Total comments: 1

Patch Set 4 : resolve code review comments from Derek #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+196 lines, -1 line) Patch
M chrome/browser/media/router/media_route.h View 1 2 chunks +10 lines, -0 lines 0 comments Download
M chrome/browser/media/router/media_router.h View 1 2 3 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/browser/media/router/media_router_base.h View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/media/router/media_router_base.cc View 1 2 3 3 chunks +57 lines, -0 lines 1 comment Download
M chrome/browser/media/router/media_router_base_unittest.cc View 1 2 3 2 chunks +104 lines, -0 lines 0 comments Download
M chrome/browser/media/router/mock_media_router.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/media/router/presentation_service_delegate_impl.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/media/router/presentation_service_delegate_impl_unittest.cc View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/media/router/route_request_result.cc View 1 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 20 (5 generated)
zhaobin
3 years, 9 months ago (2017-03-03 22:58:38 UTC) #2
mark a. foltz
This works, but creates a duplicate id -> route mapping in PresentationServiceDelegate and MediaRouterBase. Have ...
3 years, 9 months ago (2017-03-06 21:02:20 UTC) #3
imcheng
I am not opposed to adding the presentation ID field onto MediaRoute itself. But we ...
3 years, 9 months ago (2017-03-07 00:58:19 UTC) #4
imcheng
Looks good overall. Let's investigate whether we can eliminate the mapping from PresentationServiceDelegate separately. https://codereview.chromium.org/2731043002/diff/1/chrome/browser/media/router/media_router.h ...
3 years, 9 months ago (2017-03-08 20:06:35 UTC) #5
mark a. foltz
https://codereview.chromium.org/2731043002/diff/1/chrome/browser/media/router/media_router_base.cc File chrome/browser/media/router/media_router_base.cc (right): https://codereview.chromium.org/2731043002/diff/1/chrome/browser/media/router/media_router_base.cc#newcode49 chrome/browser/media/router/media_router_base.cc:49: presentation_id_route.erase(presentation_id); On 2017/03/08 at 20:06:35, imcheng wrote: > If ...
3 years, 9 months ago (2017-03-08 22:01:48 UTC) #6
zhaobin
Added an optional presentation_id to MediaRoute. https://codereview.chromium.org/2731043002/diff/1/chrome/browser/media/router/media_router.h File chrome/browser/media/router/media_router.h (right): https://codereview.chromium.org/2731043002/diff/1/chrome/browser/media/router/media_router.h#newcode192 chrome/browser/media/router/media_router.h:192: // Register |route| ...
3 years, 9 months ago (2017-03-09 00:34:27 UTC) #7
mark a. foltz
LGTM and seems simpler. https://codereview.chromium.org/2731043002/diff/20001/chrome/browser/media/router/media_router_base.cc File chrome/browser/media/router/media_router_base.cc (right): https://codereview.chromium.org/2731043002/diff/20001/chrome/browser/media/router/media_router_base.cc#newcode44 chrome/browser/media/router/media_router_base.cc:44: if (route.presentation_id().has_value() && I think ...
3 years, 9 months ago (2017-03-10 00:56:28 UTC) #8
zhaobin
https://codereview.chromium.org/2731043002/diff/20001/chrome/browser/media/router/media_router_base.cc File chrome/browser/media/router/media_router_base.cc (right): https://codereview.chromium.org/2731043002/diff/20001/chrome/browser/media/router/media_router_base.cc#newcode44 chrome/browser/media/router/media_router_base.cc:44: if (route.presentation_id().has_value() && On 2017/03/10 00:56:28, mark a. foltz ...
3 years, 9 months ago (2017-03-10 01:51:11 UTC) #11
imcheng
https://codereview.chromium.org/2731043002/diff/40001/chrome/browser/media/router/route_request_result.cc File chrome/browser/media/router/route_request_result.cc (right): https://codereview.chromium.org/2731043002/diff/40001/chrome/browser/media/router/route_request_result.cc#newcode39 chrome/browser/media/router/route_request_result.cc:39: route_->set_presentation_id(presentation_id); Two comments: 1) It isn't clear to me ...
3 years, 9 months ago (2017-03-10 23:53:45 UTC) #14
zhaobin
On 2017/03/10 23:53:45, imcheng wrote: > https://codereview.chromium.org/2731043002/diff/40001/chrome/browser/media/router/route_request_result.cc > File chrome/browser/media/router/route_request_result.cc (right): > > https://codereview.chromium.org/2731043002/diff/40001/chrome/browser/media/router/route_request_result.cc#newcode39 > ...
3 years, 9 months ago (2017-03-11 03:42:31 UTC) #15
mark a. foltz
https://codereview.chromium.org/2731043002/diff/60001/chrome/browser/media/router/media_router_base.cc File chrome/browser/media/router/media_router_base.cc (right): https://codereview.chromium.org/2731043002/diff/60001/chrome/browser/media/router/media_router_base.cc#newcode72 chrome/browser/media/router/media_router_base.cc:72: void SetPresentationId(const MediaRoute::Id& route_id, Can the presentation ID just ...
3 years, 9 months ago (2017-03-13 17:52:11 UTC) #16
mark a. foltz
On 2017/03/13 at 17:52:11, mark a. foltz wrote: > https://codereview.chromium.org/2731043002/diff/60001/chrome/browser/media/router/media_router_base.cc > File chrome/browser/media/router/media_router_base.cc (right): > ...
3 years, 9 months ago (2017-03-13 18:26:45 UTC) #17
mark a. foltz
On 2017/03/13 at 18:26:45, mark a. foltz wrote: > On 2017/03/13 at 17:52:11, mark a. ...
3 years, 9 months ago (2017-03-13 18:38:50 UTC) #18
imcheng
Unless the extension also passes back the presentation ID for each route, maintaining the mapping ...
3 years, 9 months ago (2017-03-15 00:48:57 UTC) #19
mark a. foltz
3 years, 9 months ago (2017-03-16 23:09:11 UTC) #20
Message was sent while issue was closed.
Bin, sorry for taking you on a wild goose chase.  I think we learned something
in the process though :)

On 2017/03/15 at 00:48:57, imcheng wrote:
> Unless the extension also passes back the presentation ID for each route,
maintaining the mapping in MediaRouter will be a tricky but should be
manageable; when a successful route response is received, the MediaRouter impl
can signal to the InternalMediaRoutesObserver to add the [presentation_id,
route] pair.  (Presentation ID is always available as it's generated by MR)
> 
> If we are adding presentation_id field to MediaRoute, then we also need to
make sure the presentation ID isn't wiped out by a OnRoutesUpdated. So it needs
to take the existing route list and "transfer" the presentation IDs to the
updated route list. So MediaRouterMojoImpl::OnRoutesUpdated should do something
like this:
> 
> 1) Get the existing route list from InternalsMediaRouteObserver
> 2) Backfills presentation IDs into updated list
> 3) Notifies observer with augmented list (which includes
InternalMediaRoutesObserver)

Yeah.  I think of the ids as bookkeeping for the Presentation API and not
necessary to expose to lower layers, it was a design mistake to plumb them
through the MR.  Someday we can move reconnect() entirely in-browser for both
1-UA and 2-UA and remove the need to pass presentation IDs into and out of the
MRP.  

> 
> That said, having gone through this exercise, I also feel adding the mapping
in OPM is probably the simplest. If we do need to support it generally (i.e.
presentation_id field in MediaRoute) then we should look into having the
extension provide it in the MediaRoute struct rather than having the browser
backfill it.

Agreed.

The extension should not be generating presentation IDs; they need to come from
a trusted process, as access to the ID allows connection to a presentation.

Powered by Google App Engine
This is Rietveld 408576698