| 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 #include "extensions/browser/error_map.h" | 5 #include "extensions/browser/error_map.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 iter = list_.erase(iter); | 126 iter = list_.erase(iter); |
| 127 deleted = true; | 127 deleted = true; |
| 128 } else { | 128 } else { |
| 129 ++iter; | 129 ++iter; |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 return deleted; | 132 return deleted; |
| 133 } | 133 } |
| 134 | 134 |
| 135 void ErrorMap::ExtensionEntry::DeleteAllErrors() { | 135 void ErrorMap::ExtensionEntry::DeleteAllErrors() { |
| 136 STLDeleteContainerPointers(list_.begin(), list_.end()); | 136 base::STLDeleteContainerPointers(list_.begin(), list_.end()); |
| 137 list_.clear(); | 137 list_.clear(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 const ExtensionError* ErrorMap::ExtensionEntry::AddError( | 140 const ExtensionError* ErrorMap::ExtensionEntry::AddError( |
| 141 std::unique_ptr<ExtensionError> error) { | 141 std::unique_ptr<ExtensionError> error) { |
| 142 for (ErrorList::iterator iter = list_.begin(); iter != list_.end(); ++iter) { | 142 for (ErrorList::iterator iter = list_.begin(); iter != list_.end(); ++iter) { |
| 143 // If we find a duplicate error, remove the old error and add the new one, | 143 // If we find a duplicate error, remove the old error and add the new one, |
| 144 // incrementing the occurrence count of the error. We use the new error | 144 // incrementing the occurrence count of the error. We use the new error |
| 145 // for runtime errors, so we can link to the latest context, inspectable | 145 // for runtime errors, so we can link to the latest context, inspectable |
| 146 // view, etc. | 146 // view, etc. |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 } | 208 } |
| 209 } | 209 } |
| 210 | 210 |
| 211 void ErrorMap::RemoveAllErrors() { | 211 void ErrorMap::RemoveAllErrors() { |
| 212 for (EntryMap::iterator iter = map_.begin(); iter != map_.end(); ++iter) | 212 for (EntryMap::iterator iter = map_.begin(); iter != map_.end(); ++iter) |
| 213 delete iter->second; | 213 delete iter->second; |
| 214 map_.clear(); | 214 map_.clear(); |
| 215 } | 215 } |
| 216 | 216 |
| 217 } // namespace extensions | 217 } // namespace extensions |
| OLD | NEW |