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

Unified Diff: chrome/test/chromedriver/server/chromedriver_server.cc

Issue 2950803002: Use ContainsValue() instead of std::find() in chrome/browser/ and chrome/test/ (Closed)
Patch Set: Reverted code for file thumbnail_cache.cc 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 | « chrome/browser/safe_browsing/local_database_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/server/chromedriver_server.cc
diff --git a/chrome/test/chromedriver/server/chromedriver_server.cc b/chrome/test/chromedriver/server/chromedriver_server.cc
index d0ad749878dcd03883a724eb5277d4ba274a6442..7df71ce89fbd835b127b3ab0cffca8312dd1bf84 100644
--- a/chrome/test/chromedriver/server/chromedriver_server.cc
+++ b/chrome/test/chromedriver/server/chromedriver_server.cc
@@ -23,6 +23,7 @@
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -145,8 +146,7 @@ void HandleRequestOnCmdThread(
if (!whitelisted_ips.empty()) {
std::string peer_address = request.peer.ToStringWithoutPort();
if (peer_address != net::IPAddress::IPv4Localhost().ToString() &&
- std::find(whitelisted_ips.begin(), whitelisted_ips.end(),
- peer_address) == whitelisted_ips.end()) {
+ !base::ContainsValue(whitelisted_ips, peer_address)) {
LOG(WARNING) << "unauthorized access from " << request.peer.ToString();
std::unique_ptr<net::HttpServerResponseInfo> response(
new net::HttpServerResponseInfo(net::HTTP_UNAUTHORIZED));
« no previous file with comments | « chrome/browser/safe_browsing/local_database_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698