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

Issue 2176613003: [Media Router] Clean up issues related code. (Closed)

Created:
4 years, 5 months ago by imcheng
Modified:
4 years ago
Reviewers:
mark a. foltz, dcheng, msw
CC:
Aaron Boodman, abarth-chromium, arv+watch_chromium.org, ben+mojo_chromium.org, chromium-reviews, darin (slow to review), feature-media-reviews_chromium.org, mcasas+watch+vc_chromium.org, media-router+watch_chromium.org, miu+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+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

[Media Router] Clean up issues related code. - Split all fields except for ID in Issue into IssueInfo struct, which is safely copyable. - Modified Register/UnregisterIssuesObserver behavior to not require a manaul Unregiser call. (similar to MediaSinksObserver) - Use StructTraits when converting Issue from/to Mojo land - Replace IssueAction class with Issue::ActionType as there is no need for the class. - Fully qualify Issue::Severity enum values for clarity. - Reduce Issue ctor param list from 8 to 3. Introduce setters for optional args. - Rename is_global -> IsGlobal, is_blocking -> IsBlocking as they are not simple getters. - Clean up IssueManager logic. - Replace string Issue ID with int. There is no need for GUID. - No need for MediaRouterAction to retain a copy of Issue object. BUG=571525 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/466a89e738c071195c6bdbe9fe06ce871ead7a9f Cr-Commit-Position: refs/heads/master@{#438321}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 26

Patch Set 4 : Rebase #

Patch Set 5 : Addressed comments, break Issue into IssueInfo + id, updated tests #

Patch Set 6 : fix compile #

Patch Set 7 : IssueObserver init behavior and use StructTraits #

Total comments: 22

Patch Set 8 : Addressed comments #

Total comments: 18

Patch Set 9 : Addressed comments, before API change #

Patch Set 10 : split OnIssueUpdated -> OnIssue / OnIssuesClear #

Patch Set 11 : rebase #

Total comments: 24

Patch Set 12 : Addressed dcheng's comments #

Total comments: 2

Patch Set 13 : Addressed dcheng's comments x2 #

Total comments: 4

Patch Set 14 : Remove some more EnumTraits calls #

Total comments: 20

Patch Set 15 : Addressed dcheng and msw's comments #

Total comments: 2

Patch Set 16 : Rebase #

Patch Set 17 : fix tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+694 lines, -820 lines) Patch
M chrome/browser/media/android/router/media_router_android.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/media/android/router/media_router_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/media/router/issue.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +63 lines, -64 lines 0 comments Download
M chrome/browser/media/router/issue.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +35 lines, -35 lines 0 comments Download
M chrome/browser/media/router/issue_manager.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +8 lines, -20 lines 0 comments Download
M chrome/browser/media/router/issue_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +38 lines, -71 lines 0 comments Download
M chrome/browser/media/router/issue_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +63 lines, -110 lines 0 comments Download
M chrome/browser/media/router/issue_unittest.cc View 1 2 3 4 5 1 chunk +97 lines, -118 lines 0 comments Download
M chrome/browser/media/router/issues_observer.h View 1 2 3 4 5 6 7 8 9 1 chunk +11 lines, -4 lines 0 comments Download
M chrome/browser/media/router/issues_observer.cc View 1 2 3 4 5 6 7 1 chunk +9 lines, -6 lines 0 comments Download
M chrome/browser/media/router/media_router.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/media/router/mock_media_router.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/media/router/mojo/media_router.typemap View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +16 lines, -2 lines 0 comments Download
M chrome/browser/media/router/mojo/media_router_mojo_impl.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/media/router/mojo/media_router_mojo_impl.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -6 lines 0 comments Download
M chrome/browser/media/router/mojo/media_router_mojo_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +26 lines, -49 lines 0 comments Download
M chrome/browser/media/router/mojo/media_router_struct_traits.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +110 lines, -0 lines 0 comments Download
A chrome/browser/media/router/mojo/media_router_struct_traits.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +43 lines, -0 lines 0 comments Download
M chrome/browser/media/router/mojo/media_router_type_converters.h View 1 2 3 4 5 6 2 chunks +0 lines, -14 lines 0 comments Download
M chrome/browser/media/router/mojo/media_router_type_converters.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +0 lines, -46 lines 0 comments Download
M chrome/browser/media/router/mojo/media_router_type_converters_unittest.cc View 1 2 3 4 5 6 7 2 chunks +1 line, -71 lines 0 comments Download
M chrome/browser/media/router/test_helper.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -36 lines 0 comments Download
M chrome/browser/resources/media_router/media_router.js View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/resources/media_router/media_router_data.js View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/resources/media_router/media_router_ui_interface.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/toolbar/media_router_action.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +5 lines, -4 lines 0 comments Download
M chrome/browser/ui/toolbar/media_router_action.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +13 lines, -7 lines 0 comments Download
M chrome/browser/ui/toolbar/media_router_action_controller.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/toolbar/media_router_action_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +8 lines, -5 lines 0 comments Download
M chrome/browser/ui/toolbar/media_router_action_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 4 chunks +10 lines, -15 lines 0 comments Download
M chrome/browser/ui/toolbar/media_router_action_unittest.cc View 1 2 3 4 5 6 7 8 9 7 chunks +24 lines, -42 lines 0 comments Download
M chrome/browser/ui/views/media_router/media_router_ui_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +7 lines, -10 lines 0 comments Download
M chrome/browser/ui/webui/media_router/media_router_ui.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/media_router/media_router_ui.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +22 lines, -20 lines 0 comments Download
M chrome/browser/ui/webui/media_router/media_router_webui_message_handler.h View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +33 lines, -29 lines 0 comments Download
M chrome/browser/ui/webui/media_router/media_router_webui_message_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +18 lines, -12 lines 0 comments Download
M chrome/test/data/webui/media_router/issue_banner_tests.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/test/data/webui/media_router/media_router_container_test_base.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 62 (26 generated)
imcheng
PTAL. I wanted to deal with the peculiarity with the Issue ID in a separate ...
4 years, 5 months ago (2016-07-22 22:17:09 UTC) #5
mark a. foltz
Thanks Derek this is much, much cleaner. Mostly minor style comments. https://codereview.chromium.org/2176613003/diff/40001/chrome/browser/media/router/issue.cc File chrome/browser/media/router/issue.cc (right): ...
4 years, 4 months ago (2016-07-27 18:52:04 UTC) #7
mark a. foltz
Noticed this issue was still open...
4 years, 3 months ago (2016-09-12 17:00:50 UTC) #8
imcheng
Working on this. It has been on my backlog for a while since returning from ...
4 years, 3 months ago (2016-09-12 20:47:45 UTC) #9
imcheng
I made some more changes in addition to addressing your comments. - I extracted a ...
4 years, 3 months ago (2016-09-13 20:27:55 UTC) #10
imcheng
There are a couple other things I want to do in this patch: - Fix ...
4 years, 3 months ago (2016-09-14 19:48:30 UTC) #11
mark a. foltz
On 2016/09/14 at 19:48:30, imcheng wrote: > There are a couple other things I want ...
4 years, 2 months ago (2016-10-03 19:54:36 UTC) #12
imcheng
Yep, ready for review now. Uploaded a new patchset with the following changes: - Fix ...
4 years, 2 months ago (2016-10-17 23:34:51 UTC) #14
mark a. foltz
Sending some comments now. Will follow up with rest soon. It looks like IssueInfo is ...
4 years, 2 months ago (2016-10-18 17:16:52 UTC) #15
mark a. foltz
Overall looks good with nits addressed. One substantial question about the typemapping. https://codereview.chromium.org/2176613003/diff/120001/chrome/browser/media/router/mojo/media_router_mojo_impl_unittest.cc File chrome/browser/media/router/mojo/media_router_mojo_impl_unittest.cc ...
4 years, 2 months ago (2016-10-18 21:13:44 UTC) #16
mark a. foltz
Ping on open code review.
4 years, 1 month ago (2016-11-03 17:48:51 UTC) #17
imcheng
Sorry for the delay. Comments addressed. Regarding IssueInfo vs Issue: Copy constructor/assignment is used in ...
4 years, 1 month ago (2016-11-18 23:45:14 UTC) #18
mark a. foltz
LGTM with comments addressed. Thanks for adding typemapping and general cleanup. I am still a ...
4 years ago (2016-11-29 21:27:08 UTC) #19
imcheng
https://codereview.chromium.org/2176613003/diff/140001/chrome/browser/media/router/issue.h File chrome/browser/media/router/issue.h (right): https://codereview.chromium.org/2176613003/diff/140001/chrome/browser/media/router/issue.h#newcode32 chrome/browser/media/router/issue.h:32: // issues of lower severity may also be blocking. ...
4 years ago (2016-12-05 23:18:23 UTC) #21
imcheng
Adding more reviewers: msw: chrome/browser/ui/toolbar/* dcheng: chrome/browser/media/router/mojo/* (mojo ipc stuff)
4 years ago (2016-12-05 23:19:48 UTC) #24
mark a. foltz
https://codereview.chromium.org/2176613003/diff/140001/chrome/browser/media/router/mojo/media_router_struct_traits.h File chrome/browser/media/router/mojo/media_router_struct_traits.h (right): https://codereview.chromium.org/2176613003/diff/140001/chrome/browser/media/router/mojo/media_router_struct_traits.h#newcode127 chrome/browser/media/router/mojo/media_router_struct_traits.h:127: out->default_action = IssueActionFromMojo(default_action); On 2016/12/05 at 23:18:19, imcheng wrote: ...
4 years ago (2016-12-05 23:24:09 UTC) #25
dcheng
https://codereview.chromium.org/2176613003/diff/200001/chrome/browser/media/router/issue.h File chrome/browser/media/router/issue.h (right): https://codereview.chromium.org/2176613003/diff/200001/chrome/browser/media/router/issue.h#newcode12 chrome/browser/media/router/issue.h:12: #include "base/optional.h" Nit: remove this header, since it's not ...
4 years ago (2016-12-07 18:58:02 UTC) #28
imcheng
Thanks for the review. https://codereview.chromium.org/2176613003/diff/200001/chrome/browser/media/router/issue.h File chrome/browser/media/router/issue.h (right): https://codereview.chromium.org/2176613003/diff/200001/chrome/browser/media/router/issue.h#newcode12 chrome/browser/media/router/issue.h:12: #include "base/optional.h" On 2016/12/07 18:58:02, ...
4 years ago (2016-12-09 23:19:53 UTC) #29
imcheng
https://codereview.chromium.org/2176613003/diff/140001/chrome/browser/media/router/mojo/media_router_struct_traits.h File chrome/browser/media/router/mojo/media_router_struct_traits.h (right): https://codereview.chromium.org/2176613003/diff/140001/chrome/browser/media/router/mojo/media_router_struct_traits.h#newcode127 chrome/browser/media/router/mojo/media_router_struct_traits.h:127: out->default_action = IssueActionFromMojo(default_action); On 2016/12/05 23:24:09, mark a. foltz ...
4 years ago (2016-12-09 23:28:41 UTC) #30
dcheng
On 2016/12/09 23:28:41, imcheng wrote: > https://codereview.chromium.org/2176613003/diff/140001/chrome/browser/media/router/mojo/media_router_struct_traits.h > File chrome/browser/media/router/mojo/media_router_struct_traits.h (right): > > https://codereview.chromium.org/2176613003/diff/140001/chrome/browser/media/router/mojo/media_router_struct_traits.h#newcode127 > ...
4 years ago (2016-12-12 01:45:36 UTC) #31
imcheng
https://codereview.chromium.org/2176613003/diff/200001/chrome/browser/media/router/mojo/media_router_struct_traits.h File chrome/browser/media/router/mojo/media_router_struct_traits.h (right): https://codereview.chromium.org/2176613003/diff/200001/chrome/browser/media/router/mojo/media_router_struct_traits.h#newcode119 chrome/browser/media/router/mojo/media_router_struct_traits.h:119: media_router::IssueInfo* out) { On 2016/12/12 01:45:36, dcheng wrote: > ...
4 years ago (2016-12-12 19:09:12 UTC) #32
dcheng
https://codereview.chromium.org/2176613003/diff/240001/chrome/browser/media/router/mojo/media_router_struct_traits.cc File chrome/browser/media/router/mojo/media_router_struct_traits.cc (right): https://codereview.chromium.org/2176613003/diff/240001/chrome/browser/media/router/mojo/media_router_struct_traits.cc#newcode16 chrome/browser/media/router/mojo/media_router_struct_traits.cc:16: media_router::mojom::Issue::ActionType default_action; I think you can avoid the manual ...
4 years ago (2016-12-12 20:59:56 UTC) #33
imcheng
https://codereview.chromium.org/2176613003/diff/240001/chrome/browser/media/router/mojo/media_router_struct_traits.cc File chrome/browser/media/router/mojo/media_router_struct_traits.cc (right): https://codereview.chromium.org/2176613003/diff/240001/chrome/browser/media/router/mojo/media_router_struct_traits.cc#newcode16 chrome/browser/media/router/mojo/media_router_struct_traits.cc:16: media_router::mojom::Issue::ActionType default_action; On 2016/12/12 20:59:56, dcheng wrote: > I ...
4 years ago (2016-12-12 22:40:01 UTC) #34
dcheng
https://codereview.chromium.org/2176613003/diff/240001/chrome/browser/media/router/mojo/media_router_struct_traits.cc File chrome/browser/media/router/mojo/media_router_struct_traits.cc (right): https://codereview.chromium.org/2176613003/diff/240001/chrome/browser/media/router/mojo/media_router_struct_traits.cc#newcode16 chrome/browser/media/router/mojo/media_router_struct_traits.cc:16: media_router::mojom::Issue::ActionType default_action; On 2016/12/12 22:40:01, imcheng wrote: > On ...
4 years ago (2016-12-13 00:46:38 UTC) #35
imcheng
https://codereview.chromium.org/2176613003/diff/240001/chrome/browser/media/router/mojo/media_router_struct_traits.cc File chrome/browser/media/router/mojo/media_router_struct_traits.cc (right): https://codereview.chromium.org/2176613003/diff/240001/chrome/browser/media/router/mojo/media_router_struct_traits.cc#newcode16 chrome/browser/media/router/mojo/media_router_struct_traits.cc:16: media_router::mojom::Issue::ActionType default_action; On 2016/12/13 00:46:38, dcheng wrote: > On ...
4 years ago (2016-12-13 00:51:45 UTC) #36
dcheng
LGTM with nits addressed https://codereview.chromium.org/2176613003/diff/260001/chrome/browser/media/router/mojo/media_router_struct_traits.h File chrome/browser/media/router/mojo/media_router_struct_traits.h (right): https://codereview.chromium.org/2176613003/diff/260001/chrome/browser/media/router/mojo/media_router_struct_traits.h#newcode26 chrome/browser/media/router/mojo/media_router_struct_traits.h:26: default: One final nit: remove ...
4 years ago (2016-12-13 01:13:33 UTC) #37
imcheng
msw@, can you please take a look at the toolbar code? https://codereview.chromium.org/2176613003/diff/260001/chrome/browser/media/router/mojo/media_router_struct_traits.h File chrome/browser/media/router/mojo/media_router_struct_traits.h (right): ...
4 years ago (2016-12-13 17:57:16 UTC) #38
dcheng
https://codereview.chromium.org/2176613003/diff/260001/chrome/browser/media/router/mojo/media_router_struct_traits.h File chrome/browser/media/router/mojo/media_router_struct_traits.h (right): https://codereview.chromium.org/2176613003/diff/260001/chrome/browser/media/router/mojo/media_router_struct_traits.h#newcode26 chrome/browser/media/router/mojo/media_router_struct_traits.h:26: default: On 2016/12/13 17:57:16, imcheng wrote: > On 2016/12/13 ...
4 years ago (2016-12-13 18:00:50 UTC) #39
dcheng
On 2016/12/13 18:00:50, dcheng wrote: > https://codereview.chromium.org/2176613003/diff/260001/chrome/browser/media/router/mojo/media_router_struct_traits.h > File chrome/browser/media/router/mojo/media_router_struct_traits.h (right): > > https://codereview.chromium.org/2176613003/diff/260001/chrome/browser/media/router/mojo/media_router_struct_traits.h#newcode26 > ...
4 years ago (2016-12-13 18:07:22 UTC) #40
msw
https://codereview.chromium.org/2176613003/diff/260001/chrome/browser/ui/toolbar/media_router_action.cc File chrome/browser/ui/toolbar/media_router_action.cc (right): https://codereview.chromium.org/2176613003/diff/260001/chrome/browser/ui/toolbar/media_router_action.cc#newcode274 chrome/browser/ui/toolbar/media_router_action.cc:274: media_router::IssueInfo::Severity severity = current_issue_->severity; optional nit: just inline current_issue_->severity ...
4 years ago (2016-12-13 18:45:40 UTC) #41
imcheng
https://codereview.chromium.org/2176613003/diff/260001/chrome/browser/media/router/mojo/media_router_struct_traits.h File chrome/browser/media/router/mojo/media_router_struct_traits.h (right): https://codereview.chromium.org/2176613003/diff/260001/chrome/browser/media/router/mojo/media_router_struct_traits.h#newcode26 chrome/browser/media/router/mojo/media_router_struct_traits.h:26: default: On 2016/12/13 18:00:49, dcheng wrote: > On 2016/12/13 ...
4 years ago (2016-12-13 19:22:47 UTC) #42
msw
lgtm with a q https://codereview.chromium.org/2176613003/diff/280001/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc File chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc (right): https://codereview.chromium.org/2176613003/diff/280001/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc#newcode212 chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc:212: issue_action_type_num <= q: why change ...
4 years ago (2016-12-13 19:35:11 UTC) #43
imcheng
https://codereview.chromium.org/2176613003/diff/280001/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc File chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc (right): https://codereview.chromium.org/2176613003/diff/280001/chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc#newcode212 chrome/browser/ui/webui/media_router/media_router_webui_message_handler.cc:212: issue_action_type_num <= On 2016/12/13 19:35:11, msw wrote: > q: ...
4 years ago (2016-12-13 19:54:17 UTC) #44
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/2176613003/320001
4 years ago (2016-12-13 22:50:16 UTC) #57
commit-bot: I haz the power
Committed patchset #17 (id:320001)
4 years ago (2016-12-13 22:57:05 UTC) #60
commit-bot: I haz the power
4 years ago (2016-12-13 22:59:47 UTC) #62
Message was sent while issue was closed.
Patchset 17 (id:??) landed as
https://crrev.com/466a89e738c071195c6bdbe9fe06ce871ead7a9f
Cr-Commit-Position: refs/heads/master@{#438321}

Powered by Google App Engine
This is Rietveld 408576698