[clang-tidy] Apply modernize-use-auto in /extensions
This change applies clang-tidy's modernize-use-auto [1] in /extensions.
This change does not rewrite new and cast expressions.
Reproduction steps:
- run clang-tidy's modernize-use-auto
- run git cl format
- manually remove unused typedefs due to -Wunused-local-typedef error
[1] https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-auto.html
This CL was uploaded by git cl split.
[email protected], [email protected]
Bug: 890902
Change-Id: I30bac79917a19d7628b517137130a2da228e6509
Reviewed-on: https://chromium-review.googlesource.com/c/1257845
Commit-Queue: Jan Wilken Dörrie <[email protected]>
Reviewed-by: Dominick Ng <[email protected]>
Reviewed-by: Istiaque Ahmed <[email protected]>
Reviewed-by: Chris Palmer <[email protected]>
Cr-Commit-Position: refs/heads/master@{#598262}
diff --git a/extensions/browser/warning_service.cc b/extensions/browser/warning_service.cc
index 1f5cf12..ea53c8c 100644
--- a/extensions/browser/warning_service.cc
+++ b/extensions/browser/warning_service.cc
@@ -36,8 +36,7 @@
const std::set<Warning::WarningType>& types) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
ExtensionIdSet affected_extensions;
- for (WarningSet::iterator i = warnings_.begin();
- i != warnings_.end();) {
+ for (auto i = warnings_.begin(); i != warnings_.end();) {
if (types.find(i->warning_type()) != types.end()) {
affected_extensions.insert(i->extension_id());
warnings_.erase(i++);
@@ -54,8 +53,7 @@
GetWarningTypesAffectingExtension(const std::string& extension_id) const {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
std::set<Warning::WarningType> result;
- for (WarningSet::const_iterator i = warnings_.begin();
- i != warnings_.end(); ++i) {
+ for (auto i = warnings_.cbegin(); i != warnings_.cend(); ++i) {
if (i->extension_id() == extension_id)
result.insert(i->warning_type());
}
@@ -70,8 +68,7 @@
const ExtensionSet& extension_set =
ExtensionRegistry::Get(browser_context_)->enabled_extensions();
- for (WarningSet::const_iterator i = warnings_.begin();
- i != warnings_.end(); ++i) {
+ for (auto i = warnings_.cbegin(); i != warnings_.cend(); ++i) {
if (i->extension_id() == extension_id)
result.push_back(i->GetLocalizedMessage(&extension_set));
}