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

Issue 2727123002: [Media Router] Custom Controls 1 - Add MediaStatus, MediaRouteController, and mojo interfaces (Closed)

Created:
3 years, 9 months ago by takumif
Modified:
3 years, 8 months ago
CC:
Aaron Boodman, abarth-chromium, chfremer+watch_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, darin (slow to review), extensions-reviews_chromium.org, feature-media-reviews_chromium.org, mcasas+watch+vc_chromium.org, media-router+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[Media Router] Custom Controls 1 - Add MediaStatus, MediaRouteController, and mojo interfaces This CL adds MediaRouteController that will forward media controller commands from the custom controls WebUI to the Media Router component extension, and will receive MediaStatus updates from the extension which it then will forward to its Observer(s) (= to the WebUI). This patch includes mojo interfaces/structs that were first reviewed in this patch [1]. The MediaController mojo interface will be implemented in the component extension (not a part of Chromium), and will receive commands from MediaRouteController. MediaRouteController implements the MediaStatusObserver mojo interface and receives updates from the extension. Typemapping between media_router::mojom::MediaStatus and media_router::MediaStatus is also included in this CL. Changes in extensions/renderer/ are for exposing the new mojo interfaces to the component extension. The Chromium-side implementation of custom controls redesign will be done in these patches: 1. Mojo/MediaStatus/MediaRouteController: this patch 2. MediaRouter::GetRouteController(): http://crrev/2728543009 3. MRUI/MRWebUIMessageHandler: http://crrev/2731033002 4. Custom controls WebUI: http://crrev/2725503002 Custom controls redesign design doc: https://docs.google.com/document/d/1_8QxdFIiiJX39jR1Wi1Zn9FW-Y66EMvX1GmQZvjN4G0/edit [1] https://codereview.chromium.org/2674363002/ BUG=684636, 684635 Review-Url: https://codereview.chromium.org/2727123002 Cr-Commit-Position: refs/heads/master@{#458922} Committed: https://chromium.googlesource.com/chromium/src/+/67a8f64435d0a1c3ae9d04e33f965f885b9cb8b7

Patch Set 1 : . #

Total comments: 86

Patch Set 2 : Address Mark, Devlin, Derek, and Daniel's comments #

Total comments: 2

Patch Set 3 : Rebase #

Patch Set 4 : Make MediaRouteController ref-counted, move MediaStatus typemapping into its own files #

Patch Set 5 : Add OnControllerBound() #

Total comments: 33

Patch Set 6 : Address Derek's and Daniel's comments #

Total comments: 42

Patch Set 7 : Remvoe OnControllerBound() #

Patch Set 8 : Address Daniel's, Mark's, and Derek's comments #

Total comments: 30

Patch Set 9 : Address Mark's comments #

Patch Set 10 : Add CreateObserver() to MRController unit test #

Total comments: 6

Patch Set 11 : Address Derek's comments #

Total comments: 7

Patch Set 12 : Address Mark's and Daniel's comments #

Patch Set 13 : Rebase #

Patch Set 14 : Change MediaStatus::status to MediaStatus::description. Attempt to fix buildbot failure #

Patch Set 15 : Change comment #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+647 lines, -2 lines) Patch
M chrome/browser/media/router/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +17 lines, -0 lines 0 comments Download
A chrome/browser/media/router/media_status.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +63 lines, -0 lines 0 comments Download
A chrome/browser/media/router/media_status.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +26 lines, -0 lines 0 comments Download
A chrome/browser/media/router/mojo/media_controller.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +35 lines, -0 lines 0 comments Download
A chrome/browser/media/router/mojo/media_route_controller.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +115 lines, -0 lines 0 comments Download
A chrome/browser/media/router/mojo/media_route_controller.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +80 lines, -0 lines 0 comments Download
A chrome/browser/media/router/mojo/media_route_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +114 lines, -0 lines 0 comments Download
A chrome/browser/media/router/mojo/media_status.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +60 lines, -0 lines 0 comments Download
A chrome/browser/media/router/mojo/media_status.typemap View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download
A chrome/browser/media/router/mojo/media_status_struct_traits.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +72 lines, -0 lines 0 comments Download
A chrome/browser/media/router/mojo/media_status_struct_traits.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +41 lines, -0 lines 0 comments Download
M chrome/browser/media/router/mojo/typemaps.gni View 1 2 3 1 chunk +4 lines, -1 line 0 comments Download
M chrome/test/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M extensions/renderer/dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +5 lines, -1 line 2 comments Download
M extensions/renderer/resources/extensions_renderer_resources.grd View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 89 (54 generated)
takumif
imcheng@/mfoltz@: overall dcheng@: *.mojom, *.typemap, *struct_traits* rdcronin@: extensions/renderer/* Please take a look. This includes mojo ...
3 years, 9 months ago (2017-03-04 00:53:34 UTC) #21
mark a. foltz
Looks good overall. Most comments about clarifying the role of MediaRouteController. Killing the controller when ...
3 years, 9 months ago (2017-03-06 20:06:20 UTC) #22
Devlin
https://codereview.chromium.org/2727123002/diff/100001/extensions/renderer/dispatcher.cc File extensions/renderer/dispatcher.cc (right): https://codereview.chromium.org/2727123002/diff/100001/extensions/renderer/dispatcher.cc#newcode745 extensions/renderer/dispatcher.cc:745: {"chrome/browser/media/router/mojo/media_controller.mojom", Where are these used? I can't find them ...
3 years, 9 months ago (2017-03-06 22:51:05 UTC) #23
imcheng
https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_route_status_observer.h File chrome/browser/media/router/media_route_status_observer.h (right): https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_route_status_observer.h#newcode15 chrome/browser/media/router/media_route_status_observer.h:15: MediaRouteStatusObserver() {} Constructors aren't required for interfaces. Also similar ...
3 years, 9 months ago (2017-03-06 23:11:41 UTC) #24
dcheng
https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_status.h File chrome/browser/media/router/media_status.h (right): https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_status.h#newcode17 chrome/browser/media/router/media_status.h:17: virtual ~MediaStatus(); No virtual. https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_status.h#newcode54 chrome/browser/media/router/media_status.h:54: uint32_t duration; base::TimeDelta? ...
3 years, 9 months ago (2017-03-08 01:08:20 UTC) #25
takumif
Thanks for the reviews! https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_route_status_observer.h File chrome/browser/media/router/media_route_status_observer.h (right): https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_route_status_observer.h#newcode12 chrome/browser/media/router/media_route_status_observer.h:12: // An interface for observing ...
3 years, 9 months ago (2017-03-08 04:24:03 UTC) #26
Devlin
https://codereview.chromium.org/2727123002/diff/100001/extensions/renderer/dispatcher.cc File extensions/renderer/dispatcher.cc (right): https://codereview.chromium.org/2727123002/diff/100001/extensions/renderer/dispatcher.cc#newcode745 extensions/renderer/dispatcher.cc:745: {"chrome/browser/media/router/mojo/media_controller.mojom", On 2017/03/08 04:24:03, takumif wrote: > On 2017/03/06 ...
3 years, 9 months ago (2017-03-08 19:33:24 UTC) #27
imcheng
On 2017/03/08 19:33:24, Devlin wrote: > https://codereview.chromium.org/2727123002/diff/100001/extensions/renderer/dispatcher.cc > File extensions/renderer/dispatcher.cc (right): > > https://codereview.chromium.org/2727123002/diff/100001/extensions/renderer/dispatcher.cc#newcode745 > ...
3 years, 9 months ago (2017-03-08 20:15:41 UTC) #28
takumif
On 2017/03/08 20:15:41, imcheng wrote: > On 2017/03/08 19:33:24, Devlin wrote: > > > https://codereview.chromium.org/2727123002/diff/100001/extensions/renderer/dispatcher.cc ...
3 years, 9 months ago (2017-03-08 22:02:12 UTC) #29
mark a. foltz
https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_route_status_observer.h File chrome/browser/media/router/media_route_status_observer.h (right): https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_route_status_observer.h#newcode12 chrome/browser/media/router/media_route_status_observer.h:12: // An interface for observing updates to the status ...
3 years, 9 months ago (2017-03-08 22:16:12 UTC) #30
takumif
https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_route_status_observer.h File chrome/browser/media/router/media_route_status_observer.h (right): https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_route_status_observer.h#newcode12 chrome/browser/media/router/media_route_status_observer.h:12: // An interface for observing updates to the status ...
3 years, 9 months ago (2017-03-09 19:45:30 UTC) #31
imcheng
https://codereview.chromium.org/2727123002/diff/120001/chrome/browser/media/router/mojo/media_route_controller.cc File chrome/browser/media/router/mojo/media_route_controller.cc (right): https://codereview.chromium.org/2727123002/diff/120001/chrome/browser/media/router/mojo/media_route_controller.cc#newcode55 chrome/browser/media/router/mojo/media_route_controller.cc:55: } 1) If the associated MediaRoute is terminated, how ...
3 years, 9 months ago (2017-03-11 03:07:53 UTC) #32
Devlin
On 2017/03/08 22:02:12, takumif wrote: > On 2017/03/08 20:15:41, imcheng wrote: > > On 2017/03/08 ...
3 years, 9 months ago (2017-03-11 03:09:40 UTC) #33
mark a. foltz
Sorry to hold this up, but I still think the current design is a little ...
3 years, 9 months ago (2017-03-13 18:22:31 UTC) #34
takumif
New changes: - Made MediaRouteController ref-counted - MediaRouteController is now included in Android builds as ...
3 years, 9 months ago (2017-03-15 05:57:03 UTC) #43
imcheng
Thanks. I think the ownership model is slightly more clear now. The MediaRouteController class would ...
3 years, 9 months ago (2017-03-16 20:00:43 UTC) #48
dcheng
https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_status.h File chrome/browser/media/router/media_status.h (right): https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_status.h#newcode17 chrome/browser/media/router/media_status.h:17: virtual ~MediaStatus(); On 2017/03/13 18:22:31, mark a. foltz wrote: ...
3 years, 9 months ago (2017-03-17 06:15:14 UTC) #49
takumif
https://codereview.chromium.org/2727123002/diff/240001/chrome/browser/media/router/mojo/media_route_controller.cc File chrome/browser/media/router/mojo/media_route_controller.cc (right): https://codereview.chromium.org/2727123002/diff/240001/chrome/browser/media/router/mojo/media_route_controller.cc#newcode13 chrome/browser/media/router/mojo/media_route_controller.cc:13: : controller_(std::move(controller)) { On 2017/03/17 06:15:14, dcheng wrote: > ...
3 years, 9 months ago (2017-03-17 21:48:02 UTC) #50
mark a. foltz
Thanks for the updated design. I think this shows the roles of the objects clearly. ...
3 years, 9 months ago (2017-03-17 23:55:05 UTC) #51
imcheng
https://codereview.chromium.org/2727123002/diff/240001/chrome/browser/media/router/mojo/media_route_controller.cc File chrome/browser/media/router/mojo/media_route_controller.cc (right): https://codereview.chromium.org/2727123002/diff/240001/chrome/browser/media/router/mojo/media_route_controller.cc#newcode63 chrome/browser/media/router/mojo/media_route_controller.cc:63: // |this| is deleted here! On 2017/03/17 21:48:01, takumif ...
3 years, 9 months ago (2017-03-18 00:11:32 UTC) #52
takumif
Thanks for the reviews! https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_status.h File chrome/browser/media/router/media_status.h (right): https://codereview.chromium.org/2727123002/diff/100001/chrome/browser/media/router/media_status.h#newcode17 chrome/browser/media/router/media_status.h:17: virtual ~MediaStatus(); On 2017/03/17 06:15:14, ...
3 years, 9 months ago (2017-03-20 22:10:46 UTC) #53
mark a. foltz
It was hard to follow which of my comments had been addressed (or not addressed) ...
3 years, 9 months ago (2017-03-20 23:47:04 UTC) #54
mark a. foltz
Found the rest of your replies hiding in plain sight :-P https://codereview.chromium.org/2727123002/diff/260001/chrome/browser/media/router/media_status.h File chrome/browser/media/router/media_status.h (right): ...
3 years, 9 months ago (2017-03-21 00:05:21 UTC) #55
takumif
https://codereview.chromium.org/2727123002/diff/300001/chrome/browser/media/router/mojo/media_route_controller.cc File chrome/browser/media/router/mojo/media_route_controller.cc (right): https://codereview.chromium.org/2727123002/diff/300001/chrome/browser/media/router/mojo/media_route_controller.cc#newcode13 chrome/browser/media/router/mojo/media_route_controller.cc:13: : controller_(std::move(controller)) { On 2017/03/20 23:47:03, mark a. foltz ...
3 years, 9 months ago (2017-03-21 04:00:07 UTC) #56
imcheng
lgtm https://codereview.chromium.org/2727123002/diff/340001/chrome/browser/media/router/mojo/media_route_controller.cc File chrome/browser/media/router/mojo/media_route_controller.cc (right): https://codereview.chromium.org/2727123002/diff/340001/chrome/browser/media/router/mojo/media_route_controller.cc#newcode23 chrome/browser/media/router/mojo/media_route_controller.cc:23: controller_ = nullptr; Should we call RemoveObserver here ...
3 years, 9 months ago (2017-03-21 21:19:58 UTC) #57
takumif
https://codereview.chromium.org/2727123002/diff/340001/chrome/browser/media/router/mojo/media_route_controller.cc File chrome/browser/media/router/mojo/media_route_controller.cc (right): https://codereview.chromium.org/2727123002/diff/340001/chrome/browser/media/router/mojo/media_route_controller.cc#newcode23 chrome/browser/media/router/mojo/media_route_controller.cc:23: controller_ = nullptr; On 2017/03/21 21:19:58, imcheng wrote: > ...
3 years, 9 months ago (2017-03-21 22:59:49 UTC) #58
mark a. foltz
LGTM Thanks for patience with multiple rounds of review. This shaped up nicely. https://codereview.chromium.org/2727123002/diff/300001/chrome/browser/media/router/mojo/media_route_controller.cc File ...
3 years, 9 months ago (2017-03-22 00:41:44 UTC) #59
dcheng
mojo lgtm https://codereview.chromium.org/2727123002/diff/360001/chrome/browser/media/router/mojo/media_route_controller.h File chrome/browser/media/router/mojo/media_route_controller.h (right): https://codereview.chromium.org/2727123002/diff/360001/chrome/browser/media/router/mojo/media_route_controller.h#newcode48 chrome/browser/media/router/mojo/media_route_controller.h:48: // should not be stored by an ...
3 years, 9 months ago (2017-03-22 01:17:10 UTC) #60
takumif
https://codereview.chromium.org/2727123002/diff/260001/chrome/browser/media/router/media_status.h File chrome/browser/media/router/media_status.h (right): https://codereview.chromium.org/2727123002/diff/260001/chrome/browser/media/router/media_status.h#newcode30 chrome/browser/media/router/media_status.h:30: // "YouTube". On 2017/03/21 00:05:21, mark a. foltz wrote: ...
3 years, 9 months ago (2017-03-22 21:54:30 UTC) #73
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2727123002/440001
3 years, 9 months ago (2017-03-22 23:06:11 UTC) #81
commit-bot: I haz the power
Committed patchset #15 (id:440001) as https://chromium.googlesource.com/chromium/src/+/67a8f64435d0a1c3ae9d04e33f965f885b9cb8b7
3 years, 9 months ago (2017-03-22 23:15:49 UTC) #84
Nico
https://codereview.chromium.org/2727123002/diff/440001/extensions/renderer/dispatcher.cc File extensions/renderer/dispatcher.cc (right): https://codereview.chromium.org/2727123002/diff/440001/extensions/renderer/dispatcher.cc#newcode754 extensions/renderer/dispatcher.cc:754: {"chrome/browser/media/router/mojo/media_controller.mojom", This adds many more dependencies from extensions/ to ...
3 years, 9 months ago (2017-03-23 18:36:49 UTC) #86
imcheng
https://codereview.chromium.org/2727123002/diff/440001/extensions/renderer/dispatcher.cc File extensions/renderer/dispatcher.cc (right): https://codereview.chromium.org/2727123002/diff/440001/extensions/renderer/dispatcher.cc#newcode754 extensions/renderer/dispatcher.cc:754: {"chrome/browser/media/router/mojo/media_controller.mojom", On 2017/03/23 18:36:49, Nico wrote: > This adds ...
3 years, 9 months ago (2017-03-23 19:03:16 UTC) #87
imcheng
Created crbug.com/704958 to track moving of mojom files.
3 years, 9 months ago (2017-03-24 16:13:44 UTC) #88
michaelpg
3 years, 8 months ago (2017-04-11 22:32:41 UTC) #89
Message was sent while issue was closed.
On 2017/03/23 19:03:16, imcheng wrote:
>
https://codereview.chromium.org/2727123002/diff/440001/extensions/renderer/di...
> File extensions/renderer/dispatcher.cc (right):
> 
>
https://codereview.chromium.org/2727123002/diff/440001/extensions/renderer/di...
> extensions/renderer/dispatcher.cc:754:
> {"chrome/browser/media/router/mojo/media_controller.mojom",
> On 2017/03/23 18:36:49, Nico wrote:
> > This adds many more dependencies from extensions/ to chrome/. Since chrome
> > already depends, that's an (implicit) dependency cycle, and this does not
> lgtm.
> > Please revert this and come up with a way to handle this without this
> dependency
> > cycle.
> 
> These dependencies need to exist for the Media Router extension to work
> properly. If the problem is simply where these mojom files are located in,
then
> we can move them somewhere else to break the cycle. In
> https://codereview.chromium.org/1162243002/ I suggested
> //components/media_router., but I think //media/router (or
//media/mojo/router)
> should work too. Please let me know if that's not the case.
> 
> I don't think this warrants a revert. The implicit cycle has existed for quite
> some time now and this patch doesn't break anything. I do think it's a good
idea
> to remove this cycle as soon as we figure out where to relocate the mojom
files.

Existing GN dependencies are one thing, but now we can't build extensions
targets
without building chrome. Is that not new as of this CL? See crbug.com/706786.

Powered by Google App Engine
This is Rietveld 408576698