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

Issue 1126923002: Add Media Router Mojo impl code. (Closed)

Created:
5 years, 7 months ago by Kevin M
Modified:
5 years, 7 months ago
Reviewers:
imcheng (use chromium acct), tracylsnow1gir2boys, imcheng, Kevin Marshall, Wez
CC:
chromium-reviews, feature-media-reviews_chromium.org, qsr+mojo_chromium.org, Aaron Boodman, posciak+watch_chromium.org, ben+mojo_chromium.org, viettrungluu+watch_chromium.org, mcasas+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, media-router+watch_chromium.org, darin (slow to review), wjia+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add Media Router Mojo impl code. This code bridges calls from the Media Router to the Media Router Provider Manager. CL comprises logic for marshaling data across internal and Mojo structs, awareness of the MRPM extension's suspend state, and a BrowserContextKeyedService for constructing and managing Mojo service objects. Also included are unit tests, supporting mock classes, and some trivial miscellaneous name changes. R=mfoltz@chromium.org BUG=464205

Patch Set 1 #

Patch Set 2 : Fixed licenses, added some more comments. #

Patch Set 3 : Split off type converters library into its own CL. #

Patch Set 4 : Remove type converters from CL. #

Patch Set 5 : Fix the patch contents. #

Total comments: 52

Patch Set 6 : Sync with master. #

Patch Set 7 : Addressed code review feedback. #

Patch Set 8 : Removed duplicate entries from media_router_tests.gypi. #

Total comments: 28

Patch Set 9 : Rebase #

Patch Set 10 : Addressed code review feedback. #

Total comments: 2

Patch Set 11 : Redundant forward decl removed. #

Total comments: 105
Unified diffs Side-by-side diffs Delta from patch set Stats (+1312 lines, -13 lines) Patch
M chrome/browser/media/router/BUILD.gn View 1 2 3 4 5 6 7 8 3 chunks +14 lines, -0 lines 0 comments Download
M chrome/browser/media/router/media_router.h View 1 2 3 4 5 6 7 8 9 6 chunks +20 lines, -7 lines 2 comments Download
M chrome/browser/media/router/media_router.gyp View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -2 lines 0 comments Download
A chrome/browser/media/router/media_router_mojo_impl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +180 lines, -0 lines 44 comments Download
A chrome/browser/media/router/media_router_mojo_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +362 lines, -0 lines 37 comments Download
A chrome/browser/media/router/media_router_mojo_impl_factory.h View 4 7 8 1 chunk +44 lines, -0 lines 8 comments Download
A chrome/browser/media/router/media_router_mojo_impl_factory.cc View 1 2 3 4 5 6 7 8 1 chunk +50 lines, -0 lines 6 comments Download
A chrome/browser/media/router/media_router_mojo_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +365 lines, -0 lines 0 comments Download
A chrome/browser/media/router/media_router_mojo_test.h View 1 4 1 chunk +65 lines, -0 lines 0 comments Download
A chrome/browser/media/router/media_router_mojo_test.cc View 1 2 3 4 5 6 7 8 9 1 chunk +70 lines, -0 lines 0 comments Download
M chrome/browser/media/router/media_router_tests.gypi View 1 2 3 4 5 6 7 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/media/router/mock_media_router.h View 1 2 3 4 5 2 chunks +6 lines, -3 lines 0 comments Download
M chrome/browser/media/router/mock_media_router.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 2 comments Download
A chrome/browser/media/router/test_helper.h View 1 2 3 4 5 6 7 8 9 1 chunk +94 lines, -0 lines 4 comments Download
A chrome/browser/media/router/test_helper.cc View 4 1 chunk +27 lines, -0 lines 2 comments Download

Messages

Total messages: 23 (6 generated)
Kevin M
5 years, 7 months ago (2015-05-06 00:14:31 UTC) #1
tracylsnow1gir2boys_gmail.com
lgtm
5 years, 7 months ago (2015-05-08 00:56:23 UTC) #3
mark a. foltz
I didn't review the tests or the test support classes yet. media_router_mojo_impl is pretty hairy ...
5 years, 7 months ago (2015-05-08 00:58:39 UTC) #5
Kevin M
https://codereview.chromium.org/1126923002/diff/80001/chrome/browser/media/router/media_router.h File chrome/browser/media/router/media_router.h (right): https://codereview.chromium.org/1126923002/diff/80001/chrome/browser/media/router/media_router.h#newcode73 chrome/browser/media/router/media_router.h:73: // Adds the IssuesObserver |observer|. On 2015/05/08 00:58:37, mark ...
5 years, 7 months ago (2015-05-12 23:56:10 UTC) #6
Kevin M
Adding imcheng to the reviewers list. Once he LGTM's the patch, he will take over ...
5 years, 7 months ago (2015-05-14 18:52:56 UTC) #8
imcheng (use chromium acct)
Please rebase, thanks. https://codereview.chromium.org/1126923002/diff/140001/chrome/browser/media/router/media_router.h File chrome/browser/media/router/media_router.h (right): https://codereview.chromium.org/1126923002/diff/140001/chrome/browser/media/router/media_router.h#newcode57 chrome/browser/media/router/media_router.h:57: virtual void ClearIssue(const Issue::IssueId& issue_id) = ...
5 years, 7 months ago (2015-05-14 21:30:13 UTC) #10
Kevin M
https://codereview.chromium.org/1126923002/diff/140001/chrome/browser/media/router/media_router.h File chrome/browser/media/router/media_router.h (right): https://codereview.chromium.org/1126923002/diff/140001/chrome/browser/media/router/media_router.h#newcode57 chrome/browser/media/router/media_router.h:57: virtual void ClearIssue(const Issue::IssueId& issue_id) = 0; On 2015/05/14 ...
5 years, 7 months ago (2015-05-14 22:46:35 UTC) #11
imcheng (use chromium acct)
lgtm https://codereview.chromium.org/1126923002/diff/180001/chrome/browser/media/router/media_router_mojo_impl.h File chrome/browser/media/router/media_router_mojo_impl.h (right): https://codereview.chromium.org/1126923002/diff/180001/chrome/browser/media/router/media_router_mojo_impl.h#newcode36 chrome/browser/media/router/media_router_mojo_impl.h:36: class IssuesObserver; these fwd declarations not needed?
5 years, 7 months ago (2015-05-14 23:00:45 UTC) #12
Kevin Marshall
Thanks Derek. Mark, would you mind having another look before I move on with the ...
5 years, 7 months ago (2015-05-14 23:04:57 UTC) #14
Kevin Marshall
Thanks Derek. Mark, would you mind having another look before I move on with the ...
5 years, 7 months ago (2015-05-14 23:04:58 UTC) #15
mark a. foltz
I won't have time to re-review before my trip. Suggest pinging wez@ or one of ...
5 years, 7 months ago (2015-05-14 23:07:18 UTC) #16
Kevin M
R+=wez Derek will take over the CL for the media team review phase, but I ...
5 years, 7 months ago (2015-05-14 23:17:09 UTC) #18
Wez
nit: CL description paragraph from "CL comprises" would be more readable as a bullet-list.
5 years, 7 months ago (2015-05-15 20:49:46 UTC) #19
Wez
I've not reviewed the tests as yet, but here are some code comments. :) https://codereview.chromium.org/1126923002/diff/200001/chrome/browser/media/router/media_router.h ...
5 years, 7 months ago (2015-05-20 23:37:50 UTC) #20
imcheng (use chromium acct)
Comments addressed in https://codereview.chromium.org/1143603004/ https://codereview.chromium.org/1126923002/diff/200001/chrome/browser/media/router/media_router.h File chrome/browser/media/router/media_router.h (right): https://codereview.chromium.org/1126923002/diff/200001/chrome/browser/media/router/media_router.h#newcode109 chrome/browser/media/router/media_router.h:109: On 2015/05/20 23:37:47, Wez wrote: ...
5 years, 7 months ago (2015-05-21 19:28:53 UTC) #21
Wez
https://codereview.chromium.org/1126923002/diff/200001/chrome/browser/media/router/media_router_mojo_impl.cc File chrome/browser/media/router/media_router_mojo_impl.cc (right): https://codereview.chromium.org/1126923002/diff/200001/chrome/browser/media/router/media_router_mojo_impl.cc#newcode322 chrome/browser/media/router/media_router_mojo_impl.cc:322: event_page_tracker_ = extensions::ProcessManager::Get(context); On 2015/05/21 19:28:50, imcheng wrote: > ...
5 years, 7 months ago (2015-05-21 23:32:47 UTC) #22
imcheng (use chromium acct)
5 years, 7 months ago (2015-05-22 00:54:08 UTC) #23
Message was sent while issue was closed.
https://codereview.chromium.org/1126923002/diff/200001/chrome/browser/media/r...
File chrome/browser/media/router/media_router_mojo_impl.cc (right):

https://codereview.chromium.org/1126923002/diff/200001/chrome/browser/media/r...
chrome/browser/media/router/media_router_mojo_impl.cc:322: event_page_tracker_ =
extensions::ProcessManager::Get(context);
On 2015/05/21 23:32:47, Wez wrote:
> On 2015/05/21 19:28:50, imcheng wrote:
> > On 2015/05/20 23:37:48, Wez wrote:
> > > This doesn't seem to be doing anything to actually request extension
> > > state-change notifications?
> > 
> > Yeah, we changed from a push model to a pull model at some point, so the
name
> is
> > no longer accurate. How about moving these into Bind() and renaming it
> > BindAndInitExtensionInfo()?
> 
> Bind could certainly use a re-name to something more helpful - I'm drawing a
> blank on how to describe it better, though.

I ended up keeping the Bind() and extension logic separate since
MediaRouterMojoTest setup code only requires the former. How about calling it
BindToMojoRequest?

https://codereview.chromium.org/1126923002/diff/200001/chrome/browser/media/r...
File chrome/browser/media/router/media_router_mojo_impl.h (right):

https://codereview.chromium.org/1126923002/diff/200001/chrome/browser/media/r...
chrome/browser/media/router/media_router_mojo_impl.h:158:
interfaces::MediaRouterPtr mojo_media_router_;
On 2015/05/21 23:32:47, Wez wrote:
> On 2015/05/21 19:28:51, imcheng wrote:
> > On 2015/05/20 23:37:49, Wez wrote:
> > > I'm confused... why is the interface to the Provider Manager called
> > > MediaRouter[Ptr]? Shouldn't that be the name for the MediaRouter interface
> > that
> > > the Provider Manager uses...?
> > 
> > There was a discussion with Kevin and xhwang@ on the naming. The idea, I
> think,
> > is that the provider manager is a mojo implementation of the MediaRouter.
This
> > class is an implementation that delegates the calls to it.
> > 
> > Please see:
> >
>
https://codereview.chromium.org/1055403006/diff/40001/chrome/browser/media/ro...
> 
> That doesn't sound right. The MediaRouter is the component in Chrome, and the
> MediaRouteProviderManager is the extension-side component that the
> MediaRouteProviders integrate with.
> 
> Or is the ideal that the MediaRouteProviders all talk via Mojo, through a
> MediaRouter interface, to the MediaRouteProviderManager, which then talks to
the
> C++ MediaRouter?

Hmm. I think it makes sense to me. From Chrome's perspective, it does not need
to know about provider manager (this means we should update the comments here to
omit 'Provider Manager'). All it knows as that there is a component extension
that acts as a MediaRouter because it implements provides an implementation of
the MediaRouter interface. We are using MediaRouter to describe the set of APIs
for routing media, and not just the component in Chrome. That might be the
source of confusion?

Powered by Google App Engine
This is Rietveld 408576698