summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-02 23:05:08 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-02 23:05:08 +0000
commit48797906a6bba708e777908049b8496035ed860f (patch)
treec3b9f76f773e92ad70e0f3352ff5d518be1b17d3 /chrome
parent2cec759bc34b3f3e7fb3a624474f8ea188a3c975 (diff)
downloadchromium_src-48797906a6bba708e777908049b8496035ed860f.zip
chromium_src-48797906a6bba708e777908049b8496035ed860f.tar.gz
chromium_src-48797906a6bba708e777908049b8496035ed860f.tar.bz2
net: Move UnescapeURLComponent() functions into net namespace.
BUG=64263 TEST=None R=willchan@chromium.org Review URL: http://codereview.chromium.org/8109004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103677 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/autocomplete/history_quick_provider.cc4
-rw-r--r--chrome/browser/browser_about_handler.cc4
-rw-r--r--chrome/browser/extensions/extension_updater_unittest.cc8
-rw-r--r--chrome/browser/net/url_fixer_upper.cc4
-rw-r--r--chrome/browser/policy/device_management_service_unittest.cc24
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_util.cc2
-rw-r--r--chrome/browser/search_engines/template_url.cc6
-rw-r--r--chrome/browser/ui/webui/fileicon_source.cc3
-rw-r--r--chrome/browser/ui/webui/ntp/app_launcher_handler.cc2
-rw-r--r--chrome/common/extensions/extension_file_util.cc4
-rw-r--r--chrome/renderer/external_extension_uitest.cc2
-rw-r--r--chrome/test/ui/ui_layout_test.cc2
12 files changed, 33 insertions, 32 deletions
diff --git a/chrome/browser/autocomplete/history_quick_provider.cc b/chrome/browser/autocomplete/history_quick_provider.cc
index da852c0..ae42585 100644
--- a/chrome/browser/autocomplete/history_quick_provider.cc
+++ b/chrome/browser/autocomplete/history_quick_provider.cc
@@ -21,9 +21,9 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
-#include "googleurl/src/url_parse.h"
#include "content/common/content_notification_types.h"
#include "content/common/notification_source.h"
+#include "googleurl/src/url_parse.h"
#include "googleurl/src/url_util.h"
#include "net/base/escape.h"
#include "net/base/net_util.h"
@@ -88,7 +88,7 @@ void HistoryQuickProvider::DeleteMatch(const AutocompleteMatch& match) {}
void HistoryQuickProvider::DoAutocomplete() {
// Get the matching URLs from the DB.
string16 term_string = autocomplete_input_.text();
- term_string = UnescapeURLComponent(term_string,
+ term_string = net::UnescapeURLComponent(term_string,
UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS);
history::InMemoryURLIndex::String16Vector terms(
InMemoryURLIndex::WordVectorFromString16(term_string, false));
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index 98a72aa..853dc9d 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -845,7 +845,7 @@ std::string AboutHistograms(const std::string& query) {
std::string unescaped_query;
std::string unescaped_title("About Histograms");
if (!query.empty()) {
- unescaped_query = UnescapeURLComponent(query, UnescapeRule::NORMAL);
+ unescaped_query = net::UnescapeURLComponent(query, UnescapeRule::NORMAL);
unescaped_title += " - " + unescaped_query;
}
@@ -877,7 +877,7 @@ static std::string AboutObjects(const std::string& query) {
std::string unescaped_title("About Histograms");
if (!query.empty()) {
unescaped_title += " - ";
- unescaped_title += UnescapeURLComponent(query, UnescapeRule::NORMAL);
+ unescaped_title += net::UnescapeURLComponent(query, UnescapeRule::NORMAL);
}
std::string data;
AppendHeader(&data, 0, unescaped_title);
diff --git a/chrome/browser/extensions/extension_updater_unittest.cc b/chrome/browser/extensions/extension_updater_unittest.cc
index 98a09d7..c0ac93a 100644
--- a/chrome/browser/extensions/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/extension_updater_unittest.cc
@@ -365,8 +365,8 @@ class ExtensionUpdaterTest : public testing::Test {
base::SplitString(url.query(), '=', &parts);
EXPECT_EQ(2u, parts.size());
EXPECT_EQ("x", parts[0]);
- std::string decoded = UnescapeURLComponent(parts[1],
- UnescapeRule::URL_SPECIAL_CHARS);
+ std::string decoded = net::UnescapeURLComponent(
+ parts[1], UnescapeRule::URL_SPECIAL_CHARS);
std::map<std::string, std::string> params;
ExtractParameters(decoded, &params);
if (pending) {
@@ -416,8 +416,8 @@ class ExtensionUpdaterTest : public testing::Test {
base::SplitString(url.query(), '=', &parts);
EXPECT_EQ(2u, parts.size());
EXPECT_EQ("x", parts[0]);
- std::string decoded = UnescapeURLComponent(parts[1],
- UnescapeRule::URL_SPECIAL_CHARS);
+ std::string decoded = net::UnescapeURLComponent(
+ parts[1], UnescapeRule::URL_SPECIAL_CHARS);
std::map<std::string, std::string> params;
ExtractParameters(decoded, &params);
EXPECT_EQ("com.google.crx.blacklist", params["id"]);
diff --git a/chrome/browser/net/url_fixer_upper.cc b/chrome/browser/net/url_fixer_upper.cc
index 4d85b42..486556b 100644
--- a/chrome/browser/net/url_fixer_upper.cc
+++ b/chrome/browser/net/url_fixer_upper.cc
@@ -548,11 +548,11 @@ GURL URLFixerUpper::FixupRelativeFile(const FilePath& base_dir,
// escaped things. We need to go through 8-bit since the escaped values
// only represent 8-bit values.
#if defined(OS_WIN)
- std::wstring unescaped = UTF8ToWide(UnescapeURLComponent(
+ std::wstring unescaped = UTF8ToWide(net::UnescapeURLComponent(
WideToUTF8(trimmed),
UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS));
#elif defined(OS_POSIX)
- std::string unescaped = UnescapeURLComponent(
+ std::string unescaped = net::UnescapeURLComponent(
trimmed,
UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS);
#endif
diff --git a/chrome/browser/policy/device_management_service_unittest.cc b/chrome/browser/policy/device_management_service_unittest.cc
index a09f46f..dd09974 100644
--- a/chrome/browser/policy/device_management_service_unittest.cc
+++ b/chrome/browser/policy/device_management_service_unittest.cc
@@ -250,23 +250,23 @@ class QueryParams {
bool found = false;
for (ParamMap::const_iterator i(params_.begin()); i != params_.end(); ++i) {
std::string unescaped_name(
- UnescapeURLComponent(i->first,
- UnescapeRule::NORMAL |
- UnescapeRule::SPACES |
- UnescapeRule::URL_SPECIAL_CHARS |
- UnescapeRule::CONTROL_CHARS |
- UnescapeRule::REPLACE_PLUS_WITH_SPACE));
+ net::UnescapeURLComponent(i->first,
+ UnescapeRule::NORMAL |
+ UnescapeRule::SPACES |
+ UnescapeRule::URL_SPECIAL_CHARS |
+ UnescapeRule::CONTROL_CHARS |
+ UnescapeRule::REPLACE_PLUS_WITH_SPACE));
if (unescaped_name == name) {
if (found)
return false;
found = true;
std::string unescaped_value(
- UnescapeURLComponent(i->second,
- UnescapeRule::NORMAL |
- UnescapeRule::SPACES |
- UnescapeRule::URL_SPECIAL_CHARS |
- UnescapeRule::CONTROL_CHARS |
- UnescapeRule::REPLACE_PLUS_WITH_SPACE));
+ net::UnescapeURLComponent(i->second,
+ UnescapeRule::NORMAL |
+ UnescapeRule::SPACES |
+ UnescapeRule::URL_SPECIAL_CHARS |
+ UnescapeRule::CONTROL_CHARS |
+ UnescapeRule::REPLACE_PLUS_WITH_SPACE));
if (unescaped_value != expected_value)
return false;
}
diff --git a/chrome/browser/safe_browsing/safe_browsing_util.cc b/chrome/browser/safe_browsing/safe_browsing_util.cc
index 29007c6..910b94f 100644
--- a/chrome/browser/safe_browsing/safe_browsing_util.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_util.cc
@@ -225,7 +225,7 @@ std::string Unescape(const std::string& url) {
int loop_var = 0;
do {
old_unescaped_str = unescaped_str;
- unescaped_str = UnescapeURLComponent(old_unescaped_str,
+ unescaped_str = net::UnescapeURLComponent(old_unescaped_str,
UnescapeRule::CONTROL_CHARS | UnescapeRule::SPACES |
UnescapeRule::URL_SPECIAL_CHARS);
} while (unescaped_str != old_unescaped_str && ++loop_var <=
diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc
index ced4654..93564ab 100644
--- a/chrome/browser/search_engines/template_url.cc
+++ b/chrome/browser/search_engines/template_url.cc
@@ -526,9 +526,9 @@ string16 TemplateURLRef::SearchTermToString16(const TemplateURL& host,
const std::vector<std::string>& encodings = host.input_encodings();
string16 result;
- std::string unescaped =
- UnescapeURLComponent(term, UnescapeRule::REPLACE_PLUS_WITH_SPACE |
- UnescapeRule::URL_SPECIAL_CHARS);
+ std::string unescaped = net::UnescapeURLComponent(
+ term,
+ UnescapeRule::REPLACE_PLUS_WITH_SPACE | UnescapeRule::URL_SPECIAL_CHARS);
for (size_t i = 0; i < encodings.size(); ++i) {
if (base::CodepageToUTF16(unescaped, encodings[i].c_str(),
base::OnStringConversionError::FAIL, &result))
diff --git a/chrome/browser/ui/webui/fileicon_source.cc b/chrome/browser/ui/webui/fileicon_source.cc
index cd5d936..b3ba838 100644
--- a/chrome/browser/ui/webui/fileicon_source.cc
+++ b/chrome/browser/ui/webui/fileicon_source.cc
@@ -29,7 +29,8 @@ FileIconSource::~FileIconSource() {
void FileIconSource::StartDataRequest(const std::string& path,
bool is_incognito,
int request_id) {
- std::string escaped_path = UnescapeURLComponent(path, UnescapeRule::SPACES);
+ std::string escaped_path = net::UnescapeURLComponent(path,
+ UnescapeRule::SPACES);
#if defined(OS_WIN)
// The path we receive has the wrong slashes and escaping for what we need;
// this only appears to matter for getting icons from .exe files.
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index 7ba788d..e891966 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -871,7 +871,7 @@ void AppLauncherHandler::RecordAppLaunchByURL(
extension_misc::AppLaunchBucket bucket) {
CHECK(bucket != extension_misc::APP_LAUNCH_BUCKET_INVALID);
- GURL url(UnescapeURLComponent(escaped_url, kUnescapeRules));
+ GURL url(net::UnescapeURLComponent(escaped_url, kUnescapeRules));
DCHECK(profile->GetExtensionService());
if (!profile->GetExtensionService()->IsInstalledApp(url))
return;
diff --git a/chrome/common/extensions/extension_file_util.cc b/chrome/common/extensions/extension_file_util.cc
index 55ca7de..a8ad8bb 100644
--- a/chrome/common/extensions/extension_file_util.cc
+++ b/chrome/common/extensions/extension_file_util.cc
@@ -20,8 +20,8 @@
#include "chrome/common/extensions/extension_action.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_l10n_util.h"
-#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/extensions/extension_message_bundle.h"
+#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/extensions/extension_resource.h"
#include "chrome/common/extensions/extension_sidebar_defaults.h"
#include "content/common/json_value_serializer.h"
@@ -550,7 +550,7 @@ FilePath ExtensionURLToRelativeFilePath(const GURL& url) {
return FilePath();
// Drop the leading slashes and convert %-encoded UTF8 to regular UTF8.
- std::string file_path = UnescapeURLComponent(url_path,
+ std::string file_path = net::UnescapeURLComponent(url_path,
UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS);
size_t skip = file_path.find_first_not_of("/\\");
if (skip != file_path.npos)
diff --git a/chrome/renderer/external_extension_uitest.cc b/chrome/renderer/external_extension_uitest.cc
index 66a3fbd..7f16a09 100644
--- a/chrome/renderer/external_extension_uitest.cc
+++ b/chrome/renderer/external_extension_uitest.cc
@@ -118,7 +118,7 @@ void SearchProviderTest::FinishIsSearchProviderInstalledTest(
TestTimeouts::action_max_timeout_ms());
// Unescapes and normalizes the actual result.
- std::string value = UnescapeURLComponent(
+ std::string value = net::UnescapeURLComponent(
escaped_value,
UnescapeRule::NORMAL | UnescapeRule::SPACES |
UnescapeRule::URL_SPECIAL_CHARS | UnescapeRule::CONTROL_CHARS);
diff --git a/chrome/test/ui/ui_layout_test.cc b/chrome/test/ui/ui_layout_test.cc
index ed2acbf..699b7c6 100644
--- a/chrome/test/ui/ui_layout_test.cc
+++ b/chrome/test/ui/ui_layout_test.cc
@@ -227,7 +227,7 @@ void UILayoutTest::RunLayoutTest(const std::string& test_case_file_name,
status_cookie.c_str(), TestTimeouts::action_max_timeout_ms());
// Unescapes and normalizes the actual result.
- std::string value = UnescapeURLComponent(escaped_value,
+ std::string value = net::UnescapeURLComponent(escaped_value,
UnescapeRule::NORMAL | UnescapeRule::SPACES |
UnescapeRule::URL_SPECIAL_CHARS | UnescapeRule::CONTROL_CHARS);
value += "\n";