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

Unified Diff: components/devtools_http_handler/devtools_http_handler.cc

Issue 2131933002: Revert of Replace string::find(prefix) == 0 pattern with base::StartsWith(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « chromeos/settings/timezone_settings.cc ('k') | components/leveldb/env_mojo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/devtools_http_handler/devtools_http_handler.cc
diff --git a/components/devtools_http_handler/devtools_http_handler.cc b/components/devtools_http_handler/devtools_http_handler.cc
index 48f58113f39bb67483a0b184aa629a91c565e184..38f32dc1da2ebbc96522612e23e131b1edc069dd 100644
--- a/components/devtools_http_handler/devtools_http_handler.cc
+++ b/components/devtools_http_handler/devtools_http_handler.cc
@@ -395,7 +395,7 @@
const net::HttpServerRequestInfo& info) {
server_->SetSendBufferSize(connection_id, kSendBufferSizeForDevTools);
- if (base::StartsWith(info.path, "/json", base::CompareCase::SENSITIVE)) {
+ if (info.path.find("/json") == 0) {
BrowserThread::PostTask(
BrowserThread::UI,
FROM_HERE,
@@ -406,8 +406,7 @@
return;
}
- if (base::StartsWith(info.path, kThumbUrlPrefix,
- base::CompareCase::SENSITIVE)) {
+ if (info.path.find(kThumbUrlPrefix) == 0) {
// Thumbnail request.
const std::string target_id = info.path.substr(strlen(kThumbUrlPrefix));
BrowserThread::PostTask(
@@ -431,8 +430,7 @@
return;
}
- if (!base::StartsWith(info.path, "/devtools/",
- base::CompareCase::SENSITIVE)) {
+ if (info.path.find("/devtools/") != 0) {
server_->Send404(connection_id);
return;
}
@@ -519,7 +517,7 @@
return true;
}
- if (!base::StartsWith(path, "/", base::CompareCase::SENSITIVE)) {
+ if (path.find("/") != 0) {
// Malformed command.
return false;
}
@@ -698,8 +696,8 @@
return;
std::string browser_prefix = "/devtools/browser";
- if (base::StartsWith(request.path, browser_prefix,
- base::CompareCase::SENSITIVE)) {
+ size_t browser_pos = request.path.find(browser_prefix);
+ if (browser_pos == 0) {
scoped_refptr<DevToolsAgentHost> browser_agent =
DevToolsAgentHost::CreateForBrowser(
thread_->task_runner(),
@@ -723,8 +721,8 @@
return;
}
- if (!base::StartsWith(request.path, kPageUrlPrefix,
- base::CompareCase::SENSITIVE)) {
+ size_t pos = request.path.find(kPageUrlPrefix);
+ if (pos != 0) {
Send404(connection_id);
return;
}
« no previous file with comments | « chromeos/settings/timezone_settings.cc ('k') | components/leveldb/env_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698