summaryrefslogtreecommitdiffstats
path: root/base/strings
Commit message (Collapse)AuthorAgeFilesLines
* Add base::SizeTToString.wtc@chromium.org2014-06-273-7/+37
| | | | | | | | | | Change some users of base::Uint64ToString to base::SizeTToString. R=brettw@chromium.org,rlarocque@chromium.org Review URL: https://codereview.chromium.org/353693005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@280375 0039d316-1c4b-4281-b951-d872f2087c98
* Update the class comment for StringPiece to reflect the internal guidancerch@chromium.org2014-06-241-7/+12
| | | | | | | | that it is preferable to pass by value instead of by reference. Review URL: https://codereview.chromium.org/350753002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@279276 0039d316-1c4b-4281-b951-d872f2087c98
* Fix SafeSPrintfTest.Truncation in base_unittestsyang.gu@intel.com2014-06-181-2/+3
| | | | | | | | | | | | On 32-bit platform, the expected result for this test is address of 64-bit, while the actual result is address of 32-bit. So they don't match with each other. BUG=380492 Review URL: https://codereview.chromium.org/310323003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277986 0039d316-1c4b-4281-b951-d872f2087c98
* Make various string_util functions take StringPieces instead of char[].pkasting@chromium.org2014-05-302-49/+49
| | | | | | | | | | | | | | | This allows most callers to pass string literals or results of ASCIIToUTF16(), rather than construct error-prone character arrays that must be manually nul-terminated. Also cleans up various bits of the callers. BUG=104260 TEST=none Review URL: https://codereview.chromium.org/296593003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273765 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove EmptyWString and fix bad EmptyString usage.thestig@chromium.org2014-05-281-6/+1
| | | | | | Review URL: https://codereview.chromium.org/298023003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273216 0039d316-1c4b-4281-b951-d872f2087c98
* Move IsStringUTF8/ASCII to base namespacebrettw@chromium.org2014-05-072-17/+17
| | | | | | | | TBR=sky@chromium.org Review URL: https://codereview.chromium.org/270183002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268754 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Get rid of base::WideToUTF16Hack.thestig@chromium.org2014-05-061-7/+0
| | | | | | | | BUG=23581 Review URL: https://codereview.chromium.org/269613002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268499 0039d316-1c4b-4281-b951-d872f2087c98
* Omnibox: Highlight Matches in URLs Properlympearson@chromium.org2014-04-283-2/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we'd match the omnibox input against a cleaned-up version of the URL. Precisely, we'd remove the escaping and interpret as UTF8 (and lower-case it) so non-Latin characters can be matched correctly. This is all well and good, but then we'd take the offsets of those matches and use them to highlight segments of the original URL (properly escaped). Oops. At best this caused bad highlighting; at middle, it caused weirdness as we attempted to highlight the middle of a multi-string character; at worst, it'd cause crashes because our offsets calculation would put us in no-man's-land. This fixes all that. :-) Precisely, we keep track of the adjustments made during cleaning. We take the offsets where terms matched and apply them through the transformation in reverse. TBR=sky (as usual for history and bookmarks stuff that just change internals relative to how they behave with the omnibox) BUG=252630,359270 Review URL: https://codereview.chromium.org/255423002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266630 0039d316-1c4b-4281-b951-d872f2087c98
* Remove the WCHAR_T_IS_UNSIGNED definition since it is not really useful. ↵rmcilroy@chromium.org2014-04-251-7/+2
| | | | | | | | | | | Replace its use with a static_cast. BUG=354405 NOTRY=true Review URL: https://codereview.chromium.org/248843004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266058 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Get rid of base::UTF16ToWideHack.thestig@chromium.org2014-04-231-1/+0
| | | | | | | | BUG=23581 Review URL: https://codereview.chromium.org/246553002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265574 0039d316-1c4b-4281-b951-d872f2087c98
* UTF8 Adjustments for FormatURL(): Fix Overly-Aggressive DCHECKmpearson@chromium.org2014-04-231-4/+5
| | | | | | | | | | | | | | | This DCHECK is hard to understand, but now it's right. I'm okay with removing it if you think it's too confusing. TBR=willchan (no review necessary; just for owners approval. only mucks with tests.) BUG=365384 Review URL: https://codereview.chromium.org/248453003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265540 0039d316-1c4b-4281-b951-d872f2087c98
* Make FormatUrl Keep Track of Full Transformationmpearson@chromium.org2014-04-183-176/+329
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The omnibox providers usually search for matches in the formatted text (i.e., the escaped characters in the URL are unescaped before searching). This makes it difficult to highlight matches in URL because the location of the matched positions does not match the location of the matched text in the original URL spec. The code to adjust offsets doesn't help here because it adjusts offsets that with respect to the original URL spec, not offsets with respect to the formatted URL. In effect, we need to be able to reverse the transformation that FormatUrl() does in order to get the original offsets back (if possible) from the transformed offsets we have. The easiest and most efficient way to compute this reverse mapping is to keep track of the full original mapping, then reverse it later and apply the reversed mapping to the match offsets we have where the offsets are with respect to the formatted string. This change include the necessary parts to keep track of the full transformation. In a follow-up change, I will make HistoryQuick provider use the transformation information. In the process of that change, I will remove the "WithOffsets" function from net_util. BUG=252630 Review URL: https://codereview.chromium.org/196103008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264850 0039d316-1c4b-4281-b951-d872f2087c98
* Removed unneeded include string_util_posix.h.zvorygin@chromium.org2014-03-191-1/+0
| | | | | | | | | BUG=353954 R=thakis@chromium.org Review URL: https://codereview.chromium.org/203763007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257946 0039d316-1c4b-4281-b951-d872f2087c98
* Eliminate build warnings in base/ for Android x64zhenyu.liang@intel.com2014-03-191-2/+4
| | | | | | | | | | | This CL fixes format strings of printf and type conversions that cause compilation warnings while building Android x64. BUG=346626 Review URL: https://codereview.chromium.org/185423006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257942 0039d316-1c4b-4281-b951-d872f2087c98
* Remove two Unicode characters that are not white space perpkasting@chromium.org2014-03-181-33/+31
| | | | | | | | | | | | | | http://www.unicode.org/Public/7.0.0/ucd/PropList-7.0.0d29.txt. This also gives all constants their official Unicode names. BUG=60231 TEST=Copy string from bug comment 0, but paste into omnibox instead of find box. Ensure there is no space in the pasted string. R=brettw@chromium.org Review URL: https://codereview.chromium.org/198853004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257704 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 257524 "Move IsStringASCII/UTF8 to base namespace."brettw@chromium.org2014-03-172-28/+28
| | | | | | | | | | | | | | | | > Move IsStringASCII/UTF8 to base namespace. > > Use StringPiece for IsStringUTF8. > > TBR=sky > > Review URL: https://codereview.chromium.org/196793010 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/198163004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257533 0039d316-1c4b-4281-b951-d872f2087c98
* Move IsStringASCII/UTF8 to base namespace.brettw@chromium.org2014-03-172-28/+28
| | | | | | | | | | Use StringPiece for IsStringUTF8. TBR=sky Review URL: https://codereview.chromium.org/196793010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257524 0039d316-1c4b-4281-b951-d872f2087c98
* Move UTF16ToASCII, remove WideToASCII.brettw@chromium.org2014-03-145-36/+18
| | | | | | | | | | | | | | | | This removes WideToASCII and changes all callers to use UTF16ToASCII instead. Moves UTF16ToASCII from base/strings/string_util.h to base/strings/utf_string_conversions.h and into the base namespace. Convert a few related string_util functions to take a StringPiece16 instead of a string16. Remove IsStringASCII(std::wstring) which was unused. Updates callers' includes and namespace usage accordingly. TBR=sky Review URL: https://codereview.chromium.org/176843022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257200 0039d316-1c4b-4281-b951-d872f2087c98
* Fix unreachable code warnings in base/. Found by MSVC warning 4702.pkasting@chromium.org2014-03-142-19/+12
| | | | | | | | | | BUG=346392 TEST=none R=thakis@chromium.org Review URL: https://codereview.chromium.org/197273004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257153 0039d316-1c4b-4281-b951-d872f2087c98
* Remove ContainsOnlyWhitespace from string_util and CollapseWhitespace into ↵brettw@chromium.org2014-03-113-67/+38
| | | | | | | | | | | | | | | | | to the base namespace This function is only used in a few places and can trivially be implemented by passing the whitespace constant to the existing ContainsOnlyChars function. This changes the ContainsOnlyChars function signature to take a StringPiece to avoid a copy from a literal to a standard string in the above-mentioned use-base. Re-implement ContainsOnlyChars to use the find_first_not_of function on StringPiece. BUG= R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/183683024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256354 0039d316-1c4b-4281-b951-d872f2087c98
* Fill out the rest of the StringPiece functions for 16-bit.brettw@chromium.org2014-03-113-374/+580
| | | | | | | | | | | | | | | | | | | I was originally opposed to these since we didn't need them and they were complicated. But I'm wanting to use some of these functions in a different patch, so it seems like a good time to fill out the std::string-like finding functions for StringPiece16. This deletes the old StringPieceDetails for which the only point was to share the common stuff between the two BasicStringPiece specializations. I used the pattern of having two versions of each function declared in the header and then expanding the template in the .cc file, to avoid template bloat in the header. This replaces all of the size_type goop with size_t. Chrome code assumes these are the same and we encourage people to just use size_t in loops, for example, rather than using the size_type of the template they're iterating over. This makes the code more readable in many places. It also solves a problem with declaration ordering since most of the functions that used size_type are now moved above where the size_type is actually declared. R=viettrungluu@chromium.org TBR=akalin, ben Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=255397 Review URL: https://codereview.chromium.org/187793004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256311 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup SplitStringIntoKeyaluePairs implementation.pneubeck@chromium.org2014-03-112-107/+106
| | | | | | | | | | | | | This function was originally a helper function for sync and wasn't cleaned up/revisited since its move to base/ . Since there are now several users of this function, we should care about a cleaner implementation. While at string_split.cc, moving local functions (which partially were missing 'static') to an anonymous namespace. BUG=NONE Review URL: https://codereview.chromium.org/184233010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256226 0039d316-1c4b-4281-b951-d872f2087c98
* Extend SplitStringIntoKeyValuePairs unit tests.pneubeck@chromium.org2014-03-082-91/+94
| | | | | | | | | | | | | Extends the unit tests about corner cases to ensure that changes to the implementation don't break these. Test cases of the internal helper function SplitStringIntoKeyValues are merged into tests of the public function SplitStringIntoKeyValuesPairs. This removes redundancy in the tests and improves coverage of SplitStringIntoKeyValuesPairs. The helper function is removed from the public header. BUG=NONE Review URL: https://codereview.chromium.org/184233009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255758 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 255397 "Fill out the rest of the StringPiece functions fo..."brettw@chromium.org2014-03-073-578/+374
| | | | | | | | | | | | | | | | | | | | | | | > Fill out the rest of the StringPiece functions for 16-bit. > > I was originally opposed to these since we didn't need them and they were complicated. But I'm wanting to use some of these functions in a different patch, so it seems like a good time to fill out the std::string-like finding functions for StringPiece16. > > This deletes the old StringPieceDetails for which the only point was to share the common stuff between the two BasicStringPiece specializations. > > I used the pattern of having two versions of each function declared in the header and then expanding the template in the .cc file, to avoid template bloat in the header. > > This replaces all of the size_type goop with size_t. Chrome code assumes these are the same and we encourage people to just use size_t in loops, for example, rather than using the size_type of the template they're iterating over. This makes the code more readable in many places. It also solves a problem with declaration ordering since most of the functions that used size_type are now moved above where the size_type is actually declared. > > R=viettrungluu@chromium.org > TBR=akalin, ben > > Review URL: https://codereview.chromium.org/187793004 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/189793002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255492 0039d316-1c4b-4281-b951-d872f2087c98
* Fill out the rest of the StringPiece functions for 16-bit.brettw@chromium.org2014-03-063-374/+578
| | | | | | | | | | | | | | | | | I was originally opposed to these since we didn't need them and they were complicated. But I'm wanting to use some of these functions in a different patch, so it seems like a good time to fill out the std::string-like finding functions for StringPiece16. This deletes the old StringPieceDetails for which the only point was to share the common stuff between the two BasicStringPiece specializations. I used the pattern of having two versions of each function declared in the header and then expanding the template in the .cc file, to avoid template bloat in the header. This replaces all of the size_type goop with size_t. Chrome code assumes these are the same and we encourage people to just use size_t in loops, for example, rather than using the size_type of the template they're iterating over. This makes the code more readable in many places. It also solves a problem with declaration ordering since most of the functions that used size_type are now moved above where the size_type is actually declared. R=viettrungluu@chromium.org TBR=akalin, ben Review URL: https://codereview.chromium.org/187793004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255397 0039d316-1c4b-4281-b951-d872f2087c98
* Move TrimWhitespace to the base namespace.brettw@chromium.org2014-03-032-17/+17
| | | | | | | | R=viettrungluu@chromium.org, viettrungluu Review URL: https://codereview.chromium.org/183853011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254521 0039d316-1c4b-4281-b951-d872f2087c98
* Remove 'using base::string16;' from base/strings/string16.h and remove temporarydbeam@chromium.org2013-12-301-4/+0
| | | | | | | | | | | | PRESUBMIT.py _CheckForString16(). R=brettw@chromium.org, maruel@chromium.org TBR=sky@chromium.org, tsepez@chromium.org BUG=329295 Review URL: https://codereview.chromium.org/93903011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242733 0039d316-1c4b-4281-b951-d872f2087c98
* Remove char16 from the global namespace.avi@chromium.org2013-12-261-1/+0
| | | | | | | | | | BUG=329295 TEST=no change TBR=ben@chromium.org Review URL: https://codereview.chromium.org/121143002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242564 0039d316-1c4b-4281-b951-d872f2087c98
* Remove UTF string conversion functions from the global namespace.avi@chromium.org2013-12-262-23/+8
| | | | | | | | | | BUG=330556 TEST=no change TBR=ben@chromium.org Review URL: https://codereview.chromium.org/102993018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242519 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of https://codereview.chromium.org/82963003/nkostylev@chromium.org2013-12-133-31/+25
| | | | | | | | | | | | Reason for revert: Breaks cros_* buildbots (compile). TBR=thakis@chromium.org,thestig@chromium.org NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/98643006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240676 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Make more wstring functions Windows-only.thestig@chromium.org2013-12-133-25/+31
| | | | | | | | BUG=23581 Review URL: https://codereview.chromium.org/82963003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240604 0039d316-1c4b-4281-b951-d872f2087c98
* Disable kSSizeMaxConst COMPILE_ASSERT() for Android / Mac / IOSch.dumez@samsung.com2013-12-071-6/+7
| | | | | | | | | | | | | | | | | | The kSSizeMaxConst COMPILE_ASSERT() was previously disabled for clang only, due to clang giving a build error on Android / Mac / IOS. gcc is affected by the same problem so this CL disables the COMPILE_ASSERT() for Android / Mac / IOS platforms, instead of doing it for a specific compiler. The reason why this COMPILE_ASSERT() does not build on those platforms is that static_assert only works with compile-time constants, but mac uses libstdc++4.2 and android uses stlport, which both don't mark numeric_limits::max() as constexpr. R=Nico Review URL: https://codereview.chromium.org/98403005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239352 0039d316-1c4b-4281-b951-d872f2087c98
* Remove C++11 specific version of SafeSNPrintf()ch.dumez@samsung.com2013-12-062-37/+1
| | | | | | | | | | | | | Remove C++11 specific version of SafeSNPrintf() as we don't really use C++11 yet and adding code like this adds a maintenance cost. For example, the code in question does not build with gcc 4.7 despite C++11 support being enabled. R=Nico BUG=233330 Review URL: https://codereview.chromium.org/102993006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239227 0039d316-1c4b-4281-b951-d872f2087c98
* Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize to ↵brettw@chromium.org2013-12-032-26/+26
| | | | | | | | | | | base namespace. BUG= R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/102843002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238465 0039d316-1c4b-4281-b951-d872f2087c98
* Move more uses of string16 to specify base::brettw@chromium.org2013-12-034-53/+64
| | | | | | | | | | This makes base, ui, and net compile without the "using base::string16" directive that's currently checked in. BUG= Review URL: https://codereview.chromium.org/100303003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238246 0039d316-1c4b-4281-b951-d872f2087c98
* Move EmptyString, kWhitespace and the BOM to base.brettw@chromium.org2013-12-023-26/+36
| | | | | | | | | | | | | | | This moves EmptyString*, kWhitespace*, and the UTF 8 Byte Order Marker to the base:: namespace. Many of them just got changed to a default-constructed string when a reference was not required. I qualified some string16s with base:: when I was changing adjacent code. I need to do another pass to finish these up. BUG= TBR=sky@chromium.org Review URL: https://codereview.chromium.org/89243003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238032 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove many unused wstring string_utils.thestig@chromium.org2013-11-223-171/+54
| | | | | | | | | BUG=23581 R=scottmg@chromium.org, thakis@chromium.org Review URL: https://codereview.chromium.org/80813002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236685 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Fix a typo in string_split.h.thestig@chromium.org2013-11-201-3/+3
| | | | | | Review URL: https://codereview.chromium.org/77553002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236210 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for unsigned int32 in string_number_conversionszverre@yandex-team.ru2013-10-233-0/+79
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/26131003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230396 0039d316-1c4b-4281-b951-d872f2087c98
* Switch the offset conversion routines from an "offsets point at characters"pkasting@chromium.org2013-09-113-27/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | worldview to an "offsets point between characters" worldview. This more closely aligns with how the omnibox autocomplete code (which is what this was originally written for) expects things to behave. Direct fallout from this change: * An input offset of 0 will always map to an output offset of 0. * An input offset of (length of string) will always map to the length of the output string, instead of npos. * It's possible for multiple unique input offsets to map to a single non-npos output offset, if they e.g. point to the start and end of a collapsed sequence. * Input offsets pointing into the middle of a completely-removed sequence may not be set to npos if they fall on the boundaries of a subsequence processed by the transformer. For example, when running FormatUrlWithOffsets() on "http://user:pass@domain.com/" and directing it to omit both the scheme and username/password, an input offset of "7" that points in between the scheme and the username/password will be transformed to an output offset of 0 instead of npos. Indirect fallout: * A caller like SearchProvider::NavigationToMatch() will now mark certain matches as "allowed to be default" that it didn't before. Specifically, if the user's input string ends at the same point as the desired |fill_into_edit|, the autocomplete offset will be calculated as (length of string) instead of npos, and thus the match will be thought of as "inlinable" and thus "allowed to be default". BUG=284781 TEST=none R=msw@chromium.org, willchan@chromium.org Review URL: https://codereview.chromium.org/23619016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222426 0039d316-1c4b-4281-b951-d872f2087c98
* Second attempt at introducing SafeSPrintf().markus@chromium.org2013-09-054-0/+1886
| | | | | | | | | | | | | | | | | | | | | | | | | | | See original discussion at https://codereview.chromium.org/18656004/ Reverted as: https://codereview.chromium.org/23463010/ Added a new base::strings::SafeSPrintf() function that can safely be called from all restricted (e.g. async-signal-safe) environments. It is roughly equivalent to snprintf(). But it is easier to use, as it uses C++ to be type-safe. In release builds, this function is guaranteed to never call any other library function nor any system calls. In debug builds, we call RAW_CHECK() in some circumstances. This code is needed for (at least) the seccomp sandbox and to clean up code in the stack tracer. Those changes are pending and will be submitted as separate CLs. BUG=285499 TEST=base_unittests TBR=willchan@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/23777003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221322 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Added a new base::strings::SafeSPrintf() function that can"tkent@chromium.org2013-09-024-1890/+0
| | | | | | | | | | | | | | | Revert "Disable EmitNULL test for Widows x64." This reverts r220773 and 220746. r220746 broke ChromiumOS build. BUG=283595 TBR=markus@chromium.org Review URL: https://codereview.chromium.org/23463010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220777 0039d316-1c4b-4281-b951-d872f2087c98
* Disable EmitNULL test for Widows x64.tkent@chromium.org2013-09-021-1/+7
| | | | | | | | | TBR=markus@chromium.org BUG=283595 Review URL: https://codereview.chromium.org/23851004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220773 0039d316-1c4b-4281-b951-d872f2087c98
* Added a new base::strings::SafeSPrintf() function that canmarkus@chromium.org2013-09-014-0/+1884
| | | | | | | | | | | | | | | | | | | | | safely be called from all restricted (e.g. async-signal-safe) environments. It is roughly equivalent to snprintf(). But it is easier to use, as it uses C++ to be type-safe. In release builds, this function is guaranteed to never call any other library function nor any system calls. In debug builds, we call RAW_CHECK() in some circumstances. This code is needed for (at least) the seccomp sandbox and to clean up code in the stack tracer. Those changes are pending and will be submitted as separate CLs. BUG=none TEST=base_unittests Review URL: https://chromiumcodereview.appspot.com/18656004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@220746 0039d316-1c4b-4281-b951-d872f2087c98
* Omnibox: Create DemoteByType Experimentmpearson@chromium.org2013-08-092-8/+9
| | | | | | | | | | | | | | | | | | | | This experiment, which runs as part of the bundled omnibox field trial, uses the field trial parameters to demote results of particular types (e.g., HISTORY_TITLE results), possibly depending on context (e.g., search results page doing search term replacement). It also improves the testing framework for field trial parameters, allowing them to be cleared between consecutive TEST_F()s. Tested via unit tests and by setting up my local variations server with some parameters and making sure results can be demoted or omitted. BUG=264066 Review URL: https://chromiumcodereview.appspot.com/22031002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216633 0039d316-1c4b-4281-b951-d872f2087c98
* mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef.thakis@chromium.org2013-06-241-8/+7
| | | | | | | | | | | | | | | | | This CL was created fully mechanically by running git grep -l base::mac::ScopedCFTypeRef | xargs sed -i -e 's/base::mac::ScopedCFTypeRef/base::ScopedCFTypeRef/g' git commit -a -m. git clang-format HEAD^ --style=Chromium git commit -a -m. git cl upload -t $TITLE BUG=251957 TBR=mark@chromium.org Review URL: https://codereview.chromium.org/16917011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208245 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of strings headers, delete some strings forwarding headers.avi@chromium.org2013-06-201-1/+1
| | | | | | | | | | BUG=247723 TEST=everything compiles OK TBR=ben@chromium.org Review URL: https://codereview.chromium.org/17390010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207507 0039d316-1c4b-4281-b951-d872f2087c98
* Remove "using" from nullable string now that all users are updated.avi@chromium.org2013-06-191-4/+0
| | | | | | | | | | BUG=247723 TEST=compile works TBR=brettw@chromium.org Review URL: https://chromiumcodereview.appspot.com/17385006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@207165 0039d316-1c4b-4281-b951-d872f2087c98
* Replace base::NullableString16(bool) usage with default constructor.darin@chromium.org2013-06-181-1/+0
| | | | | | Review URL: https://chromiumcodereview.appspot.com/17327004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206922 0039d316-1c4b-4281-b951-d872f2087c98
* Add support using EXPECT_EQ with NullableString16 objects.darin@chromium.org2013-06-173-1/+67
| | | | | | | | | | Change the default constructor to set is_null_ to true. This makes NullableString16 act more like a WebKit::WebString, which is really the reason NullableString16 exists at all. R=brettw@chromium.org Review URL: https://codereview.chromium.org/17289005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206805 0039d316-1c4b-4281-b951-d872f2087c98