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

Unified Diff: chrome/browser/chromeos/profiles/profile_helper.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
Index: chrome/browser/chromeos/profiles/profile_helper.cc
diff --git a/chrome/browser/chromeos/profiles/profile_helper.cc b/chrome/browser/chromeos/profiles/profile_helper.cc
index 91ff48c42cd6d40251e1c900dc529c808b52e049..08c4058c313c559c6f027ec55a996e65d74a9345 100644
--- a/chrome/browser/chromeos/profiles/profile_helper.cc
+++ b/chrome/browser/chromeos/profiles/profile_helper.cc
@@ -7,7 +7,6 @@
#include "base/barrier_closure.h"
#include "base/callback.h"
#include "base/command_line.h"
-#include "base/strings/string_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browsing_data/browsing_data_helper.h"
#include "chrome/browser/browsing_data/browsing_data_remover.h"
@@ -139,12 +138,13 @@
// Check that profile directory starts with the correct prefix.
std::string prefix(chrome::kProfileDirPrefix);
- if (!base::StartsWith(profile_dir, prefix, base::CompareCase::SENSITIVE)) {
+ if (profile_dir.find(prefix) != 0) {
// This happens when creating a TestingProfile in browser tests.
return std::string();
}
- return profile_dir.substr(prefix.length());
+ return profile_dir.substr(prefix.length(),
+ profile_dir.length() - prefix.length());
}
// static
« no previous file with comments | « chrome/browser/apps/guest_view/web_view_browsertest.cc ('k') | chrome/browser/download/download_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698