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

Unified Diff: base/string_util.cc

Issue 192065: Merge 25487 - Strip .plugin off of Mac plugin names when showing the crash in... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 3 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 | « base/string_util.h ('k') | base/string_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/string_util.cc
===================================================================
--- base/string_util.cc (revision 25852)
+++ base/string_util.cc (working copy)
@@ -744,6 +744,22 @@
}
}
+bool EndsWith(const std::wstring& str,
+ const std::wstring& search,
+ bool case_sensitive) {
+ std::wstring::size_type str_length = str.length();
+ std::wstring::size_type search_length = search.length();
+ if (search_length > str_length)
+ return false;
+ if (case_sensitive) {
+ return str.compare(str_length - search_length, search_length, search) == 0;
+ } else {
+ return std::equal(search.begin(), search.end(),
+ str.begin() + (str_length - search_length),
+ CaseInsensitiveCompare<wchar_t>());
+ }
+}
+
DataUnits GetByteDisplayUnits(int64 bytes) {
// The byte thresholds at which we display amounts. A byte count is displayed
// in unit U when kUnitThresholds[U] <= bytes < kUnitThresholds[U+1].
Property changes on: base\string_util.cc
___________________________________________________________________
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/base/string_util.cc:r69-2775
Merged /trunk/src/base/string_util.cc:r25487
« no previous file with comments | « base/string_util.h ('k') | base/string_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698