Chromium Code Reviews| Index: components/dom_distiller/core/url_utils.cc |
| diff --git a/components/dom_distiller/core/url_utils.cc b/components/dom_distiller/core/url_utils.cc |
| index d5ca57d4e3554c8369397507601251c6ee91e6d1..8c8ab9d596ca1a1529cf259d59ce763cf8885ed6 100644 |
| --- a/components/dom_distiller/core/url_utils.cc |
| +++ b/components/dom_distiller/core/url_utils.cc |
| @@ -33,14 +33,18 @@ const GURL GetDistillerViewUrlFromUrl(const std::string& scheme, |
| return net::AppendOrReplaceQueryParameter(url, kUrlKey, view_url.spec()); |
| } |
| +std::string GetValueForKeyInUrl(const GURL& url, const std::string& key) { |
| + std::string value; |
| + net::GetValueForKeyInQuery(url, key, &value); |
|
nyquist
2014/08/13 20:09:11
could you guard this with url.is_valid()? Just bai
sunangel
2014/08/13 21:49:33
Done.
|
| + return value; |
| +} |
| + |
| std::string GetValueForKeyInUrlPathQuery(const std::string& path, |
| const std::string& key) { |
| // Tools for retrieving a value in a query only works with full GURLs, so |
| // using a dummy scheme and host to create a fake URL which can be parsed. |
| GURL dummy_url(kDummyInternalUrlPrefix + path); |
| - std::string value; |
| - net::GetValueForKeyInQuery(dummy_url, key, &value); |
| - return value; |
| + return GetValueForKeyInUrl(dummy_url, key); |
| } |
| bool IsUrlDistillable(const GURL& url) { |