Chromium Code Reviews| Index: chrome/browser/media/router/issue_manager.h |
| diff --git a/chrome/browser/media/router/issue_manager.h b/chrome/browser/media/router/issue_manager.h |
| index 0c9ae27cb64b584a1269f6b997f92c16e60851ca..384b21489a13cc4533a22dad79677f1587c33323 100644 |
| --- a/chrome/browser/media/router/issue_manager.h |
| +++ b/chrome/browser/media/router/issue_manager.h |
| @@ -7,6 +7,7 @@ |
| #include <stddef.h> |
| +#include <memory> |
| #include <vector> |
| #include "base/containers/hash_tables.h" |
| @@ -26,26 +27,13 @@ class IssueManager { |
| ~IssueManager(); |
| // Adds an issue. |
| - // |issue|: Issue to be added. Must have unique ID. |
| - void AddIssue(const Issue& issue); |
| + // |issue_info|: Info of issue to be added. |
| + void AddIssue(const IssueInfo& issue_info); |
| // Removes an issue when user has noted it is resolved. |
| // |issue_id|: Issue::Id of the issue to be removed. |
| void ClearIssue(const Issue::Id& issue_id); |
| - // Gets the number of unresolved issues. |
| - size_t GetIssueCount() const; |
| - |
| - // Removes all unresolved issues. |
| - void ClearAllIssues(); |
| - |
| - // Removes all unresolved global issues. |
| - void ClearGlobalIssues(); |
| - |
| - // Removes all unresolved issues with RouteId. |
| - // |route_id|: ID of the media route whose issues are to be cleared. |
| - void ClearIssuesWithRouteId(const MediaRoute::Id& route_id); |
| - |
| // Registers an issue observer |observer|. The observer will be triggered |
| // when the highest priority issue changes. |
| // If there is already an observer registered with this instance, do nothing. |
| @@ -59,17 +47,17 @@ class IssueManager { |
| private: |
| // Checks if the current top issue has changed. Updates |top_issue_|. |
| - // If |top_issue_| has changed, issues in |issues_observers_| will be |
| + // If |top_issue_| has changed, observers in |issues_observers_| will be |
| // notified of the new top issue. |
| void MaybeUpdateTopIssue(); |
| - std::vector<Issue> issues_; |
| + std::vector<std::unique_ptr<Issue>> issues_; |
|
mark a. foltz
2016/10/18 17:16:52
Consider making this a set<unique_ptr<Issue>> with
imcheng
2016/11/18 23:45:13
I am inclined to keep this a vector for now since
|
| // IssueObserver insteances are not owned by the manager. |
| base::ObserverList<IssuesObserver> issues_observers_; |
| - // The ID of the current top issue. |
| - Issue::Id top_issue_id_; |
| + // The top Issue in |issues_|, or |nullptr| if there are none. |
|
mark a. foltz
2016/10/18 17:16:52
nit: s/are/is/
imcheng
2016/11/18 23:45:13
Done.
|
| + const Issue* top_issue_; |
| DISALLOW_COPY_AND_ASSIGN(IssueManager); |
| }; |