[clang-tidy] Apply modernize-use-auto in /components
This change applies clang-tidy's modernize-use-auto [1] in /components.
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]
Bug: 890902
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: Ibbb775036736e0b07c6ce5393569ed40878b5c62
Reviewed-on: https://chromium-review.googlesource.com/c/1257852
Reviewed-by: Jochen Eisinger <[email protected]>
Commit-Queue: Jan Wilken Dörrie <[email protected]>
Cr-Commit-Position: refs/heads/master@{#597078}
diff --git a/components/gcm_driver/gcm_driver.cc b/components/gcm_driver/gcm_driver.cc
index d026b733..8345ce3d 100644
--- a/components/gcm_driver/gcm_driver.cc
+++ b/components/gcm_driver/gcm_driver.cc
@@ -70,8 +70,7 @@
// finishes. We don't want to throw ASYNC_OPERATION_PENDING when the user
// uninstalls an app (ungistering) and then reinstalls the app again
// (registering).
- std::map<std::string, UnregisterCallback>::iterator unregister_iter =
- unregister_callbacks_.find(app_id);
+ auto unregister_iter = unregister_callbacks_.find(app_id);
if (unregister_iter != unregister_callbacks_.end()) {
// Replace the original unregister callback with an intermediate callback
// that will invoke the original unregister callback and trigger the pending
@@ -172,8 +171,7 @@
void GCMDriver::RegisterFinished(const std::string& app_id,
const std::string& registration_id,
GCMClient::Result result) {
- std::map<std::string, RegisterCallback>::iterator callback_iter =
- register_callbacks_.find(app_id);
+ auto callback_iter = register_callbacks_.find(app_id);
if (callback_iter == register_callbacks_.end()) {
// The callback could have been removed when the app is uninstalled.
return;
@@ -194,8 +192,7 @@
void GCMDriver::UnregisterFinished(const std::string& app_id,
GCMClient::Result result) {
- std::map<std::string, UnregisterCallback>::iterator callback_iter =
- unregister_callbacks_.find(app_id);
+ auto callback_iter = unregister_callbacks_.find(app_id);
if (callback_iter == unregister_callbacks_.end())
return;
@@ -207,9 +204,8 @@
void GCMDriver::SendFinished(const std::string& app_id,
const std::string& message_id,
GCMClient::Result result) {
- std::map<std::pair<std::string, std::string>, SendCallback>::iterator
- callback_iter = send_callbacks_.find(
- std::pair<std::string, std::string>(app_id, message_id));
+ auto callback_iter = send_callbacks_.find(
+ std::pair<std::string, std::string>(app_id, message_id));
if (callback_iter == send_callbacks_.end()) {
// The callback could have been removed when the app is uninstalled.
return;