Upstream the Media Router's Issue class.
Issues contain status and error information and are propagated from Media Route Providers to the Media Router, and are presented to the user in the UI.
Let me know if you have any questions about this. Thanks.
BUG=464216R=dalecurtis@chromium.org
Committed: https://crrev.com/7c17dcdabaacd30035b9c09e76a276ccacae60a1
Cr-Commit-Position: refs/heads/master@{#328249}
5 years, 7 months ago
(2015-05-01 17:59:18 UTC)
#11
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
File chrome/browser/media/router/issue.cc (right):
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
chrome/browser/media/router/issue.cc:34: DCHECK(severity_ != FATAL ||
is_blocking_);
On 2015/04/30 18:18:14, DaleCurtis wrote:
> If you don't split this DCHECK() out the contents of those variables may be
> lost. I recommend adding a "<<" which prints the values to the DCHECK, a la:
>
> DCHECK(severity_ != FATAL || is_blocking_) << "Severity is: " << severity_
>
> etc.
Great point. Fixed.
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
chrome/browser/media/router/issue.cc:38: DCHECK(default_action_.type() !=
secondary_actions_[0].type());
On 2015/04/30 18:18:14, DaleCurtis wrote:
> DCHECK_NE
Done.
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
File chrome/browser/media/router/issue.h (right):
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
chrome/browser/media/router/issue.h:16: using IssueId = std::string;
On 2015/04/30 18:18:14, DaleCurtis wrote:
> I'm wary of having this live outside of a class definition, you're defining
> media_router::IssueId for everyone including this header. Is that what you
want?
>
> Also is it worth having a specialized IssueId type? It's just an std::string
:)
Moved it into Issue.
Regarding specialized IssueIds: we decided to use aliases for IDs across the
Media Router codebase to make the function signatures self-documenting and to
allow for easier transitioning to other types such as structs down the line.
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
chrome/browser/media/router/issue.h:68: Severity severity() const { return
severity_; }
On 2015/04/30 19:02:06, apacible wrote:
> nit: Can you put these in the same order as the parameters and member
variables?
Done.
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
chrome/browser/media/router/issue.h:76: bool IsBlocking() const;
On 2015/04/30 19:05:02, DaleCurtis wrote:
> On 2015/04/30 19:02:06, apacible wrote:
> > On 2015/04/30 18:18:15, DaleCurtis wrote:
> > > Seems like these should be hacker style too?
> >
> > What does hacker style mean?
>
> hacker_style()
Done.
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
chrome/browser/media/router/issue.h:92: const GURL help_url_;
On 2015/04/30 18:18:14, DaleCurtis wrote:
> Const values will prevent copyable classes. Is that intended? If so please add
> DISALLOW_COPY_AND_ASSIGN() to each of these classes.
Done for this class.
Re: IssueAction, it needs to remain copyable and assignable for compatibility
with STL containers, so in that case I left the implicit ctors intact.
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
File chrome/browser/media/router/issue_manager.cc (right):
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
chrome/browser/media/router/issue_manager.cc:93: while (it !=
media_issue_map_.end()) {
On 2015/04/30 18:18:15, DaleCurtis wrote:
> Seems like you might want some form of a priority based heap instead of having
> to iterate over the map every time.
Hmmm. There are multiple different access patterns which complicate the choice
of an efficient single container. MaybeUpdateTopIssue could use a minheap,
ClearIssuesWithRouteId/ClearGlobalIssues perform an exhaustive linear search,
and ClearIssue/AddIssue could take advantage of map lookups. Can't make
everything happy, so I'll just go with a std::list here instead. apacible@,
PTAL.
(I checked with haibinlu@ and he said that the collection will likely only have
0-10 elements, anyways.)
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
File chrome/browser/media/router/issue_manager.h (right):
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
chrome/browser/media/router/issue_manager.h:51: void
RegisterObserver(IssuesObserver* observer);
On 2015/04/30 18:18:15, DaleCurtis wrote:
> Is it IssueObserver in that each observer will be called for every issue, or
> IssuesObserver where each observer may be called for multiple issues at once?
PTAL at the newest comments, hopefully it is clearer now.
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
File chrome/browser/media/router/issue_unittest.cc (right):
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/ro...
chrome/browser/media/router/issue_unittest.cc:12: class IssueUnitTest : public
::testing::Test {
On 2015/04/30 18:18:15, DaleCurtis wrote:
> Just use TEST() instead of TEST_F() and you can remove this.
Done.
apacible
https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/router/issue_manager.cc File chrome/browser/media/router/issue_manager.cc (right): https://codereview.chromium.org/1103273013/diff/20001/chrome/browser/media/router/issue_manager.cc#newcode93 chrome/browser/media/router/issue_manager.cc:93: while (it != media_issue_map_.end()) { On 2015/05/01 17:59:18, Kevin ...
5 years, 7 months ago
(2015-05-01 20:18:09 UTC)
#12
https://codereview.chromium.org/1103273013/diff/80001/chrome/browser/media/router/issue.cc File chrome/browser/media/router/issue.cc (right): https://codereview.chromium.org/1103273013/diff/80001/chrome/browser/media/router/issue.cc#newcode44 chrome/browser/media/router/issue.cc:44: bool Issue::is_blocking() const { These have to go into ...
5 years, 7 months ago
(2015-05-02 18:13:33 UTC)
#14
https://codereview.chromium.org/1103273013/diff/100001/chrome/browser/media/router/issue.h File chrome/browser/media/router/issue.h (right): https://codereview.chromium.org/1103273013/diff/100001/chrome/browser/media/router/issue.h#newcode71 chrome/browser/media/router/issue.h:71: bool is_blocking() const { Nit: Can this fit into ...
5 years, 7 months ago
(2015-05-04 21:14:32 UTC)
#17
Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32_ng/builds/49352) ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, ...
5 years, 7 months ago
(2015-05-05 00:08:33 UTC)
#25
Issue 1103273013: Upstream the Media Router's Issue class.
(Closed)
Created 5 years, 7 months ago by Kevin M
Modified 5 years, 7 months ago
Reviewers: DaleCurtis, Kevin Marshall, apacible
Base URL: https://chromium.googlesource.com/chromium/src.git@master
Comments: 44