Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(590)

Unified Diff: components/proximity_auth/webui/proximity_auth_webui_handler.cc

Issue 2962173002: ProximityAuthWebUIHandler: use the same ExternalDeviceInfo vector across iterator usages. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/proximity_auth/webui/proximity_auth_webui_handler.cc
diff --git a/components/proximity_auth/webui/proximity_auth_webui_handler.cc b/components/proximity_auth/webui/proximity_auth_webui_handler.cc
index a2fccec948fe109499804f2718e09a62a630bc38..ec4fcc149405afc283dd2a94cdd2eec15a7981dd 100644
--- a/components/proximity_auth/webui/proximity_auth_webui_handler.cc
+++ b/components/proximity_auth/webui/proximity_auth_webui_handler.cc
@@ -539,14 +539,15 @@ ProximityAuthWebUIHandler::ExternalDeviceInfoToDictionary(
// the corresponding local device data (e.g. connection status and remote
// status updates).
std::string public_key = device_info.public_key();
+ std::vector<cryptauth::ExternalDeviceInfo> unlock_keys =
+ device_manager->GetUnlockKeys();
auto iterator = std::find_if(
- device_manager->GetUnlockKeys().begin(),
- device_manager->GetUnlockKeys().end(),
+ unlock_keys.begin(), unlock_keys.end(),
[&public_key](const cryptauth::ExternalDeviceInfo& unlock_key) {
return unlock_key.public_key() == public_key;
});
- if (iterator == device_manager->GetUnlockKeys().end() ||
+ if (iterator == unlock_keys.end() ||
selected_remote_device_.public_key != device_info.public_key())
return dictionary;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698