0
Commit Graph

7 Commits

Author SHA1 Message Date
suzhe@google.com
39a749c1cc Change UTF8ToUTF16 to accept const StringPiece&.
BUG=70936
TEST=All unit tests should pass.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72921 0039d316-1c4b-4281-b951-d872f2087c98
2011-01-28 02:40:46 +00:00
brettw@chromium.org
f1d8192134 Move ASCIIToWide and ASCIIToUTF16 to utf_string_conversions.h. I've found it
weird that UTF8ToWide is in utf_string_conversions, but ASCIIToWide is in
string_util.h. This should help some dependencies since string_util changes
much more frequently than utf_string_conversions and fewer files will now need
string_utils.

Since this requires a lot of changes, this keeps a forward-declaration in
string_util so I can update the entire project incrementally. This change
updates base and net only.

I removed some includes of string_util from header files in net. In particular,
url_request_context which involved creating a new .cc file to implement a
function (already virtual so there's no speed penalty). It turns out a lot of
files were getting string_util from this include, so I had to update a bunch of
random files to now explicitly include string_util.h

TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/3076013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54456 0039d316-1c4b-4281-b951-d872f2087c98
2010-07-31 17:47:09 +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
brettw@chromium.org
047a03f4ce Copy the relevant parts of ICU to a new file base/third_party/icu/icu_utf.*
so we can do basic UTF8/16/32 conversions without linking all of ICU.

Change callers who used to call SysUTF8ToWide/SysWideToUTF8 in base to using
these new functions. I will remove the Sys versions of these functions in a
later patch.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28219 0039d316-1c4b-4281-b951-d872f2087c98
2009-10-07 02:10:20 +00:00