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

Unified Diff: ios/web/webui/url_data_manager_ios_backend.mm

Issue 2945803002: Use ContainsValue() instead of std::find() in ios/ (Closed)
Patch Set: Fixed compilation error. 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 | « ios/web/webui/url_data_manager_ios.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/webui/url_data_manager_ios_backend.mm
diff --git a/ios/web/webui/url_data_manager_ios_backend.mm b/ios/web/webui/url_data_manager_ios_backend.mm
index a2b618ba6fe01588a104311ea7196d5420d6aee7..519f4ba0dd8d5aad5ec38f49a6074c6138e26a63 100644
--- a/ios/web/webui/url_data_manager_ios_backend.mm
+++ b/ios/web/webui/url_data_manager_ios_backend.mm
@@ -18,6 +18,7 @@
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/single_thread_task_runner.h"
+#include "base/stl_util.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
@@ -53,17 +54,12 @@ const char kChromeURLContentSecurityPolicyHeaderBase[] =
const char kChromeURLXFrameOptionsHeader[] = "X-Frame-Options: DENY";
-bool SchemeIsInSchemes(const std::string& scheme,
- const std::vector<std::string>& schemes) {
- return std::find(schemes.begin(), schemes.end(), scheme) != schemes.end();
-}
-
// Returns whether |url| passes some sanity checks and is a valid GURL.
bool CheckURLIsValid(const GURL& url) {
std::vector<std::string> additional_schemes;
DCHECK(GetWebClient()->IsAppSpecificURL(url) ||
(GetWebClient()->GetAdditionalWebUISchemes(&additional_schemes),
- SchemeIsInSchemes(url.scheme(), additional_schemes)));
+ base::ContainsValue(additional_schemes, url.scheme())));
if (!url.is_valid()) {
NOTREACHED();
« no previous file with comments | « ios/web/webui/url_data_manager_ios.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698