diff options
author | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 16:04:49 +0000 |
---|---|---|
committer | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 16:04:49 +0000 |
commit | 213b99ad9d66e3c039bbb90c19d78603975c1be9 (patch) | |
tree | 0347413f86c4aecf437241e6e6ec6127d481ebc4 /net/http/http_response_headers.cc | |
parent | ab5b32246b6fcda4cf76023c1813f1c21c45b373 (diff) | |
download | chromium_src-213b99ad9d66e3c039bbb90c19d78603975c1be9.zip chromium_src-213b99ad9d66e3c039bbb90c19d78603975c1be9.tar.gz chromium_src-213b99ad9d66e3c039bbb90c19d78603975c1be9.tar.bz2 |
Refactor net::HttpUtil::NameValuePairsIterator to relieve clients of the need to think about quoted values while also avoiding a string copy if the value is unquoted.
The iterator now holds a (normally empty) string member that it uses only if the currently accessed value is quoted. In this case, the value_begin and value_end iterators point into this string (holding the unquoted value) as opposed to the original buffer (holding the quoted value). The value is only unquoted if it is accessed.
As a result, the interface is simplified to not expose whether the current value is quoted. This simplifies the work of all clients. Furthermore, this implementation is optimized to only construct a string if it is required, whereas most clients previously (for simplicity) constructed a new string whether or not it was required. They will therefore benefit from a slight increase in efficiency.
BUG=52601
TEST=net_unittests / HttpUtilTest.NameValuePairs*, HttpAuthTest.*
Review URL: http://codereview.chromium.org/3777012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63514 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_response_headers.cc')
0 files changed, 0 insertions, 0 deletions