Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: net/url_request/url_request.cc

Issue 192057: Use "GURL::possibly_invalid_spec()" rather than "GURL::spec()", in case the G... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Make unittest better Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request.cc
===================================================================
--- net/url_request/url_request.cc (revision 25765)
+++ net/url_request/url_request.cc (working copy)
@@ -101,11 +101,10 @@
info.original_url = url_request->original_url();
info.load_log = url_request->load_log();
- // Paranoia check: truncate really big URLs.
- if (info.original_url.spec().size() > kMaxGraveyardURLSize) {
- info.original_url = GURL(url_request->original_url().spec().substr(
- 0, kMaxGraveyardURLSize));
- }
+ // Paranoia check: truncate |info.original_url| if it is really big.
+ const std::string& spec = info.original_url.possibly_invalid_spec();
+ if (spec.size() > kMaxGraveyardURLSize)
+ info.original_url = GURL(spec.substr(0, kMaxGraveyardURLSize));
return info;
}
« no previous file with comments | « no previous file | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698