Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_BROWSER_ERROR_MAP_H_ | 5 #ifndef EXTENSIONS_BROWSER_ERROR_MAP_H_ |
| 6 #define EXTENSIONS_BROWSER_ERROR_MAP_H_ | 6 #define EXTENSIONS_BROWSER_ERROR_MAP_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 const std::set<int> restrict_to_ids; | 53 const std::set<int> restrict_to_ids; |
| 54 const bool restrict_to_incognito; | 54 const bool restrict_to_incognito; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 // Return the list of all errors associated with the given extension. | 57 // Return the list of all errors associated with the given extension. |
| 58 const ErrorList& GetErrorsForExtension(const std::string& extension_id) const; | 58 const ErrorList& GetErrorsForExtension(const std::string& extension_id) const; |
| 59 | 59 |
| 60 // Add the |error| to the ErrorMap. | 60 // Add the |error| to the ErrorMap. |
| 61 const ExtensionError* AddError(scoped_ptr<ExtensionError> error); | 61 const ExtensionError* AddError(scoped_ptr<ExtensionError> error); |
| 62 | 62 |
| 63 // Removes errors that match the given |filter| from the map. | 63 // Removes errors that match the given |filter| from the map. |
|
Dan Beam
2015/03/31 00:33:50
nit: update to include |affected_ids|
Devlin
2015/03/31 16:17:51
Done.
| |
| 64 void RemoveErrors(const Filter& filter); | 64 void RemoveErrors(const Filter& filter, std::set<std::string>* affected_ids); |
| 65 | 65 |
| 66 // Remove all errors for all extensions, and clear the map. | 66 // Remove all errors for all extensions, and clear the map. |
| 67 void RemoveAllErrors(); | 67 void RemoveAllErrors(); |
| 68 | 68 |
| 69 size_t size() const { return map_.size(); } | 69 size_t size() const { return map_.size(); } |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 // An Entry is created for each Extension ID, and stores the errors related to | 72 // An Entry is created for each Extension ID, and stores the errors related to |
| 73 // that Extension. | 73 // that Extension. |
| 74 class ExtensionEntry; | 74 class ExtensionEntry; |
| 75 using EntryMap = std::map<std::string, ExtensionEntry*>; | 75 using EntryMap = std::map<std::string, ExtensionEntry*>; |
| 76 | 76 |
| 77 // The mapping between Extension IDs and their corresponding Entries. | 77 // The mapping between Extension IDs and their corresponding Entries. |
| 78 EntryMap map_; | 78 EntryMap map_; |
| 79 | 79 |
| 80 DISALLOW_COPY_AND_ASSIGN(ErrorMap); | 80 DISALLOW_COPY_AND_ASSIGN(ErrorMap); |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 } // namespace extensions | 83 } // namespace extensions |
| 84 | 84 |
| 85 #endif // EXTENSIONS_BROWSER_ERROR_MAP_H_ | 85 #endif // EXTENSIONS_BROWSER_ERROR_MAP_H_ |
| OLD | NEW |