summaryrefslogtreecommitdiffstats
path: root/net/base/escape.cc
Commit message (Collapse)AuthorAgeFilesLines
* linux: Remove all 40 static initializers from escape.cc.thakis@chromium.org2011-12-091-21/+17
| | | | | | | | | | | gcc 4.4.3 isn't very bright. BUG=94925 TEST=none Review URL: http://codereview.chromium.org/8890055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113757 0039d316-1c4b-4281-b951-d872f2087c98
* net: Move UnescapeRule into the net namespace.tfarina@chromium.org2011-11-151-2/+2
| | | | | | | | | | | BUG=64263 TEST=None R=willchan@chromium.org Review URL: http://codereview.chromium.org/8552002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110085 0039d316-1c4b-4281-b951-d872f2087c98
* net: Move the last two Escape() functions into the net namespace.tfarina@chromium.org2011-11-091-2/+2
| | | | | | | | | | | BUG=64263 TEST=None R=willchan@chromium.org Review URL: http://codereview.chromium.org/8507011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109298 0039d316-1c4b-4281-b951-d872f2087c98
* net: Move more three Escape() functions into net namespace.tfarina@chromium.org2011-11-061-18/+17
| | | | | | | | | | | BUG=64263 TEST=None R=willchan@chromium.org Review URL: http://codereview.chromium.org/8479021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108808 0039d316-1c4b-4281-b951-d872f2087c98
* net: Fix ASAN build my moving AppendEscapedCharForHTMLImpl above into ↵tfarina@chromium.org2011-10-131-25/+25
| | | | | | | | | | | unnamed namespace. BUG=64263 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/8275002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105305 0039d316-1c4b-4281-b951-d872f2087c98
* net: Move EscapeForHTML() functions into net namespace.tfarina@chromium.org2011-10-131-12/+12
| | | | | | | | | | | BUG=64263 TEST=None R=willchan@chromium.org Review URL: http://codereview.chromium.org/8256006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105304 0039d316-1c4b-4281-b951-d872f2087c98
* net: Move UnescapeURLComponent() functions into net namespace.tfarina@chromium.org2011-10-021-11/+10
| | | | | | | | | | | BUG=64263 TEST=None R=willchan@chromium.org Review URL: http://codereview.chromium.org/8109004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103677 0039d316-1c4b-4281-b951-d872f2087c98
* net: Move more functions into net namespace.tfarina@chromium.org2011-09-251-36/+36
| | | | | | | | | | | | BUG=64263 TEST=None R=willchan@chromium.org Review URL: http://codereview.chromium.org/8028015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102671 0039d316-1c4b-4281-b951-d872f2087c98
* net: Put more functions from escape.h into net namespace.tfarina@chromium.org2011-09-221-4/+4
| | | | | | | | | | | BUG=64263 TEST=None R=willchan@chromium.org Review URL: http://codereview.chromium.org/7978039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102271 0039d316-1c4b-4281-b951-d872f2087c98
* net: Start wrapping escape.h into namespace net.tfarina@chromium.org2011-09-201-10/+18
| | | | | | | | | | | BUG=64263 TEST=None R=willchan@chromium.org Review URL: http://codereview.chromium.org/7934007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101970 0039d316-1c4b-4281-b951-d872f2087c98
* FormatURL used to escape characters in the query string thatmmenke@chromium.org2011-08-171-4/+8
| | | | | | | | | | | | | GURL doesn't escape when cannonicalizing, and are illegal in the query portion of the URL according to spec. Fix that behavior, so if gurl is a valid url, so is GURL(FormatURL(gurl)). BUG=90387 TEST=NetUtilTest.FormatUrlRoundTripPathASCII, NetUtilTest.FormatUrlRoundTripPathEscape, NetUtilTest.FormatUrlRoundTripQueryASCII, NetUtilTest.FormatUrlRoundTripQueryEscaped Review URL: http://codereview.chromium.org/7649024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97093 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: base/scoped_ptr.h -> base/memory/scoped_ptr.h. (part 2)thestig@chromium.org2011-06-151-1/+1
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/7149008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89131 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 88553 - Revert 88510 - Escaping file names correctly. Also fixed a ↵thestig@chromium.org2011-06-141-2/+3
| | | | | | | | | | | | | | | | | | | | crush in chromeos debug build while saving a web page. This change broke the official CrOS builder. I'll forward the error separately. BUG=chromium-os:13130 TEST=Save a file with special characters like '#', '&', '"'. Review URL: http://codereview.chromium.org/7057053 TBR=serya@chromium.org Review URL: http://codereview.chromium.org/7046077 TBR=ericu@google.com Review URL: http://codereview.chromium.org/7145014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88934 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 88510 - Escaping file names correctly. Also fixed a crush in chromeos ↵ericu@google.com2011-06-091-3/+2
| | | | | | | | | | | | | | | | | debug build while saving a web page. This change broke the official CrOS builder. I'll forward the error separately. BUG=chromium-os:13130 TEST=Save a file with special characters like '#', '&', '"'. Review URL: http://codereview.chromium.org/7057053 TBR=serya@chromium.org Review URL: http://codereview.chromium.org/7046077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88553 0039d316-1c4b-4281-b951-d872f2087c98
* Escaping file names correctly. Also fixed a crush in chromeos debug build ↵serya@chromium.org2011-06-091-2/+3
| | | | | | | | | | | | while saving a web page. BUG=chromium-os:13130 TEST=Save a file with special characters like '#', '&', '"'. Review URL: http://codereview.chromium.org/7057053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88510 0039d316-1c4b-4281-b951-d872f2087c98
* Using DCHECK_NE/EQ/LE/GE/GT/LT() where possible. Updating logging in ↵kushi.p@gmail.com2011-05-051-1/+2
| | | | | | | | | | | | | src/net/base/ Contributor: kushi.p@gmail.com BUG=58409 Review URL: http://codereview.chromium.org/6905059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84228 0039d316-1c4b-4281-b951-d872f2087c98
* Eliminate wstring from base/utf_offset_string_conversions.h, ↵pkasting@chromium.org2011-05-031-34/+16
| | | | | | | | | | net/base/escape.h, and net/base/net_util.h, and reduce the API surfaces in various places slightly where possible. BUG=23581 TEST=none Review URL: http://codereview.chromium.org/6898026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83948 0039d316-1c4b-4281-b951-d872f2087c98
* Add multiple-offset versions of the various URL reformatting functions. ↵mrossetti@chromium.org2011-04-131-32/+85
| | | | | | | | | | | | | | Fixed a couple of erroneous unit tests of offsets into username/password. Note: This does not complete the work required for 78153 -- tis but the first 2/3rds. Previously reviewed as: http://codereview.chromium.org/6822038/. BUG=78153 TEST=Many unit tests updated and added. Review URL: http://codereview.chromium.org/6839007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81448 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 81343 - Add multiple-offset versions of the various URL reformatting ↵mrossetti@chromium.org2011-04-131-85/+32
| | | | | | | | | functions. Fixed a couple of erroneous unit tests of offsets into username/password.Note: This does not complete the work required for 78153 -- tis but the first 2/3rds.BUG=78153TEST=Many unit tests updated and added.Review URL: http://codereview.chromium.org/6822038 TBR=mrossetti@chromium.org Review URL: http://codereview.chromium.org/6833011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81348 0039d316-1c4b-4281-b951-d872f2087c98
* Add multiple-offset versions of the various URL reformatting functions. ↵mrossetti@chromium.org2011-04-131-32/+85
| | | | | | | | | | | | Fixed a couple of erroneous unit tests of offsets into username/password. Note: This does not complete the work required for 78153 -- tis but the first 2/3rds. BUG=78153 TEST=Many unit tests updated and added. Review URL: http://codereview.chromium.org/6822038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81343 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor the ICU dependency in escape.cc into escape_icu.cc.abarth@chromium.org2011-04-061-16/+2
| | | | | | Review URL: http://codereview.chromium.org/6693082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80560 0039d316-1c4b-4281-b951-d872f2087c98
* Remove wstring from TemplateURL and friends.avi@chromium.org2011-01-191-4/+4
| | | | | | | | | | | Re-landing r71485 (which was reverted in r71500). BUG=23581 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/6278007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71814 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 71485 - Remove wstring from TemplateURL and friends.avi@chromium.org2011-01-141-4/+4
| | | | | | | | | | | | BUG=23581 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/6322001 TBR=avi@chromium.org Review URL: http://codereview.chromium.org/6291003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71500 0039d316-1c4b-4281-b951-d872f2087c98
* Remove wstring from TemplateURL and friends.avi@chromium.org2011-01-141-4/+4
| | | | | | | | | BUG=23581 TEST=no visible changes; all tests pass Review URL: http://codereview.chromium.org/6322001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71485 0039d316-1c4b-4281-b951-d872f2087c98
* Don't unescape backslashes in URLs, since these will be converted to slashesbrettw@chromium.org2010-12-031-2/+3
| | | | | | | | | | by googleurl, changing the meaning of the URL. BUG=45051 TEST=none Review URL: http://codereview.chromium.org/5603005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68200 0039d316-1c4b-4281-b951-d872f2087c98
* Don't unescape characters that can change the meaning of a URL. I removed ↵brettw@google.com2010-12-021-3/+10
| | | | | | | | | | | | | | the set of characters labeled PASS in url_canon_path.cc from the characters we'll unescape for URLs. Since there is no canonical meaning for these characters, this transformation can cause problems for certain servers. I updated the escape tests to use a different character so the test works like before (I no longer unescape semicolon). When I fixed this, I realized I broke the content disposition filename unescaping. It was using URL unescaping rules which I think is incorrect for filenames in headers, so I added the "also unescape URL special characters" flag to the unescape call that this function uses. TEST=updated unit tests BUG=64732 Review URL: http://codereview.chromium.org/5376007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68011 0039d316-1c4b-4281-b951-d872f2087c98
* base: Add HexDigitToInt function to string_util.htfarina@chromium.org2010-07-311-14/+2
| | | | | | | | | | | | | Removed duplicated HexToInt functions and converted the callers along the way. BUG=None TEST=trybots and out/Debug/base_unittests --gtest_filter=StringUtilTest.HexDigitToInt Signed-off-by: Thiago Farina <tfarina@chromium.org> Review URL: http://codereview.chromium.org/2836069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54473 0039d316-1c4b-4281-b951-d872f2087c98
* base: Add IsHexDigit function to string_util.htfarina@chromium.org2010-07-231-9/+3
| | | | | | | | | | | | | | | Removed duplicated IsHex functions and converted the callers along the way. (Note: this was a TODO for jungshik). BUG=None TEST=trybots Signed-off-by: Thiago Farina <tfarina@chromium.org> Review URL: http://codereview.chromium.org/2870058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53428 0039d316-1c4b-4281-b951-d872f2087c98
* Pull latest googleurl to get it to stop unescaping at signs in paths.brettw@chromium.org2010-04-051-1/+1
| | | | | | | | | | This also fixes the URL displayer to stop unescaping at signs. Otherwise, we'll have the weird situation where if you go to a site with a %40 in it where it cares about the difference between %40 and @, pressing enter in the URL bar will load the "@" variant and the URL won't load. BUG=http:///crbug.com/23933 TEST=included unit test Review URL: http://codereview.chromium.org/1614001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43615 0039d316-1c4b-4281-b951-d872f2087c98
* Adding some more escaping method.jcampan@chromium.org2010-01-211-8/+59
| | | | | | | | | | | This will be used by the translate feature. BUG=None TEST=Run the unit-tests. Review URL: http://codereview.chromium.org/548088 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36715 0039d316-1c4b-4281-b951-d872f2087c98
* The search terms are escaped using + or %20 for space depending on whether ↵avayvod@google.com2010-01-151-8/+5
| | | | | | | | | | | | replacement is in query part of the URL or not. Removed duplicate EscapeQueryParamValue functions without |use_plus| argument. BUG=24571 TEST=Verify that space is escaped as stated in description; see bug description for example with search on Wikipedia. Review URL: http://codereview.chromium.org/543077 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36398 0039d316-1c4b-4281-b951-d872f2087c98
* Implement "Email Link To Page" menu command.snej@chromium.org2009-12-031-0/+4
| | | | | | | | | | | | | | | | | | | This menu item only exists in the Mac build, but the code is cross-platform so it could be hooked up on other platforms as well, if desired. It works by generating a URL of the form mailto:?subject=Fwd:%20PAGETITLE&body=%0A%0APAGEURL and telling platform_utils to open it. This is my first patch involving command handling; I've tried to follow the way similar menu commands like Print are implemented, but feel free to tell me if there are better ways. I didn't find any place for unit tests for TabContents; if this needs tests, let me know where they should go. BUG=29232 TEST=none Review URL: http://codereview.chromium.org/466019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33746 0039d316-1c4b-4281-b951-d872f2087c98
* Remove std::wstring from most of net/base/escape.h.darin@chromium.org2009-11-301-16/+15
| | | | | | | | | | | | | | | | | | | I left the one API because based on the comment, it should eventually be removed. Updated the callers to use UTF16ToWideHack until more work can be done to remove std::wstring. I also updated net/base/escape_unittest.cc to use the same hack until a proper solution can be coded. Original patch submission here: http://codereview.chromium.org/402085 Patch by Patrick Scott (phanna@android.com) R=darin BUG=23581 TEST=escape_unittest Review URL: http://codereview.chromium.org/452015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33326 0039d316-1c4b-4281-b951-d872f2087c98
* Split *AndAdjustOffset() functions into their own header, to restore ↵pkasting@chromium.org2009-11-131-1/+3
| | | | | | | | | | 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
* Clean up recent string conversion function changes, part 1: Remove ↵pkasting@chromium.org2009-11-101-4/+4
| | | | | | | | | | | | 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
* Fix various problems with inline autocomplete and URLs that change length ↵pkasting@chromium.org2009-11-071-9/+33
| | | | | | | | | | | | | | | | | | | | 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
* Remove the dependency on i18n/icu_string_conversions from base/string_util.h.brettw@chromium.org2009-10-101-4/+5
| | | | | | | | | | | | Fix up all files requireing this header to include it directly. Split out the ICU-dependent string util unit tests into a new file base/i18n/icu_string_util_unittest.cc TEST=none BUG=none Review URL: http://codereview.chromium.org/269034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28674 0039d316-1c4b-4281-b951-d872f2087c98
* Rename EscapeUrl and expand the code comment.brg@chromium.com2009-10-011-1/+1
| | | | | | | | BUG=none TEST=Escape.EscapeUrlEncodedData Review URL: http://codereview.chromium.org/257021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27782 0039d316-1c4b-4281-b951-d872f2087c98
* Add EscapeURL to the ASCII escape methods.EscapeURL escapes all forbidden ↵brg@chromium.com2009-10-011-0/+10
| | | | | | | | | | ascii characters in an URL and repalces spaces with '+'. Test=Escape.EscapeUrl BUG=23029 Review URL: http://codereview.chromium.org/244056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27713 0039d316-1c4b-4281-b951-d872f2087c98
* Local text file with spaces in filename is urlencoded in tab titlemhm@chromium.org2009-06-031-0/+4
| | | | | | | | | | | | | | When viewing a local text file with spaces in filename, it is still urlencoded. Filename should be displayed with spaces, not with urlencoding. It would be more user-friendly. Since net::FormatURL is already implemented, using it would be great. But it doesn't escape SPACES, just NORMAL, it doesn't even escape unicode. I plumbed out a unescapeurl that could be used whether we allow conversion of spaces or not. BUG=8775 (http://crbug.com/8775) TEST=Tested whether the input is escaped in the navigational context and ran the net tests New Review: http://codereview.chromium.org/118059 Review URL: http://codereview.chromium.org/56053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17462 0039d316-1c4b-4281-b951-d872f2087c98
* NO CODE CHANGEdeanm@chromium.org2009-03-111-1/+0
| | | | | | | | | Normalize end of file newlines in net/. All files end in a single newline. Review URL: http://codereview.chromium.org/43079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11442 0039d316-1c4b-4281-b951-d872f2087c98
* Fix an out of band read when parsing a URL component of just "%". The ↵deanm@google.com2008-09-031-3/+2
| | | | | | | | calculation of max_digit_index is unsigned, and was underflowing when max was less than 2. BUG=122 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1677 0039d316-1c4b-4281-b951-d872f2087c98
* Use a more compact license header in source files.license.bot2008-08-241-28/+4
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1287 0039d316-1c4b-4281-b951-d872f2087c98
* Merge some changes in net/base from branches/mac_july_2008 to trunk.ericroman@google.com2008-08-061-3/+3
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@420 0039d316-1c4b-4281-b951-d872f2087c98
* I looked at the full dump from the previous crashes and it looks like a ↵brettw@google.com2008-07-301-3/+41
| | | | | | testing issue. Hopefully it will be magically unbroken. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting revision 70, 66 and 65 to fix crashes.nsylvain@google.com2008-07-291-41/+3
| | | | git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71 0039d316-1c4b-4281-b951-d872f2087c98
* Puts back the optional unescaping of control characters and URL ↵brettw@google.com2008-07-291-3/+41
| | | | | | | | | | | | parse-affecting characters. That patch was reverted due to build problems. This is heavily modified from the original patch. That patch required an additional function and a bunch of internal boolean flags. This one uses the new flags enum I wrote to add this to the existing functionality more cleanly. BUG=1271340 BUG=1258819 Review URL: http://chrome-reviews.prom.corp.google.com/804 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66 0039d316-1c4b-4281-b951-d872f2087c98
* Add net to the repository.initial.commit2008-07-261-0/+272
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14 0039d316-1c4b-4281-b951-d872f2087c98