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

Unified Diff: components/os_crypt/os_crypt_posix.cc

Issue 2136453004: Reland of place 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 | « components/leveldb/env_mojo.cc ('k') | components/sync_sessions/favicon_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/os_crypt/os_crypt_posix.cc
diff --git a/components/os_crypt/os_crypt_posix.cc b/components/os_crypt/os_crypt_posix.cc
index 44f04b3801fead7d45d2758260c9721db6bf9334..24a411e9bd6b1461e4f942f0723ed97b8eaa22e3 100644
--- a/components/os_crypt/os_crypt_posix.cc
+++ b/components/os_crypt/os_crypt_posix.cc
@@ -9,6 +9,7 @@
#include <memory>
#include "base/logging.h"
+#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "crypto/encryptor.h"
#include "crypto/symmetric_key.h"
@@ -118,7 +119,8 @@
// old data saved as clear text and we'll return it directly.
// Credit card numbers are current legacy data, so false match with prefix
// won't happen.
- if (ciphertext.find(kObfuscationPrefix) != 0) {
+ if (!base::StartsWith(ciphertext, kObfuscationPrefix,
+ base::CompareCase::SENSITIVE)) {
*plaintext = ciphertext;
return true;
}
« no previous file with comments | « components/leveldb/env_mojo.cc ('k') | components/sync_sessions/favicon_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698