0
Commit Graph

11 Commits

Author SHA1 Message Date
brettw@chromium.org
47e870bf26 Revert 184352
> Add utf_string_conversions to base namespace.
> 
> This adds "using"s for all functions so those can be fixed in a separate pass.
> 
> This converts the "Wide" versions of the functions in the Chrome directory as a first pass on the changeover.
> 
> BUG=
> 
> Review URL: https://codereview.chromium.org/12314090

TBR=brettw@chromium.org
Review URL: https://codereview.chromium.org/12315071

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184355 0039d316-1c4b-4281-b951-d872f2087c98
2013-02-24 21:14:53 +00:00
brettw@chromium.org
5f0cebb46d Add utf_string_conversions to base namespace.
This adds "using"s for all functions so those can be fixed in a separate pass.

This converts the "Wide" versions of the functions in the Chrome directory as a first pass on the changeover.

BUG=

Review URL: https://codereview.chromium.org/12314090

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184352 0039d316-1c4b-4281-b951-d872f2087c98
2013-02-24 20:27:04 +00:00
thakis@chromium.org
34f40946da clang/mac: Fix almost all problems when building all.xcodeproj.
BUG=None
TEST=None
TBR=hans

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61344 0039d316-1c4b-4281-b951-d872f2087c98
2010-10-04 00:34:04 +00:00
brettw@chromium.org
f16339329d Header cleanup in base.
This makes uses of StringPrintf and friends use the base namespace and include
stringprintf.h explicitly. This also removes a bunch of unnecessary string_util
includes (which exposed a few other errors like people forgetting to include
<vector>.

TEST=it compiles
BUG=none

Review URL: http://codereview.chromium.org/3119022

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56446 0039d316-1c4b-4281-b951-d872f2087c98
2010-08-17 23:05:28 +00:00
jhawkins@chromium.org
379e7a5a9b base: string_util.h -> utf_string_conversions.h fix.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/678001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40972 0039d316-1c4b-4281-b951-d872f2087c98
2010-03-09 00:38:41 +00:00
jschuh@chromium.org
858d488781 Revert 36459 - Breaks 7 WebKit tests
Changes are:

* base::IsValidCodepoint() now returns false on noncharacter code points.
* base::IsStringUTF8() now uses ICU library (removed old Mozilla implementation).
* Removed base::IsStringWideUTF8() (was unused and confusing)
* file_util::ReplaceIllegalCharactersInPath() now treats Unicode replacement character (U+FFFD) as invalid.
* Associated unit tests updated.

BUG=2759
BUG=30662
TEST=base_unittests gtest_filter=StringUtilTest.IsStringUTF8
TEST=base_unittests gtest_filter=UTFStringConversionsTest.*
TEST=base_unittests gtest_filter=FileUtilICUTestReplaceIllegalCharactersInPathTest
Review URL: http://codereview.chromium.org/548017

TBR=jschuh@chromium.org
Review URL: http://codereview.chromium.org/552026

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36460 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-16 17:56:08 +00:00
jschuh@chromium.org
548a6c0f30 Changes are:
* base::IsValidCodepoint() now returns false on non-character code points.
* base::IsStringUTF8() now uses ICU library (removed old Mozilla implementation).
* Removed base::IsStringWideUTF8() (was unused and confusing)
* file_util::ReplaceIllegalCharactersInPath() now treats Unicode replacement character (U+FFFD) as invalid.
* Associated unit tests updated.

BUG=2759
BUG=30662
TEST=base_unittests --gtest_filter=StringUtilTest.IsStringUTF8
TEST=base_unittests --gtest_filter=UTFStringConversionsTest.*
TEST=base_unittests --gtest_filter=FileUtilICUTestReplaceIllegalCharactersInPathTest
Review URL: http://codereview.chromium.org/548017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36459 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-16 16:40:38 +00:00
cevans@chromium.org
d7a3e8ec24 If we can't read a unicode character, write the standard "unknown" (0xFFFD) character. This will prevent security issues where the current behaviour can be used to strip characters out of a string after it has passed some validation.
BUG=30798
TEST=utf_string_conversions_unittest.cc,utf_offset_string_conversions_unittest.cc,zip_unittest.cc

Review URL: http://codereview.chromium.org/522029

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35430 0039d316-1c4b-4281-b951-d872f2087c98
2010-01-01 22:16:38 +00:00
pkasting@chromium.org
b9f9383602 Split *AndAdjustOffset() functions into their own header, to restore utf_string_conversions.h to a simple, readable state.
BUG=4010
TEST=none
Review URL: http://codereview.chromium.org/387012

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31928 0039d316-1c4b-4281-b951-d872f2087c98
2009-11-13 19:27:48 +00:00
pkasting@chromium.org
2500a0f7c4 Clean up recent string conversion function changes, part 1: Remove unnecessary code. Thanks to a change in escape.cc I can basically revert the ICU conversions back to what they used to be; I can also get rid of half the conversions immediately since they aren't used.
This does not split out the "adjust" versions of the UTF conversions into their own header/implementation; that's coming in the next patch.

BUG=4010
TEST=none
Review URL: http://codereview.chromium.org/380007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31533 0039d316-1c4b-4281-b951-d872f2087c98
2009-11-10 01:43:15 +00:00
pkasting@chromium.org
ce85f60cd9 Fix various problems with inline autocomplete and URLs that change length during fixup:
* URLs with http auth info, which gets stripped
* URLs with IDN hosts
* URLs with escaped values that get unescaped

In cases like these, we'd inline autocomplete from the wrong locations, highlight the wrong portions of the URL as matches, and sometimes DCHECK() in debug mode.

The fix is to track how fixup affects the offsets into the URL we care about.  Plumbing this required an enormous number of additions :(

There is also a fix here to the URL Fixer Upper, which was obviously modified at some point in the past to use the Parsed components, but without updating the comments or some of the functionality to match.  Since this isn't supposed to "fix up" things that aren't simple typos, I removed some code to "fix" bogus ports, which was causing bizarre effects when typing HTTP auth URLs ("http://foo:bar" would be fixed to "http://foo" and then matched for inline autocompletion, which was clearly wrong).  This is tested incidentally by one of the new History URL Provider tests (which is how I discovered it).

BUG=4010
TEST=Covered by unittests
Review URL: http://codereview.chromium.org/372017

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31352 0039d316-1c4b-4281-b951-d872f2087c98
2009-11-07 01:34:53 +00:00