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

Unified Diff: components/sync_sessions/favicon_cache_unittest.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/os_crypt/os_crypt_posix.cc ('k') | content/browser/dom_storage/session_storage_database.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync_sessions/favicon_cache_unittest.cc
diff --git a/components/sync_sessions/favicon_cache_unittest.cc b/components/sync_sessions/favicon_cache_unittest.cc
index 0eb20923ed9af5384fed9c0151b2a265ca040187..b2aac8caee18530076b8c01c369096274bda8e5a 100644
--- a/components/sync_sessions/favicon_cache_unittest.cc
+++ b/components/sync_sessions/favicon_cache_unittest.cc
@@ -11,6 +11,7 @@
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "sync/api/attachments/attachment_id.h"
@@ -244,7 +245,7 @@
std::string tag = syncer::SyncDataLocal(change.sync_data()).GetTag();
const std::string kPrefix = "http://bla.com/";
const std::string kSuffix = ".ico";
- if (tag.find(kPrefix) != 0)
+ if (!base::StartsWith(tag, kPrefix, base::CompareCase::SENSITIVE))
return -1;
std::string temp = tag.substr(kPrefix.length());
if (temp.rfind(kSuffix) <= 0)
« no previous file with comments | « components/os_crypt/os_crypt_posix.cc ('k') | content/browser/dom_storage/session_storage_database.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698