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

Unified Diff: extensions/browser/api/web_request/web_request_api.cc

Issue 2950263003: Use ContainsValue() instead of std::find() in extensions/ (Closed)
Patch Set: Rebase patch. 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 | « extensions/browser/api/socket/udp_socket.cc ('k') | extensions/browser/app_window/app_window_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/web_request/web_request_api.cc
diff --git a/extensions/browser/api/web_request/web_request_api.cc b/extensions/browser/api/web_request/web_request_api.cc
index 400b02f16842885c03248f7d9e1926cdcd855c8f..d898c33b0492dc551f3dae1e374fc29da9449f24 100644
--- a/extensions/browser/api/web_request/web_request_api.cc
+++ b/extensions/browser/api/web_request/web_request_api.cc
@@ -19,6 +19,7 @@
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
+#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -1488,8 +1489,7 @@ void ExtensionWebRequestEventRouter::GetMatchingListenersImpl(
}
const std::vector<WebRequestResourceType>& types = listener->filter.types;
- if (!types.empty() &&
- std::find(types.begin(), types.end(), resource_type) == types.end()) {
+ if (!types.empty() && !base::ContainsValue(types, resource_type)) {
continue;
}
« no previous file with comments | « extensions/browser/api/socket/udp_socket.cc ('k') | extensions/browser/app_window/app_window_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698