diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-22 14:25:02 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-22 14:25:02 +0000 |
commit | 4a19be92d9eb20b1619dcf27b7afd3c0da9c4a10 (patch) | |
tree | e4d06e495857a982c3565b9f59ebd63b400afd6a /chrome/browser | |
parent | b73e024521455a212687bce023d61a8089b2efe1 (diff) | |
download | chromium_src-4a19be92d9eb20b1619dcf27b7afd3c0da9c4a10.zip chromium_src-4a19be92d9eb20b1619dcf27b7afd3c0da9c4a10.tar.gz chromium_src-4a19be92d9eb20b1619dcf27b7afd3c0da9c4a10.tar.bz2 |
net: Put more functions from escape.h into net namespace.
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
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/component_updater/component_updater_service.cc | 2 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_updater.cc | 16 | ||||
-rw-r--r-- | chrome/browser/notifications/desktop_notification_service.cc | 2 | ||||
-rw-r--r-- | chrome/browser/policy/device_management_backend_impl.cc | 4 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/protocol_manager.cc | 6 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_blocking_page.cc | 4 | ||||
-rw-r--r-- | chrome/browser/safe_browsing/safe_browsing_util.cc | 11 | ||||
-rw-r--r-- | chrome/browser/search_engines/template_url.cc | 14 | ||||
-rw-r--r-- | chrome/browser/ui/browser.cc | 7 | ||||
-rw-r--r-- | chrome/browser/ui/webui/history2_ui.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/webui/history_ui.cc | 2 |
11 files changed, 37 insertions, 35 deletions
diff --git a/chrome/browser/component_updater/component_updater_service.cc b/chrome/browser/component_updater/component_updater_service.cc index 8706ac0..90b4c9d 100644 --- a/chrome/browser/component_updater/component_updater_service.cc +++ b/chrome/browser/component_updater/component_updater_service.cc @@ -37,7 +37,7 @@ bool AddQueryString(std::string id, std::string version, size_t limit, std::string* query) { std::string additional = base::StringPrintf("id=%s&v=%s&uc", id.c_str(), version.c_str()); - additional = "x=" + EscapeQueryParamValue(additional, true); + additional = "x=" + net::EscapeQueryParamValue(additional, true); if ((additional.size() + query->size() + 1) > limit) return false; query->append(1, query->empty()? '?' : '&'); diff --git a/chrome/browser/extensions/extension_updater.cc b/chrome/browser/extensions/extension_updater.cc index 95b5b21..d62678d 100644 --- a/chrome/browser/extensions/extension_updater.cc +++ b/chrome/browser/extensions/extension_updater.cc @@ -8,8 +8,8 @@ #include <set> #include "base/compiler_specific.h" -#include "base/logging.h" #include "base/file_util.h" +#include "base/logging.h" #include "base/memory/scoped_handle.h" #include "base/metrics/histogram.h" #include "base/rand_util.h" @@ -17,12 +17,9 @@ #include "base/string_number_conversions.h" #include "base/string_split.h" #include "base/string_util.h" -#include "base/time.h" #include "base/threading/thread.h" +#include "base/time.h" #include "base/version.h" -#include "crypto/sha2.h" -#include "content/common/notification_service.h" -#include "content/common/notification_source.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/crx_installer.h" #include "chrome/browser/extensions/extension_error_reporter.h" @@ -38,6 +35,9 @@ #include "chrome/common/extensions/extension_file_util.h" #include "chrome/common/pref_names.h" #include "content/browser/utility_process_host.h" +#include "content/common/notification_service.h" +#include "content/common/notification_source.h" +#include "crypto/sha2.h" #include "googleurl/src/gurl.h" #include "net/base/escape.h" #include "net/base/load_flags.h" @@ -183,7 +183,7 @@ bool ManifestFetchData::AddExtension(std::string id, std::string version, // Make sure the update_url_data string is escaped before using it so that // there is no chance of overriding the id or v other parameter value // we place into the x= value. - parts.push_back("ap=" + EscapeQueryParamValue(update_url_data, true)); + parts.push_back("ap=" + net::EscapeQueryParamValue(update_url_data, true)); } // Append rollcall and active ping parameters. @@ -205,11 +205,11 @@ bool ManifestFetchData::AddExtension(std::string id, std::string version, } #endif // SEND_ACTIVE_PINGS if (!ping_value.empty()) - parts.push_back("ping=" + EscapeQueryParamValue(ping_value, true)); + parts.push_back("ping=" + net::EscapeQueryParamValue(ping_value, true)); } std::string extra = full_url_.has_query() ? "&" : "?"; - extra += "x=" + EscapeQueryParamValue(JoinString(parts, '&'), true); + extra += "x=" + net::EscapeQueryParamValue(JoinString(parts, '&'), true); // Check against our max url size, exempting the first extension added. int new_size = full_url_.possibly_invalid_spec().size() + extra.size(); diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc index 7b2ae50..95e2ac7 100644 --- a/chrome/browser/notifications/desktop_notification_service.cc +++ b/chrome/browser/notifications/desktop_notification_service.cc @@ -208,7 +208,7 @@ string16 DesktopNotificationService::CreateDataUrl( std::string data = ReplaceStringPlaceholders(template_html, subst, NULL); return UTF8ToUTF16("data:text/html;charset=utf-8," + - EscapeQueryParamValue(data, false)); + net::EscapeQueryParamValue(data, false)); } DesktopNotificationService::DesktopNotificationService(Profile* profile, diff --git a/chrome/browser/policy/device_management_backend_impl.cc b/chrome/browser/policy/device_management_backend_impl.cc index c111ad3..39889dc 100644 --- a/chrome/browser/policy/device_management_backend_impl.cc +++ b/chrome/browser/policy/device_management_backend_impl.cc @@ -111,9 +111,9 @@ std::string URLQueryParameters::Encode() { ++entry) { if (entry != params_.begin()) result += '&'; - result += EscapeQueryParamValue(entry->first, true); + result += net::EscapeQueryParamValue(entry->first, true); result += '='; - result += EscapeQueryParamValue(entry->second, true); + result += net::EscapeQueryParamValue(entry->second, true); } return result; } diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc index 87e705e..412325a 100644 --- a/chrome/browser/safe_browsing/protocol_manager.cc +++ b/chrome/browser/safe_browsing/protocol_manager.cc @@ -797,9 +797,9 @@ GURL SafeBrowsingProtocolManager::SafeBrowsingHitUrl( } return GURL(base::StringPrintf("%s&evts=%s&evtd=%s&evtr=%s&evhr=%s&evtb=%d", url.c_str(), threat_list.c_str(), - EscapeQueryParamValue(malicious_url.spec(), true).c_str(), - EscapeQueryParamValue(page_url.spec(), true).c_str(), - EscapeQueryParamValue(referrer_url.spec(), true).c_str(), + net::EscapeQueryParamValue(malicious_url.spec(), true).c_str(), + net::EscapeQueryParamValue(page_url.spec(), true).c_str(), + net::EscapeQueryParamValue(referrer_url.spec(), true).c_str(), is_subresource)); } diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc index 8ddc4ed..8396ffe 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc @@ -10,8 +10,8 @@ #include "base/i18n/rtl.h" #include "base/lazy_instance.h" -#include "base/stringprintf.h" #include "base/string_number_conversions.h" +#include "base/stringprintf.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/browser_process.h" @@ -497,7 +497,7 @@ void SafeBrowsingBlockingPage::CommandReceived(const std::string& cmd) { // We're going to take the user to Google's SafeBrowsing diagnostic page. std::string diagnostic = base::StringPrintf(kSbDiagnosticUrl, - EscapeQueryParamValue(bad_url_spec, true).c_str()); + net::EscapeQueryParamValue(bad_url_spec, true).c_str()); GURL diagnostic_url(diagnostic); diagnostic_url = google_util::AppendGoogleLocaleParam(diagnostic_url); DCHECK(unsafe_resources_[element_index].threat_type == diff --git a/chrome/browser/safe_browsing/safe_browsing_util.cc b/chrome/browser/safe_browsing/safe_browsing_util.cc index 8503913..58351f7 100644 --- a/chrome/browser/safe_browsing/safe_browsing_util.cc +++ b/chrome/browser/safe_browsing/safe_browsing_util.cc @@ -6,11 +6,11 @@ #include "base/base64.h" #include "base/logging.h" -#include "base/stringprintf.h" #include "base/string_util.h" +#include "base/stringprintf.h" +#include "chrome/browser/google/google_util.h" #include "crypto/hmac.h" #include "crypto/sha2.h" -#include "chrome/browser/google/google_util.h" #include "googleurl/src/gurl.h" #include "googleurl/src/url_util.h" #include "net/base/escape.h" @@ -517,9 +517,10 @@ GURL GeneratePhishingReportUrl(const std::string& report_page, const char* lang = locale.getLanguage(); if (!lang) lang = "en"; // fallback - const std::string continue_esc = - EscapeQueryParamValue(base::StringPrintf(kContinueUrlFormat, lang), true); - const std::string current_esc = EscapeQueryParamValue(url_to_report, true); + const std::string continue_esc = net::EscapeQueryParamValue( + base::StringPrintf(kContinueUrlFormat, lang), true); + const std::string current_esc = net::EscapeQueryParamValue(url_to_report, + true); #if defined(OS_WIN) BrowserDistribution* dist = BrowserDistribution::GetDistribution(); diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc index 4d15e2d..1084a03f 100644 --- a/chrome/browser/search_engines/template_url.cc +++ b/chrome/browser/search_engines/template_url.cc @@ -342,14 +342,14 @@ std::string TemplateURLRef::ReplaceSearchTermsUsingTermsData( // Encode the search terms so that we know the encoding. const std::vector<std::string>& encodings = host.input_encodings(); for (size_t i = 0; i < encodings.size(); ++i) { - if (EscapeQueryParamValue(terms, - encodings[i].c_str(), true, - &encoded_terms)) { + if (net::EscapeQueryParamValue(terms, + encodings[i].c_str(), true, + &encoded_terms)) { if (!original_query_for_suggestion.empty()) { - EscapeQueryParamValue(original_query_for_suggestion, - encodings[i].c_str(), - true, - &encoded_original_query); + net::EscapeQueryParamValue(original_query_for_suggestion, + encodings[i].c_str(), + true, + &encoded_original_query); } input_encoding = encodings[i]; break; diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 9a24b1b..639ba74 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -155,8 +155,8 @@ #include "ui/base/animation/animation.h" #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/point.h" -#include "webkit/glue/webkit_glue.h" #include "webkit/glue/web_intent_data.h" +#include "webkit/glue/webkit_glue.h" #include "webkit/glue/window_open_disposition.h" #if defined(OS_WIN) @@ -1791,8 +1791,9 @@ void Browser::EmailPageLocation() { TabContents* tc = GetSelectedTabContents(); DCHECK(tc); - std::string title = EscapeQueryParamValue(UTF16ToUTF8(tc->GetTitle()), false); - std::string page_url = EscapeQueryParamValue(tc->GetURL().spec(), false); + std::string title = net::EscapeQueryParamValue( + UTF16ToUTF8(tc->GetTitle()), false); + std::string page_url = net::EscapeQueryParamValue(tc->GetURL().spec(), false); std::string mailto = std::string("mailto:?subject=Fwd:%20") + title + "&body=%0A%0A" + page_url; platform_util::OpenExternal(GURL(mailto)); diff --git a/chrome/browser/ui/webui/history2_ui.cc b/chrome/browser/ui/webui/history2_ui.cc index a426c05..2e83bcf 100644 --- a/chrome/browser/ui/webui/history2_ui.cc +++ b/chrome/browser/ui/webui/history2_ui.cc @@ -33,8 +33,8 @@ #include "content/browser/tab_contents/tab_contents.h" #include "content/browser/tab_contents/tab_contents_delegate.h" #include "content/browser/user_metrics.h" -#include "content/common/notification_source.h" #include "content/common/notification_details.h" +#include "content/common/notification_source.h" #include "grit/browser_resources.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -388,7 +388,7 @@ HistoryUI2::HistoryUI2(TabContents* contents) : ChromeWebUI(contents) { // static const GURL HistoryUI2::GetHistoryURLWithSearchText(const string16& text) { return GURL(std::string(chrome::kChromeUIHistory2URL) + "#q=" + - EscapeQueryParamValue(UTF16ToUTF8(text), true)); + net::EscapeQueryParamValue(UTF16ToUTF8(text), true)); } // static diff --git a/chrome/browser/ui/webui/history_ui.cc b/chrome/browser/ui/webui/history_ui.cc index 1508b4b..5bf1fb3 100644 --- a/chrome/browser/ui/webui/history_ui.cc +++ b/chrome/browser/ui/webui/history_ui.cc @@ -398,7 +398,7 @@ HistoryUI::HistoryUI(TabContents* contents) : ChromeWebUI(contents) { // static const GURL HistoryUI::GetHistoryURLWithSearchText(const string16& text) { return GURL(std::string(chrome::kChromeUIHistoryURL) + "#q=" + - EscapeQueryParamValue(UTF16ToUTF8(text), true)); + net::EscapeQueryParamValue(UTF16ToUTF8(text), true)); } // static |