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

Unified Diff: chrome/browser/media/router/issue.cc

Issue 2176613003: [Media Router] Clean up issues related code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media/router/issue.cc
diff --git a/chrome/browser/media/router/issue.cc b/chrome/browser/media/router/issue.cc
index 0dd3488c63b7b60a9904e79744228d9aa5731bb2..5af7770dfc0975b01a5ba0bb3da4beb59ca8f55c 100644
--- a/chrome/browser/media/router/issue.cc
+++ b/chrome/browser/media/router/issue.cc
@@ -2,49 +2,35 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/guid.h"
#include "chrome/browser/media/router/issue.h"
namespace media_router {
-IssueAction::IssueAction(const IssueAction::Type type) : type_(type) {
-}
-
-IssueAction::~IssueAction() {
+namespace {
+// ID generator for Issues.
+Issue::Id next_issue_id = 0;
mark a. foltz 2016/07/27 18:52:03 Please use a threadsafe sequence number: https://
imcheng 2016/09/13 20:27:54 Done in IssueManager.
}
Issue::Issue(const std::string& title,
- const std::string& message,
- const IssueAction& default_action,
- const std::vector<IssueAction>& secondary_actions,
- const MediaRoute::Id& route_id,
- const Issue::Severity severity,
- bool is_blocking,
- int help_page_id)
- : title_(title),
- message_(message),
+ const ActionType& default_action,
+ Severity severity)
+ : id_(next_issue_id++),
+ title_(title),
default_action_(default_action),
- secondary_actions_(secondary_actions),
- route_id_(route_id),
severity_(severity),
- id_(base::GenerateGUID()),
- is_blocking_(is_blocking),
- help_page_id_(help_page_id) {
- DCHECK(!title_.empty());
- DCHECK(severity_ != FATAL || is_blocking_) << "Severity is " << severity_;
-
- // Check that the default and secondary actions are not of the same type.
- if (!secondary_actions_.empty())
- DCHECK_NE(default_action_.type(), secondary_actions_[0].type());
-}
+ is_blocking_(false),
+ help_page_id_(-1) {}
Issue::Issue(const Issue& other) = default;
-Issue::~Issue() {
+Issue::~Issue() = default;
+
+bool Issue::IsBlocking() const {
+ return severity_ == Issue::Severity::FATAL || is_blocking_;
mark a. foltz 2016/07/27 18:52:03 or initialize is_blocking_ to severity_ == Issue::
imcheng 2016/09/13 20:27:54 Done.
}
-bool Issue::Equals(const Issue& other) const {
- return id_ == other.id_;
+bool Issue::IsGlobal() const {
+ return route_id_.empty();
}
} // namespace media_router

Powered by Google App Engine
This is Rietveld 408576698