Chromium Code Reviews| Index: content/browser/browser_url_handler_impl.cc |
| diff --git a/content/browser/browser_url_handler_impl.cc b/content/browser/browser_url_handler_impl.cc |
| index 71e35998f52dea3567d9b63612c0e7435149b1f2..7ea7ff787b9950512615abcde874d22daa6ebe6c 100644 |
| --- a/content/browser/browser_url_handler_impl.cc |
| +++ b/content/browser/browser_url_handler_impl.cc |
| @@ -62,12 +62,8 @@ static bool ReverseViewSource(GURL* url, BrowserContext* browser_context) { |
| // No action necessary if the URL is already view-source: |
| if (url->SchemeIs(kViewSourceScheme)) |
| return false; |
| - |
| - url::Replacements<char> repl; |
| - repl.SetScheme(kViewSourceScheme, |
| - url::Component(0, strlen(kViewSourceScheme))); |
| - repl.SetPath(url->spec().c_str(), url::Component(0, url->spec().size())); |
| - *url = url->ReplaceComponents(repl); |
| + // Recreate the url with the view-source scheme. |
| + *url = GURL(kViewSourceScheme + std::string(":") + url->spec()); |
|
sky
2014/10/14 19:56:31
Doesn't gurl have the ability to replace parts of
sgurun-gerrit only
2014/10/14 21:02:52
I could not see an easy way of doing it. Two possi
joth
2014/10/17 20:18:39
Thanks for fixing my bug! (well, bug my cl exposed
sgurun-gerrit only
2014/10/17 20:35:35
Rather then regression tests, I have written a uni
sgurun-gerrit only
2014/10/17 20:37:39
haha I think I read regression as integration test
|
| return true; |
| } |