0

Remove net wrappers around base/strings/escape.h

A number of string escaping functions were moved from //net to
//base/strings recently. crbug.com/1100760 was filed to move callers
to the new location and remove the net:: functions. This CL does that
and removes net/base/escape.h and .cc.

https://docs.google.com/document/d/1bNDZyi3uHN1aYf1ReWpa8R9DHM50JnHcouH3d3G8Na8/edit#

Bug: 1068052
Change-Id: Ic879d91e53f1d0f4fa925d7e4887e40ef8350709
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3583363
Reviewed-by: danakj <danakj@chromium.org>
Owners-Override: danakj <danakj@chromium.org>
Commit-Queue: Ryan Hamilton <rch@chromium.org>
Cr-Commit-Position: refs/heads/main@{#995437}
This commit is contained in:
Ryan Hamilton
2022-04-23 00:07:39 +00:00
committed by Chromium LUCI CQ
parent 9052a2ff2d
commit 7f3bd3d40f
320 changed files with 1009 additions and 1227 deletions
android_webview/browser/renderer_host
ash
chrome
browser
accessibility
android
ash
autocomplete
bookmarks
chromeos
client_hints
devtools
dom_distiller
enterprise
error_reporting
extensions
external_protocol
geolocation
media
metrics
net
notifications
optimization_guide
page_load_metrics
password_check
password_entry_edit
performance_hints
plugins
predictors
prefetch
process_singleton_win.cc
profile_resetter
profiles
renderer_context_menu
safe_browsing
sharing_hub
ssl
supervised_user
kids_chrome_management
sync
test
sync_file_system
ui
url_param_filter
vr
web_applications
web_share_target
credential_provider
renderer
utility
chromecast/renderer
chromeos/components/quick_answers
components
android_system_error_page
autofill
bookmarks
custom_handlers
dom_distiller
drive
embedder_support
android
java
src
org
chromium
components
embedder_support
util
error_page
history
history_clusters
media_router
common
navigation_interception
omnibox
password_manager
core
browser
policy
printing
quirks
safe_browsing
safe_search_api
search_engines
security_interstitials
shared_highlighting
signin
ssl_errors
translate
url_formatter
url_matcher
variations
content
app_shim_remote_cocoa
browser
public
renderer
services
auction_worklet
docs/security/url_display_guidelines
extensions
google_apis
ios
net
pdf
remoting
services
storage
third_party/blink
renderer
core
platform
loader
tools
blinkpy
ui/base
weblayer/browser

@ -8,8 +8,8 @@
#include <vector>
#include "base/notreached.h"
#include "base/strings/escape.h"
#include "base/strings/string_split.h"
#include "net/base/escape.h"
namespace android_webview {
@ -51,7 +51,7 @@ bool ParseHeader(const std::string& header,
++it) {
const std::string& key = it->first;
const std::string& value = it->second;
std::string unescaped_value = net::UnescapeBinaryURLComponent(value);
std::string unescaped_value = base::UnescapeBinaryURLComponent(value);
if (key == "realm") {
if (!MatchRealm(unescaped_value, realm_restriction))
return false;

@ -15,8 +15,8 @@
#include "ash/constants/ash_features.h"
#include "ash/public/cpp/style/color_provider.h"
#include "ash/public/cpp/style/scoped_light_mode_as_default.h"
#include "base/strings/escape.h"
#include "base/strings/utf_string_conversions.h"
#include "net/base/escape.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/chromeos/styles/cros_styles.h"
@ -134,12 +134,12 @@ void AssistantQueryView::SetText(const std::string& high_confidence_text,
// |low_confidence_text| may be HTML escaped, so we need to unescape both
// before displaying to avoid printing HTML entities to the user.
const std::u16string& high_confidence_text_16 =
net::UnescapeForHTML(base::UTF8ToUTF16(high_confidence_text));
base::UnescapeForHTML(base::UTF8ToUTF16(high_confidence_text));
high_confidence_label_->SetText(high_confidence_text_16);
const std::u16string& low_confidence_text_16 =
net::UnescapeForHTML(base::UTF8ToUTF16(low_confidence_text));
base::UnescapeForHTML(base::UTF8ToUTF16(low_confidence_text));
low_confidence_label_->SetText(low_confidence_text_16);
}

@ -8,11 +8,11 @@
#include "ash/assistant/util/i18n_util.h"
#include "base/containers/contains.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "chromeos/services/assistant/public/cpp/assistant_service.h"
#include "net/base/escape.h"
#include "net/base/url_util.h"
#include "url/gurl.h"
@ -224,8 +224,8 @@ absl::optional<std::string> GetDeepLinkParam(
const std::string key = GetDeepLinkParamKey(param);
const auto it = params.find(key);
return it != params.end()
? absl::optional<std::string>(net::UnescapeBinaryURLComponent(
it->second, net::UnescapeRule::REPLACE_PLUS_WITH_SPACE))
? absl::optional<std::string>(base::UnescapeBinaryURLComponent(
it->second, base::UnescapeRule::REPLACE_PLUS_WITH_SPACE))
: absl::nullopt;
}

@ -18,12 +18,12 @@
#include "base/json/json_writer.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "base/values.h"
#include "google_apis/google_api_keys.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
#include "services/network/public/cpp/resource_request.h"
@ -155,7 +155,7 @@ GURL GeolocationRequestURL(const GURL& url) {
std::string query(url.query());
if (!query.empty())
query += "&";
query += "key=" + net::EscapeQueryParamValue(api_key, true);
query += "key=" + base::EscapeQueryParamValue(api_key, true);
GURL::Replacements replacements;
replacements.SetQueryStr(query);
return url.ReplaceComponents(replacements);

@ -13,12 +13,12 @@
#include "base/json/json_reader.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "base/values.h"
#include "google_apis/google_api_keys.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
#include "services/network/public/cpp/resource_request.h"
@ -182,7 +182,7 @@ GURL TimeZoneRequestURL(const GURL& url,
query += "&";
query += kKeyString;
query += "=";
query += net::EscapeQueryParamValue(api_key, true);
query += base::EscapeQueryParamValue(api_key, true);
}
}
if (!geoposition.timestamp.is_null()) {

@ -14,6 +14,7 @@
#include "base/command_line.h"
#include "base/json/json_writer.h"
#include "base/notreached.h"
#include "base/strings/escape.h"
#include "base/strings/pattern.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
@ -40,7 +41,6 @@
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_ui_data_source.h"
#include "net/base/escape.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/accessibility/accessibility_features.h"
#include "ui/accessibility/platform/ax_platform_node.h"
@ -123,7 +123,7 @@ std::unique_ptr<base::DictionaryValue> BuildTargetDescriptor(
target_data->SetIntKey(kProcessIdField, process_id);
target_data->SetIntKey(kRoutingIdField, routing_id);
target_data->SetStringKey(kUrlField, url.spec());
target_data->SetStringKey(kNameField, net::EscapeForHTML(name));
target_data->SetStringKey(kNameField, base::EscapeForHTML(name));
target_data->SetIntKey(kPidField, base::GetProcId(handle));
target_data->SetStringKey(kFaviconUrlField, favicon_url.spec());
target_data->SetIntKey(kAccessibilityModeField, accessibility_mode.mode());

@ -11,6 +11,7 @@
#include "base/i18n/string_search.h"
#include "base/lazy_instance.h"
#include "base/memory/ptr_util.h"
#include "base/strings/escape.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/android/bookmarks/partner_bookmarks_reader.h"
@ -23,7 +24,6 @@
#include "components/url_formatter/url_formatter.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/escape.h"
#include "ui/base/models/tree_node_iterator.h"
using bookmarks::BookmarkNode;

@ -14,12 +14,12 @@
#include "base/i18n/case_conversion.h"
#include "base/i18n/string_search.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/escape.h"
#include "base/strings/utf_string_conversions.h"
#include "base/supports_user_data.h"
#include "components/bookmarks/browser/bookmark_node.h"
#include "components/bookmarks/browser/bookmark_utils.h"
#include "components/url_formatter/url_formatter.h"
#include "net/base/escape.h"
#include "ui/base/models/tree_node_iterator.h"
#include "url/gurl.h"

@ -14,6 +14,7 @@
#include "base/feature_list.h"
#include "base/json/json_string_value_serializer.h"
#include "base/json/json_writer.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@ -37,7 +38,6 @@
#include "components/variations/variations_associated_data.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h"
#include "net/base/escape.h"
#include "net/http/http_status_code.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/simple_url_loader.h"

@ -14,6 +14,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/escape.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
@ -25,7 +26,6 @@
#include "chrome/common/chrome_switches.h"
#include "components/search_engines/template_url_service.h"
#include "components/variations/scoped_variations_ids_provider.h"
#include "net/base/escape.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "services/network/test/test_url_loader_factory.h"

@ -5,8 +5,8 @@
#include "chrome/browser/ash/arc/fileapi/arc_content_file_system_url_util.h"
#include "base/files/file_path.h"
#include "base/strings/escape.h"
#include "chrome/browser/chromeos/fileapi/external_file_url_util.h"
#include "net/base/escape.h"
#include "storage/browser/file_system/file_system_url.h"
namespace arc {
@ -19,11 +19,11 @@ const base::FilePath::CharType kContentFileSystemMountPointPath[] =
FILE_PATH_LITERAL("/special/arc-content");
std::string EscapeArcUrl(const GURL& arc_url) {
return net::EscapeQueryParamValue(arc_url.spec(), false);
return base::EscapeQueryParamValue(arc_url.spec(), false);
}
GURL UnescapeArcUrl(const std::string& escaped_arc_url) {
return GURL(net::UnescapeBinaryURLComponent(escaped_arc_url));
return GURL(base::UnescapeBinaryURLComponent(escaped_arc_url));
}
GURL ArcUrlToExternalFileUrl(const GURL& arc_url) {

@ -9,10 +9,10 @@
#include "ash/components/arc/mojom/file_system.mojom.h"
#include "base/containers/contains.h"
#include "base/strings/escape.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "net/base/escape.h"
#include "net/base/mime_util.h"
#include "storage/browser/file_system/file_system_url.h"
#include "url/gurl.h"
@ -117,9 +117,10 @@ std::string EscapePathComponent(const std::string& name) {
}
std::string UnescapePathComponent(const std::string& escaped) {
return net::UnescapeURLComponent(
escaped, net::UnescapeRule::PATH_SEPARATORS |
net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS);
return base::UnescapeURLComponent(
escaped,
base::UnescapeRule::PATH_SEPARATORS |
base::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS);
}
const char kDocumentsProviderMountPointName[] = "arc-documents-provider";
@ -181,8 +182,8 @@ GURL BuildDocumentUrl(const std::string& authority,
const std::string& document_id) {
return GURL(base::StringPrintf(
"content://%s/document/%s",
net::EscapeQueryParamValue(authority, false /* use_plus */).c_str(),
net::EscapeQueryParamValue(document_id, false /* use_plus */).c_str()));
base::EscapeQueryParamValue(authority, false /* use_plus */).c_str(),
base::EscapeQueryParamValue(document_id, false /* use_plus */).c_str()));
}
std::vector<base::FilePath::StringType> GetExtensionsForArcMimeType(

@ -18,6 +18,7 @@
#include "base/logging.h"
#include "base/memory/singleton.h"
#include "base/posix/eintr_wrapper.h"
#include "base/strings/escape.h"
#include "base/system/sys_info.h"
#include "base/task/bind_post_task.h"
#include "base/task/thread_pool.h"
@ -40,7 +41,6 @@
#include "extensions/browser/api/file_handlers/mime_util.h"
#include "mojo/public/cpp/platform/platform_handle.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "net/base/escape.h"
#include "storage/browser/file_system/external_mount_points.h"
#include "storage/browser/file_system/file_system_context.h"
#include "url/gurl.h"
@ -188,9 +188,9 @@ void ArcFileSystemBridge::GetFileName(const std::string& url,
// It's generally not safe to unescape path separators in strings to be used
// in file paths.
if (url_decoded.is_empty() || !IsUrlAllowed(url_decoded) ||
!net::UnescapeBinaryURLComponentSafe(url_decoded.ExtractFileName(),
true /* fail_on_path_separators */,
&unescaped_file_name)) {
!base::UnescapeBinaryURLComponentSafe(url_decoded.ExtractFileName(),
true /* fail_on_path_separators */,
&unescaped_file_name)) {
LOG(ERROR) << "Invalid URL: " << url << " " << url_decoded;
std::move(callback).Run(absl::nullopt);
return;

@ -133,7 +133,7 @@ TEST_F(ArcFileSystemBridgeTest, GetFileNameNonASCII) {
run_loop.Run();
}
// net::UnescapeURLComponent() leaves UTF-8 lock icons escaped, but they're
// base::UnescapeURLComponent() leaves UTF-8 lock icons escaped, but they're
// valid file names, so shouldn't be left escaped here.
TEST_F(ArcFileSystemBridgeTest, GetFileNameLockIcon) {
const GURL url("externalfile:abc:test-filesystem:/%F0%9F%94%92");

@ -6,8 +6,8 @@
#include <string>
#include "base/strings/escape.h"
#include "base/strings/string_util.h"
#include "net/base/escape.h"
namespace arc {
@ -20,7 +20,7 @@ constexpr char kChromeContentProviderUrl[] =
GURL EncodeToChromeContentProviderUrl(const GURL& url) {
const std::string escaped =
net::EscapeQueryParamValue(url.spec(), false /* use_plus */);
base::EscapeQueryParamValue(url.spec(), false /* use_plus */);
return GURL(kChromeContentProviderUrl).Resolve(escaped);
}
@ -31,7 +31,7 @@ GURL DecodeFromChromeContentProviderUrl(
base::CompareCase::SENSITIVE))
return GURL();
const std::string escaped = spec.substr(strlen(kChromeContentProviderUrl));
return GURL(net::UnescapeBinaryURLComponent(escaped));
return GURL(base::UnescapeBinaryURLComponent(escaped));
}
} // namespace arc

@ -13,6 +13,7 @@
#include "base/json/json_writer.h"
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@ -47,7 +48,6 @@
#include "components/prefs/pref_service.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/escape.h"
#include "storage/browser/file_system/external_mount_points.h"
#include "storage/browser/file_system/file_system_url.h"
#include "ui/base/base_window.h"
@ -147,7 +147,7 @@ GURL GenerateTerminalURL(Profile* profile,
const std::string& cwd,
const std::vector<std::string>& terminal_args) {
auto escape = [](std::string param) {
return net::EscapeQueryParamValue(param, /*use_plus=*/true);
return base::EscapeQueryParamValue(param, /*use_plus=*/true);
};
std::string start = base::StrCat({chrome::kChromeUIUntrustedTerminalURL,
"html/terminal.html?command=vmshell"});

@ -16,6 +16,7 @@
#include "base/check_op.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/strings/escape.h"
#include "chrome/browser/ash/drive/drive_integration_service.h"
#include "chrome/browser/ash/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h"
@ -27,7 +28,6 @@
#include "components/user_manager/user.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/network_service_instance.h"
#include "net/base/escape.h"
#include "services/network/public/cpp/network_connection_tracker.h"
using content::BrowserThread;

@ -15,6 +15,7 @@
#include "base/containers/contains.h"
#include "base/files/file_util.h"
#include "base/i18n/case_conversion.h"
#include "base/strings/escape.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/ash/file_manager/app_id.h"
@ -40,7 +41,6 @@
#include "extensions/common/extension_set.h"
#include "extensions/common/manifest_handlers/background_info.h"
#include "extensions/common/url_pattern.h"
#include "net/base/escape.h"
#include "storage/browser/file_system/file_system_context.h"
#include "storage/browser/file_system/file_system_url.h"
#include "storage/common/file_system/file_system_info.h"
@ -63,8 +63,8 @@ namespace {
std::string EscapedUtf8ToLower(const std::string& str) {
std::u16string utf16 = base::UTF8ToUTF16(
net::UnescapeURLComponent(str, net::UnescapeRule::NORMAL));
return net::EscapeUrlEncodedData(
base::UnescapeURLComponent(str, base::UnescapeRule::NORMAL));
return base::EscapeUrlEncodedData(
base::UTF16ToUTF8(base::i18n::ToLower(utf16)),
false /* do not replace space with plus */);
}

@ -42,6 +42,7 @@
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
@ -127,7 +128,6 @@
#include "google_apis/common/test_util.h"
#include "google_apis/drive/drive_api_parser.h"
#include "media/base/media_switches.h"
#include "net/base/escape.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "storage/browser/file_system/external_mount_points.h"
#include "storage/browser/file_system/file_system_context.h"
@ -2259,7 +2259,7 @@ void FileManagerBrowserTestBase::OnCommand(const std::string& name,
std::string json_args;
base::JSONWriter::Write(arg_value, &json_args);
search = base::StrCat(
{"?", net::EscapeUrlEncodedData(json_args, /*use_plus=*/false)});
{"?", base::EscapeUrlEncodedData(json_args, /*use_plus=*/false)});
}
std::string baseURL = ash::file_manager::kChromeUIFileManagerURL;

@ -13,6 +13,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/values.h"
#include "chrome/browser/ash/crostini/crostini_pref_names.h"
#include "chrome/browser/ash/crostini/crostini_test_helper.h"
@ -44,7 +45,6 @@
#include "extensions/common/extension_builder.h"
#include "extensions/common/manifest.h"
#include "google_apis/drive/drive_api_parser.h"
#include "net/base/escape.h"
#include "storage/browser/file_system/external_mount_points.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
@ -583,7 +583,7 @@ class FileManagerFileTasksCrostiniTest
}
GURL PathToURL(const std::string& path) {
std::string virtual_path = net::EscapeUrlEncodedData(
std::string virtual_path = base::EscapeUrlEncodedData(
util::GetDownloadsMountPointName(test_profile_.get()) + "/" + path,
/*use_plus=*/false);
return GURL("filesystem:chrome-extension://id/external/" + virtual_path);

@ -13,6 +13,7 @@
#include "base/files/file.h"
#include "base/files/file_error_or.h"
#include "base/files/file_path.h"
#include "base/strings/escape.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
@ -29,7 +30,6 @@
#include "extensions/browser/extension_util.h"
#include "extensions/common/extension.h"
#include "google_apis/common/task_util.h"
#include "net/base/escape.h"
#include "storage/browser/file_system/file_system_context.h"
#include "storage/browser/file_system/isolated_context.h"
#include "storage/browser/file_system/open_file_system_mode.h"
@ -57,8 +57,8 @@ GURL ConvertRelativeFilePathToFileSystemUrl(const base::FilePath& relative_path,
GURL base_url = storage::GetFileSystemRootURI(
source_url, storage::kFileSystemTypeExternal);
return GURL(base_url.spec() +
net::EscapeUrlEncodedData(relative_path.AsUTF8Unsafe(),
false)); // Space to %20 instead of +.
base::EscapeUrlEncodedData(relative_path.AsUTF8Unsafe(),
false)); // Space to %20 instead of +.
}
// Creates an ErrorDefinition with an error set to |error|.

@ -5,6 +5,7 @@
#include "chrome/browser/ash/file_manager/guest_os_file_tasks.h"
#include "base/files/file_path.h"
#include "base/strings/escape.h"
#include "base/values.h"
#include "chrome/browser/ash/crostini/fake_crostini_features.h"
#include "chrome/browser/ash/file_manager/path_util.h"
@ -16,7 +17,6 @@
#include "components/prefs/scoped_user_pref_update.h"
#include "content/public/test/browser_task_environment.h"
#include "extensions/browser/entry_info.h"
#include "net/base/escape.h"
#include "storage/browser/file_system/external_mount_points.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@ -84,7 +84,7 @@ class GuestOsFileTasksTest : public testing::Test {
void AddEntry(const std::string& path, const std::string& mime) {
entries_.push_back(
extensions::EntryInfo(base::FilePath(path), mime, false));
std::string virtual_path = net::EscapeUrlEncodedData(
std::string virtual_path = base::EscapeUrlEncodedData(
util::GetDownloadsMountPointName(&profile_) + "/" + path,
/*use_plus=*/false);
urls_.push_back(

@ -15,6 +15,7 @@
#include "base/bind.h"
#include "base/check_op.h"
#include "base/no_destructor.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@ -48,7 +49,6 @@
#include "components/user_manager/user_manager.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/common/extension.h"
#include "net/base/escape.h"
#include "net/base/filename_util.h"
#include "storage/browser/file_system/external_mount_points.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
@ -370,7 +370,7 @@ std::string GetDownloadsMountPointName(Profile* profile) {
profile->GetOriginalProfile())
: nullptr;
const std::string id = user ? "-" + user->username_hash() : "";
return net::EscapeQueryParamValue(kFolderNameDownloads + id, false);
return base::EscapeQueryParamValue(kFolderNameDownloads + id, false);
}
std::string GetAndroidFilesMountPointName() {
@ -390,8 +390,8 @@ std::string GetGuestOsMountPointName(Profile* profile,
crostini::ContainerId id) {
return base::JoinString(
{"guestos", ash::ProfileHelper::GetUserIdHashFromProfile(profile),
net::EscapeAllExceptUnreserved(id.vm_name),
net::EscapeAllExceptUnreserved(id.container_name)},
base::EscapeAllExceptUnreserved(id.vm_name),
base::EscapeAllExceptUnreserved(id.container_name)},
"+");
}
@ -651,7 +651,7 @@ bool ConvertPathToArcUrl(const base::FilePath& path,
base::FilePath result_path(kArcDownloadRoot);
if (primary_downloads.AppendRelativePath(path, &result_path)) {
*arc_url_out = GURL(arc::kFileSystemFileproviderUrl)
.Resolve(net::EscapePath(result_path.AsUTF8Unsafe()));
.Resolve(base::EscapePath(result_path.AsUTF8Unsafe()));
return true;
}
@ -660,7 +660,7 @@ bool ConvertPathToArcUrl(const base::FilePath& path,
if (base::FilePath(kAndroidFilesPath)
.AppendRelativePath(path, &result_path)) {
*arc_url_out = GURL(arc::kFileSystemFileproviderUrl)
.Resolve(net::EscapePath(result_path.AsUTF8Unsafe()));
.Resolve(base::EscapePath(result_path.AsUTF8Unsafe()));
return true;
}
@ -686,7 +686,7 @@ bool ConvertPathToArcUrl(const base::FilePath& path,
}
*arc_url_out =
GURL(kArcRemovableMediaContentUrlPrefix)
.Resolve(net::EscapePath(relative_path_with_uuid.AsUTF8Unsafe()));
.Resolve(base::EscapePath(relative_path_with_uuid.AsUTF8Unsafe()));
return true;
}
@ -694,7 +694,7 @@ bool ConvertPathToArcUrl(const base::FilePath& path,
if (GetMyFilesFolderForProfile(primary_profile)
.AppendRelativePath(path, &relative_path)) {
*arc_url_out = GURL(kArcMyFilesContentUrlPrefix)
.Resolve(net::EscapePath(relative_path.AsUTF8Unsafe()));
.Resolve(base::EscapePath(relative_path.AsUTF8Unsafe()));
return true;
}
@ -709,7 +709,7 @@ bool ConvertPathToArcUrl(const base::FilePath& path,
if (arc::IsArcVmEnabled()) {
*arc_url_out =
GURL("content://org.chromium.arc.volumeprovider/MyDrive/")
.Resolve(net::EscapePath(relative_path.AsUTF8Unsafe()));
.Resolve(base::EscapePath(relative_path.AsUTF8Unsafe()));
*requires_sharing_out = true;
return true;
}
@ -732,7 +732,7 @@ bool ConvertPathToArcUrl(const base::FilePath& path,
if (arc::IsArcVmEnabled()) {
*arc_url_out =
GURL("content://org.chromium.arc.volumeprovider/archive/")
.Resolve(net::EscapePath(relative_path.AsUTF8Unsafe()));
.Resolve(base::EscapePath(relative_path.AsUTF8Unsafe()));
*requires_sharing_out = true;
return true;
}
@ -752,7 +752,7 @@ bool ConvertPathToArcUrl(const base::FilePath& path,
GURL(base::StrCat(
{"content://org.chromium.arc.volumeprovider/smb/",
share->mount_id(), "/"}))
.Resolve(net::EscapePath(relative_path.AsUTF8Unsafe()));
.Resolve(base::EscapePath(relative_path.AsUTF8Unsafe()));
*requires_sharing_out = true;
return true;
}
@ -999,9 +999,9 @@ std::string GetDisplayableFileName(GURL file_url) {
// Try to convert %20 to spaces, if this produces any invalid char, use the
// file name URL encoded.
std::string file_name;
if (!net::UnescapeBinaryURLComponentSafe(file_url.ExtractFileName(),
/*fail_on_path_separators=*/true,
&file_name)) {
if (!base::UnescapeBinaryURLComponentSafe(file_url.ExtractFileName(),
/*fail_on_path_separators=*/true,
&file_name)) {
file_name = file_url.ExtractFileName();
}

@ -11,10 +11,10 @@
#include "ash/constants/ash_features.h"
#include "base/json/json_writer.h"
#include "base/strings/escape.h"
#include "base/values.h"
#include "chrome/browser/ash/file_manager/app_id.h"
#include "chrome/browser/ash/file_manager/fileapi_util.h"
#include "net/base/escape.h"
namespace file_manager {
namespace util {
@ -140,9 +140,10 @@ GURL GetFileManagerMainPageUrlWithParams(
std::string json_args;
base::JSONWriter::Write(arg_value, &json_args);
std::string url = GetFileManagerMainPageUrl().spec() + '?' +
net::EscapeUrlEncodedData(json_args,
false); // Space to %20 instead of +.
std::string url =
GetFileManagerMainPageUrl().spec() + '?' +
base::EscapeUrlEncodedData(json_args,
false); // Space to %20 instead of +.
return GURL(url);
}

@ -9,12 +9,12 @@
#include "base/files/file_path.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/strings/escape.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/ash/file_manager/fileapi_util.h"
#include "extensions/common/constants.h"
#include "net/base/escape.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/origin.h"
@ -25,7 +25,7 @@ namespace {
// Parse a JSON query string into a base::Value.
base::Value ParseJsonQueryString(const std::string& query) {
const std::string json = net::UnescapeBinaryURLComponent(query);
const std::string json = base::UnescapeBinaryURLComponent(query);
std::unique_ptr<base::Value> value = base::JSONReader::ReadDeprecated(json);
return value ? std::move(*value) : base::Value();
}

@ -8,6 +8,7 @@
#include "base/containers/flat_map.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/escape.h"
#include "base/strings/string_util.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/ash/hats/hats_config.h"
@ -24,7 +25,6 @@
#include "components/prefs/pref_service.h"
#include "components/version_info/version_info.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/escape.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/geometry/size.h"
@ -118,9 +118,9 @@ std::string HatsDialog::GetFormattedSiteContext(
if (!first_iteration)
stream << kDeviceInfoStopKeyword;
stream << net::EscapeQueryParamValue(pair.first, /*use_plus=*/false)
stream << base::EscapeQueryParamValue(pair.first, /*use_plus=*/false)
<< kDeviceInfoKeyValueDelimiter
<< net::EscapeQueryParamValue(pair.second, /*use_plus=*/false);
<< base::EscapeQueryParamValue(pair.second, /*use_plus=*/false);
first_iteration = false;
}

@ -7,6 +7,7 @@
#include <vector>
#include "base/bind.h"
#include "base/strings/escape.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_task_runner_handle.h"
@ -29,7 +30,6 @@
#include "components/prefs/pref_service.h"
#include "components/user_manager/user.h"
#include "dbus/message.h"
#include "net/base/escape.h"
#include "third_party/cros_system_api/dbus/kerberos/dbus-constants.h"
namespace ash {
@ -918,7 +918,7 @@ void KerberosCredentialsManager::OnTicketExpiryNotificationClick(
primary_profile_,
chromeos::settings::mojom::kKerberosAccountsV2SubpagePath +
std::string("?kerberos_reauth=") +
net::EscapeQueryParamValue(principal_name, false /* use_plus */));
base::EscapeQueryParamValue(principal_name, false /* use_plus */));
// Close last! |principal_name| is owned by the notification.
kerberos_ticket_expiry_notification::Close(primary_profile_);

@ -11,6 +11,7 @@
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/escape.h"
#include "base/strings/stringprintf.h"
#include "base/values.h"
#include "chrome/browser/signin/identity_manager_factory.h"
@ -27,7 +28,6 @@
#include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "google_apis/google_api_keys.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
#include "net/url_request/url_request_context_getter.h"
@ -222,8 +222,8 @@ void PasswordSyncTokenFetcher::FetchSyncToken(const std::string& access_token) {
break;
case RequestType::kVerifyToken:
resource_request->url = GetSyncTokenVerifyUrl(
sync_token_, net::EscapeQueryParamValue(google_apis::GetAPIKey(),
/*use_plus=*/true));
sync_token_, base::EscapeQueryParamValue(google_apis::GetAPIKey(),
/*use_plus=*/true));
break;
case RequestType::kNone:
// Error: request type needs to be already set.

@ -14,6 +14,7 @@
#include "base/files/important_file_writer.h"
#include "base/location.h"
#include "base/no_destructor.h"
#include "base/strings/escape.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "base/time/time.h"
@ -29,7 +30,6 @@
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/storage_partition.h"
#include "net/base/escape.h"
#include "net/http/http_response_headers.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/simple_url_loader.h"
@ -267,10 +267,10 @@ void TermsOfServiceScreen::OnDownloaded(
} else {
// If the Terms of Service were downloaded successfully, sanitize and show
// them to the user.
view_->OnLoadSuccess(net::EscapeForHTML(*response_body));
view_->OnLoadSuccess(base::EscapeForHTML(*response_body));
if (features::IsManagedTermsOfServiceEnabled()) {
// Update locally saved terms.
SaveTos(net::EscapeForHTML(*response_body));
SaveTos(base::EscapeForHTML(*response_body));
}
}
}

@ -10,9 +10,9 @@
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/notreached.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "net/base/escape.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
@ -90,7 +90,7 @@ void HttpExchange::Exchange(
if (!data.empty()) {
data += "&";
}
data += net::EscapeUrlEncodedData(kv.first, true);
data += base::EscapeUrlEncodedData(kv.first, true);
data += "=";
switch (kv.second.type()) {
case base::Value::Type::BOOLEAN:
@ -100,7 +100,7 @@ void HttpExchange::Exchange(
data += base::NumberToString(kv.second.GetInt());
break;
case base::Value::Type::STRING:
data += net::EscapeUrlEncodedData(kv.second.GetString(), true);
data += base::EscapeUrlEncodedData(kv.second.GetString(), true);
break;
default:
error_msg_ = "Cannot save a vector value as x-www-form-urlencoded.";

@ -23,7 +23,6 @@
#include "base/values.h"
#include "chrome/browser/ash/printing/oauth2/status_code.h"
#include "chromeos/printing/uri.h"
#include "net/base/escape.h"
#include "net/http/http_status_code.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "services/network/test/test_url_loader_factory.h"
@ -72,11 +71,11 @@ bool ParseURLParameters(const std::string& params_str,
} else {
key = key_val;
}
key = net::UnescapeBinaryURLComponent(key);
key = base::UnescapeBinaryURLComponent(key);
if (key.empty() || results.contains(key)) {
return false;
}
results[key] = net::UnescapeBinaryURLComponent(val);
results[key] = base::UnescapeBinaryURLComponent(val);
}
return true;
}

@ -12,6 +12,7 @@
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted_memory.h"
#include "base/no_destructor.h"
#include "base/strings/escape.h"
#include "base/strings/string_util.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
@ -22,7 +23,6 @@
#include "chrome/common/webui_url_constants.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/prefs/pref_service.h"
#include "net/base/escape.h"
#include "net/base/mime_util.h"
#include "services/network/public/mojom/content_security_policy.mojom.h"
#include "third_party/zlib/google/compression_utils.h"
@ -135,7 +135,7 @@ void TerminalSource::StartDataRequest(
// Refresh the $i8n{themeColor} replacement for css files.
if (base::EndsWith(path, ".css", base::CompareCase::INSENSITIVE_ASCII)) {
replacements_["themeColor"] = net::EscapeForHTML(
replacements_["themeColor"] = base::EscapeForHTML(
crostini::GetTerminalSettingBackgroundColor(profile_));
}

@ -12,6 +12,7 @@
#include "base/memory/raw_ptr.h"
#include "base/metrics/field_trial.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@ -52,7 +53,6 @@
#include "components/variations/scoped_variations_ids_provider.h"
#include "components/variations/variations_associated_data.h"
#include "content/public/test/browser_task_environment.h"
#include "net/base/escape.h"
#include "net/http/http_util.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
@ -508,7 +508,7 @@ void BaseSearchProviderTest::QueryForInputAndWaitForFetcherResponses(
if (!default_fetcher_response.empty()) {
test_url_loader_factory_.AddResponse(
base::StrCat({"http://defaultturl2/", net::EscapePath(text8)}),
base::StrCat({"http://defaultturl2/", base::EscapePath(text8)}),
default_fetcher_response);
}
if (!keyword_fetcher_response.empty()) {
@ -521,7 +521,7 @@ void BaseSearchProviderTest::QueryForInputAndWaitForFetcherResponses(
if (base::StartsWith(keyword, "k ", base::CompareCase::SENSITIVE))
keyword = keyword.substr(2);
test_url_loader_factory_.AddResponse(
base::StrCat({"http://suggest_keyword/", net::EscapePath(keyword)}),
base::StrCat({"http://suggest_keyword/", base::EscapePath(keyword)}),
keyword_fetcher_response);
}
RunTillProviderDone();
@ -578,7 +578,7 @@ void BaseSearchProviderTest::FinishDefaultSuggestQuery(
ASSERT_TRUE(
base::UTF16ToUTF8(query_text.data(), query_text.length(), &text8));
std::string url =
base::StrCat({"http://defaultturl2/", net::EscapePath(text8)});
base::StrCat({"http://defaultturl2/", base::EscapePath(text8)});
ASSERT_TRUE(test_url_loader_factory_.IsPending(url));
@ -807,13 +807,13 @@ TEST_F(SearchProviderTest, SendDataToSuggestAtAppropriateTimes) {
// as appropriate.
EXPECT_EQ(cases[i].expect_to_send_to_default_provider,
test_url_loader_factory_.IsPending(base::StrCat(
{"http://defaultturl2/", net::EscapePath(cases[i].input)})));
{"http://defaultturl2/", base::EscapePath(cases[i].input)})));
// Send the same input with an explicitly invoked keyword. In all cases,
// it's okay to send the request to the keyword suggest server.
QueryForInput(u"k " + ASCIIToUTF16(cases[i].input), false, false);
EXPECT_TRUE(test_url_loader_factory_.IsPending(base::StrCat(
{"http://suggest_keyword/", net::EscapePath(cases[i].input)})));
{"http://suggest_keyword/", base::EscapePath(cases[i].input)})));
}
}

@ -20,6 +20,7 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/supports_user_data.h"
@ -35,7 +36,6 @@
#include "components/favicon_base/favicon_types.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/escape.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/favicon_size.h"
@ -288,7 +288,7 @@ class Writer : public base::RefCountedThreadSafe<Writer> {
break;
case CONTENT:
utf8_string = net::EscapeForHTML(text);
utf8_string = base::EscapeForHTML(text);
break;
default:

@ -22,6 +22,7 @@
#include "base/files/file_util.h"
#include "base/numerics/safe_conversions.h"
#include "base/posix/eintr_wrapper.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@ -69,7 +70,6 @@
#include "content/public/browser/storage_partition.h"
#include "content/public/common/url_constants.h"
#include "extensions/browser/extension_util.h"
#include "net/base/escape.h"
#include "services/device/public/mojom/mtp_manager.mojom.h"
#include "services/device/public/mojom/mtp_storage_info.mojom.h"
#include "storage/browser/file_system/external_mount_points.h"
@ -1021,7 +1021,7 @@ FileManagerPrivateInternalStartCopyFunction::Run() {
std::string destination_url_string = params->parent_url;
if (destination_url_string.back() != '/')
destination_url_string += '/';
destination_url_string += net::EscapePath(params->new_name);
destination_url_string += base::EscapePath(params->new_name);
source_url_ =
file_system_context->CrackURLInFirstPartyContext(GURL(params->url));

@ -7,6 +7,7 @@
#include <string>
#include <vector>
#include "base/strings/escape.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/ash/file_manager/app_id.h"
@ -17,7 +18,6 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/url_constants.h"
#include "net/base/escape.h"
#include "storage/browser/file_system/file_system_context.h"
#include "storage/browser/file_system/file_system_url.h"
@ -47,13 +47,13 @@ base::FilePath ExternalFileURLToVirtualPath(const GURL& url) {
if (!url.is_valid() || url.scheme() != content::kExternalFileScheme)
return base::FilePath();
return base::FilePath::FromUTF8Unsafe(
net::UnescapeBinaryURLComponent(url.path_piece()));
base::UnescapeBinaryURLComponent(url.path_piece()));
}
GURL VirtualPathToExternalFileURL(const base::FilePath& virtual_path) {
return GURL(
base::StringPrintf("%s:%s", content::kExternalFileScheme,
net::EscapePath(virtual_path.AsUTF8Unsafe()).c_str()));
return GURL(base::StringPrintf(
"%s:%s", content::kExternalFileScheme,
base::EscapePath(virtual_path.AsUTF8Unsafe()).c_str()));
}
GURL CreateExternalFileURLFromPath(Profile* profile,

@ -13,6 +13,7 @@
#include "base/check_op.h"
#include "base/command_line.h"
#include "base/notreached.h"
#include "base/strings/escape.h"
#include "base/task/task_traits.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/ash/arc/fileapi/arc_documents_provider_util.h"
@ -23,7 +24,6 @@
#include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h"
#include "chrome/common/url_constants.h"
#include "chromeos/dbus/cros_disks/cros_disks_client.h"
#include "net/base/escape.h"
#include "storage/browser/file_system/async_file_util.h"
#include "storage/browser/file_system/external_mount_points.h"
#include "storage/browser/file_system/file_stream_reader.h"
@ -197,7 +197,7 @@ void FileSystemBackend::ResolveURL(const storage::FileSystemURL& url,
base::FilePath(arc::kDocumentsProviderMountPointPath)
.AppendRelativePath(mount_path, &relative_mount_path);
root_url +=
net::EscapePath(storage::FilePathToString(relative_mount_path)) + "/";
base::EscapePath(storage::FilePathToString(relative_mount_path)) + "/";
name = authority + ":" + root_document_id;
} else {
name = id;

@ -15,6 +15,7 @@
#include "base/metrics/field_trial_param_associator.h"
#include "base/metrics/field_trial_params.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@ -66,7 +67,6 @@
#include "content/public/test/test_navigation_observer.h"
#include "content/public/test/test_utils.h"
#include "content/public/test/url_loader_interceptor.h"
#include "net/base/escape.h"
#include "net/base/features.h"
#include "net/dns/mock_host_resolver.h"
#include "net/http/http_request_headers.h"

@ -20,6 +20,7 @@
#include "base/json/json_reader.h"
#include "base/lazy_instance.h"
#include "base/memory/singleton.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@ -42,7 +43,6 @@
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_external_agent_proxy.h"
#include "content/public/browser/devtools_external_agent_proxy_delegate.h"
#include "net/base/escape.h"
#include "net/base/host_port_pair.h"
#include "net/base/net_errors.h"
@ -143,7 +143,7 @@ void DevToolsAndroidBridge::OpenRemotePage(scoped_refptr<RemoteBrowser> browser,
std::string url = gurl.spec();
RemoteBrowser::ParsedVersion parsed_version = browser->GetParsedVersion();
std::string query = net::EscapeQueryParamValue(url, false /* use_plus */);
std::string query = base::EscapeQueryParamValue(url, false /* use_plus */);
std::string request =
base::StringPrintf(kNewPageRequestWithURL, query.c_str());
SendJsonRequest(browser->GetId(), request, base::DoNothing());

@ -11,6 +11,7 @@
#include "base/json/json_reader.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@ -23,7 +24,6 @@
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_external_agent_proxy.h"
#include "content/public/browser/devtools_external_agent_proxy_delegate.h"
#include "net/base/escape.h"
using content::BrowserThread;
using content::DevToolsAgentHost;
@ -282,7 +282,7 @@ AgentHostDelegate::AgentHostDelegate(
remote_id_(value ? GetStringProperty(*value, "id") : ""),
frontend_url_(value ? GetFrontendURLFromValue(*value, browser_version)
: ""),
title_(value ? base::UTF16ToUTF8(net::UnescapeForHTML(
title_(value ? base::UTF16ToUTF8(base::UnescapeForHTML(
base::UTF8ToUTF16(GetStringProperty(*value, "title"))))
: ""),
description_(value ? GetStringProperty(*value, "description") : ""),

@ -20,6 +20,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/no_destructor.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@ -82,7 +83,6 @@
#include "extensions/common/permissions/permissions_data.h"
#include "google_apis/google_api_keys.h"
#include "ipc/ipc_channel.h"
#include "net/base/escape.h"
#include "net/base/net_errors.h"
#include "net/base/url_util.h"
#include "net/http/http_response_headers.h"
@ -299,8 +299,8 @@ std::string SanitizeRemoteBase(const std::string& value) {
}
std::string SanitizeRemoteFrontendURL(const std::string& value) {
GURL url(net::UnescapeBinaryURLComponent(
value, net::UnescapeRule::REPLACE_PLUS_WITH_SPACE));
GURL url(base::UnescapeBinaryURLComponent(
value, base::UnescapeRule::REPLACE_PLUS_WITH_SPACE));
std::string path = url.path();
std::vector<std::string> parts = base::SplitString(
path, "/", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL);
@ -313,7 +313,7 @@ std::string SanitizeRemoteFrontendURL(const std::string& value) {
revision.c_str(), filename.c_str());
std::string sanitized = SanitizeFrontendURL(url, url::kHttpsScheme,
kRemoteFrontendDomain, path, true).spec();
return net::EscapeQueryParamValue(sanitized, false);
return base::EscapeQueryParamValue(sanitized, false);
}
std::string SanitizeEnabledExperiments(const std::string& value) {

@ -16,6 +16,7 @@
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/escape.h"
#include "base/time/time.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
@ -69,7 +70,6 @@
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.h"
#include "content/public/common/url_constants.h"
#include "net/base/escape.h"
#include "third_party/blink/public/common/input/web_gesture_event.h"
#include "third_party/blink/public/common/input/web_input_event.h"
#include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h"

@ -64,8 +64,8 @@ JNI_DomDistillerTabUtils_GetFormattedUrlFromOriginalDistillerUrl(
// the space.
return base::android::ConvertUTF16ToJavaString(
env, url_formatter::FormatUrl(url, url_formatter::kFormatUrlOmitDefaults,
net::UnescapeRule::NORMAL, nullptr, nullptr,
nullptr));
base::UnescapeRule::NORMAL, nullptr,
nullptr, nullptr));
}
jint JNI_DomDistillerTabUtils_GetDistillerHeuristics(JNIEnv* env) {

@ -11,11 +11,11 @@
#include "base/files/file_util.h"
#include "base/hash/sha1.h"
#include "base/json/json_writer.h"
#include "base/strings/escape.h"
#include "base/strings/stringprintf.h"
#include "base/task/thread_pool.h"
#include "base/values.h"
#include "chrome/browser/enterprise/connectors/file_system/box_api_call_endpoints.h"
#include "net/base/escape.h"
#include "net/base/mime_util.h"
#include "net/http/http_status_code.h"
#include "net/http/http_util.h"

@ -7,6 +7,7 @@
#include <utility>
#include <vector>
#include "base/strings/escape.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/enterprise/connectors/file_system/account_info_utils.h"
#include "chrome/browser/enterprise/connectors/file_system/box_api_call_endpoints.h"
@ -21,7 +22,6 @@
#include "google_apis/gaia/google_service_auth_error.h"
#include "google_apis/gaia/oauth2_access_token_consumer.h"
#include "google_apis/gaia/oauth2_api_call_flow.h"
#include "net/base/escape.h"
#include "net/base/url_util.h"
#include "net/http/http_status_code.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
@ -282,7 +282,7 @@ std::string FileSystemSigninDialogDelegate::GetProviderSpecificUrlParameters() {
// escaped version of it.
return base::StringPrintf(
"box_login=%s%s", settings_.email_domain[0] == '@' ? "" : "%40",
net::EscapeQueryParamValue(settings_.email_domain, true).c_str());
base::EscapeQueryParamValue(settings_.email_domain, true).c_str());
}
} else {
NOTREACHED() << "Unknown service provider: " << settings_.service_provider;

@ -11,6 +11,7 @@
#include "base/callback_helpers.h"
#include "base/logging.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/system/sys_info.h"
@ -29,7 +30,6 @@
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "net/base/escape.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "url/gurl.h"
@ -179,8 +179,8 @@ void ChromeJsErrorReportProcessor::OnConsentCheckCompleted(
error_report->version.empty() ? platform.version : error_report->version;
ParameterMap params;
params["prod"] = net::EscapeQueryParamValue(product, /*use_plus=*/false);
params["ver"] = net::EscapeQueryParamValue(version, /*use_plus=*/false);
params["prod"] = base::EscapeQueryParamValue(product, /*use_plus=*/false);
params["ver"] = base::EscapeQueryParamValue(version, /*use_plus=*/false);
params["type"] = "JavascriptError";
params["error_message"] = error_report->message;
params["browser"] = "Chrome";

@ -10,6 +10,7 @@
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/system/sys_info.h"
@ -17,7 +18,6 @@
#include "base/task/thread_pool.h"
#include "chrome/common/chrome_paths.h"
#include "components/upload_list/crash_upload_list.h"
#include "net/base/escape.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/simple_url_loader.h"
@ -56,7 +56,7 @@ std::string ChromeJsErrorReportProcessor::BuildPostRequestQueryString(
for (const auto& kv : params) {
query_parts.push_back(base::StrCat(
{kv.first, "=",
net::EscapeQueryParamValue(kv.second, /*use_plus=*/false)}));
base::EscapeQueryParamValue(kv.second, /*use_plus=*/false)}));
}
return base::JoinString(query_parts, "&");
}

@ -25,13 +25,13 @@
#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/task/single_thread_task_executor.h"
#include "base/threading/thread_restrictions.h"
#include "chrome/browser/error_reporting/constants.h"
#include "net/base/escape.h"
#include "net/http/http_status_code.h"
#include "third_party/crashpad/crashpad/third_party/cpp-httplib/cpp-httplib/httplib.h"
#include "url/gurl.h"
@ -99,8 +99,8 @@ bool UploadViaHttp(const std::string& base_url,
std::vector<std::string> query_parts;
for (const auto& kv : values) {
query_parts.emplace_back(base::StrCat(
{net::EscapeQueryParamValue(kv.first, /*use_plus=*/false), "=",
net::EscapeQueryParamValue(kv.second, /*use_plus=*/false)}));
{base::EscapeQueryParamValue(kv.first, /*use_plus=*/false), "=",
base::EscapeQueryParamValue(kv.second, /*use_plus=*/false)}));
}
std::string upload_str =
base::StrCat({base_url, "?", base::JoinString(query_parts, "&")});

@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/escape.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/extensions/api/identity/identity_api.h"
#include "chrome/browser/profiles/profile.h"
@ -22,7 +23,6 @@
#include "google_apis/gaia/gaia_auth_fetcher.h"
#include "google_apis/gaia/gaia_auth_util.h"
#include "google_apis/gaia/gaia_urls.h"
#include "net/base/escape.h"
#include "net/cookies/cookie_util.h"
#include "services/network/public/mojom/cookie_manager.mojom.h"
#include "url/gurl.h"

@ -17,6 +17,7 @@
#include "base/containers/flat_set.h"
#include "base/memory/ref_counted.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/escape.h"
#include "base/strings/utf_string_conversions.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "base/time/time.h"
@ -45,7 +46,6 @@
#include "components/prefs/pref_service.h"
#include "components/url_formatter/elide_url.h"
#include "components/url_formatter/url_formatter.h"
#include "net/base/escape.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/time_format.h"
@ -599,7 +599,7 @@ PasswordCheckDelegate::ConstructInsecureCredential(
url_formatter::kFormatUrlOmitHTTPS |
url_formatter::kFormatUrlOmitTrivialSubdomains |
url_formatter::kFormatUrlTrimAfterHost,
net::UnescapeRule::SPACES, nullptr, nullptr, nullptr));
base::UnescapeRule::SPACES, nullptr, nullptr, nullptr));
api_credential.detailed_origin =
base::UTF16ToUTF8(url_formatter::FormatUrlForSecurityDisplay(
credential.url.DeprecatedGetOriginAsURL()));

@ -21,6 +21,7 @@
#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/strings/escape.h"
#include "base/strings/pattern.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
@ -100,7 +101,6 @@
#include "extensions/common/mojom/host_id.mojom.h"
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/common/user_script.h"
#include "net/base/escape.h"
#include "skia/ext/image_operations.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/abseil-cpp/absl/types/optional.h"

@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/json/json_reader.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@ -29,7 +30,6 @@
#include "extensions/test/extension_test_message_listener.h"
#include "extensions/test/result_catcher.h"
#include "extensions/test/test_extension_dir.h"
#include "net/base/escape.h"
#include "net/base/url_util.h"
#include "net/dns/mock_host_resolver.h"
#include "net/ssl/client_cert_store.h"

@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/containers/contains.h"
#include "base/strings/escape.h"
#include "base/threading/thread_task_runner_handle.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
@ -13,7 +14,6 @@
#include "components/safe_browsing/core/browser/db/v4_protocol_manager_util.h"
#include "components/safe_browsing/core/common/features.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/escape.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"

@ -14,6 +14,7 @@
#include "base/containers/contains.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/escape.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
#include "base/syslog_logging.h"
@ -40,7 +41,6 @@
#include "extensions/common/manifest_url_handlers.h"
#include "extensions/common/switches.h"
#include "net/base/backoff_entry.h"
#include "net/base/escape.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/extensions/extension_assets_manager_chromeos.h"
@ -174,7 +174,7 @@ GURL ChromeContentVerifierDelegate::GetSignatureFetchUrl(
// ManifestFetchData class that can be shared for use here.
std::string id_part = "id=" + extension_id;
std::string version_part = "v=" + version.GetString();
std::string x_value = net::EscapeQueryParamValue(
std::string x_value = base::EscapeQueryParamValue(
base::JoinString({"uc", "installsource=signature", id_part, version_part},
"&"),
true);

@ -14,6 +14,7 @@
#include "base/feature_list.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "base/strings/escape.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@ -38,7 +39,6 @@
#include "extensions/common/feature_switch.h"
#include "extensions/common/switches.h"
#include "extensions/test/result_catcher.h"
#include "net/base/escape.h"
#include "net/base/filename_util.h"
#include "net/test/embedded_test_server/default_handlers.h"
#include "net/test/embedded_test_server/embedded_test_server.h"

@ -6,6 +6,7 @@
#include <utility>
#include "base/bind.h"
#include "base/strings/escape.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
@ -26,7 +27,6 @@
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/process_map.h"
#include "extensions/common/switches.h"
#include "net/base/escape.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
@ -75,8 +75,8 @@ std::unique_ptr<net::test_server::HttpResponse> HandleExpectAndSetCookieRequest(
std::string escaped_value(
query_string.substr(value_pos.begin, value_pos.len));
std::string key = net::UnescapeBinaryURLComponent(escaped_key);
std::string value = net::UnescapeBinaryURLComponent(escaped_value);
std::string key = base::UnescapeBinaryURLComponent(escaped_key);
std::string value = base::UnescapeBinaryURLComponent(escaped_value);
if (key == "expect") {
if (request_cookies.find(value) == std::string::npos)

@ -22,6 +22,7 @@
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@ -81,7 +82,6 @@
#include "extensions/common/mojom/manifest.mojom-shared.h"
#include "extensions/common/verifier_formats.h"
#include "net/base/backoff_entry.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_request_headers.h"
#include "services/network/public/cpp/simple_url_loader.h"
@ -556,7 +556,7 @@ static std::map<std::string, ParamsMap> GetPingDataFromURL(
// We've found "x=<something>", now unescape <something> and look for
// the "id=<id>&ping=<ping_value>" parameters within.
std::string unescaped = net::UnescapeBinaryURLComponent(param.second);
std::string unescaped = base::UnescapeBinaryURLComponent(param.second);
base::StringPairs extension_params;
base::SplitStringIntoKeyValuePairs(unescaped, '=', '&', &extension_params);
std::multimap<std::string, std::string> param_map;
@ -568,7 +568,7 @@ static std::map<std::string, ParamsMap> GetPingDataFromURL(
// Pull the key=value pairs out of the ping parameter for this id and
// put into the result.
std::string ping =
net::UnescapeBinaryURLComponent(param_map.find("ping")->second);
base::UnescapeBinaryURLComponent(param_map.find("ping")->second);
base::StringPairs ping_params;
base::SplitStringIntoKeyValuePairs(ping, '=', '&', &ping_params);
for (const auto& ping_param : ping_params) {
@ -596,7 +596,7 @@ static void VerifyQueryAndExtractParameters(
}
EXPECT_EQ(1U, params.count("x"));
std::string decoded = net::UnescapeBinaryURLComponent(params["x"]);
std::string decoded = base::UnescapeBinaryURLComponent(params["x"]);
ExtractParameters(decoded, result);
}

@ -21,6 +21,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
#include "base/rand_util.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
@ -62,7 +63,6 @@
#include "extensions/common/extension_urls.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/shared_module_info.h"
#include "net/base/escape.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h"
@ -205,11 +205,11 @@ GURL WebstoreInstaller::GetWebstoreInstallURL(
params.push_back("uc");
std::string url_string = extension_urls::GetWebstoreUpdateUrl().spec();
GURL url(url_string + "?response=redirect&" +
update_client::UpdateQueryParams::Get(
update_client::UpdateQueryParams::CRX) +
"&x=" + net::EscapeQueryParamValue(base::JoinString(params, "&"),
true));
GURL url(
url_string + "?response=redirect&" +
update_client::UpdateQueryParams::Get(
update_client::UpdateQueryParams::CRX) +
"&x=" + base::EscapeQueryParamValue(base::JoinString(params, "&"), true));
DCHECK(url.is_valid());
return url;

@ -4,13 +4,13 @@
#include <string>
#include "base/strings/escape.h"
#include "base/strings/stringprintf.h"
#include "base/system/sys_info.h"
#include "chrome/browser/extensions/webstore_installer.h"
#include "chrome/browser/update_client/chrome_update_query_params_delegate.h"
#include "components/crx_file/id_util.h"
#include "components/update_client/update_query_params.h"
#include "net/base/escape.h"
#include "testing/gtest/include/gtest/gtest.h"
using base::StringPrintf;
@ -39,10 +39,9 @@ TEST(WebstoreInstallerTest, PlatformParams) {
base::SysInfo().OperatingSystemArchitecture().c_str())));
EXPECT_TRUE(Contains(
query, StringPrintf("nacl_arch=%s", UpdateQueryParams::GetNaclArch())));
EXPECT_TRUE(
Contains(query,
net::EscapeQueryParamValue(
StringPrintf("installsource=%s", source.c_str()), true)));
EXPECT_TRUE(Contains(
query, base::EscapeQueryParamValue(
StringPrintf("installsource=%s", source.c_str()), true)));
EXPECT_TRUE(Contains(
query,
StringPrintf("lang=%s", ChromeUpdateQueryParamsDelegate::GetLang())));

@ -12,6 +12,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "base/stl_util.h"
#include "base/strings/escape.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@ -26,7 +27,6 @@
#include "components/url_matcher/url_util.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/weak_document_ptr.h"
#include "net/base/escape.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
#include "third_party/blink/public/mojom/devtools/console_message.mojom.h"
#include "url/gurl.h"
@ -433,7 +433,7 @@ void ExternalProtocolHandler::LaunchUrl(
// the URL", something that probably should be done by the GURL constructor
// itself. The GURL constructor does do it in some cases (e.g., mailto) but
// not in general. https://crbug.com/788244.
std::string escaped_url_string = net::EscapeExternalHandlerValue(url.spec());
std::string escaped_url_string = base::EscapeExternalHandlerValue(url.spec());
GURL escaped_url(escaped_url_string);
content::WebContents* web_contents = web_contents_getter.Run();
@ -497,7 +497,7 @@ void ExternalProtocolHandler::LaunchUrlWithoutSecurityCheck(
// TODO(788244): This essentially amounts to "remove illegal characters from
// the URL", something that probably should be done by the GURL constructor
// itself.
std::string escaped_url_string = net::EscapeExternalHandlerValue(url.spec());
std::string escaped_url_string = base::EscapeExternalHandlerValue(url.spec());
GURL escaped_url(escaped_url_string);
LaunchUrlWithoutSecurityCheckWithDelegate(

@ -10,6 +10,7 @@
#include "base/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@ -34,7 +35,6 @@
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/prerender_test_util.h"
#include "net/base/escape.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "services/device/public/cpp/test/scoped_geolocation_overrider.h"

@ -11,12 +11,12 @@
#include "base/hash/sha1.h"
#include "base/json/json_writer.h"
#include "base/memory/ptr_util.h"
#include "base/strings/escape.h"
#include "base/strings/string_piece.h"
#include "components/cast_channel/cast_socket.h"
#include "components/cast_channel/enum_table.h"
#include "components/media_router/common/discovery/media_sink_internal.h"
#include "components/media_router/common/providers/cast/cast_media_source.h"
#include "net/base/escape.h"
namespace cast_util {
@ -152,7 +152,7 @@ base::Value CreateReceiver(const MediaSinkInternal& sink,
}
receiver.SetKey("friendlyName",
base::Value(net::EscapeForHTML(sink.sink().name())));
base::Value(base::EscapeForHTML(sink.sink().name())));
receiver.SetKey("capabilities",
CapabilitiesToListValue(sink.cast_data().capabilities));
receiver.SetKey("volume", base::Value());

@ -10,10 +10,10 @@
#include "base/hash/sha1.h"
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "components/media_router/browser/route_message_util.h"
#include "components/media_router/common/discovery/media_sink_internal.h"
#include "net/base/escape.h"
#include "url/url_util.h"
namespace media_router {
@ -307,7 +307,7 @@ base::Value DialInternalMessageUtil::CreateReceiver(
receiver.SetKey("label", base::Value(label));
receiver.SetKey("friendlyName",
base::Value(net::EscapeForHTML(sink.sink().name())));
base::Value(base::EscapeForHTML(sink.sink().name())));
receiver.SetKey("capabilities", base::ListValue());
receiver.SetKey("volume", base::Value(base::Value::Type::NONE));
receiver.SetKey("isActiveInput", base::Value(base::Value::Type::NONE));

@ -11,6 +11,7 @@
#include "base/containers/contains.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/test/scoped_feature_list.h"
@ -51,7 +52,6 @@
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/network_connection_change_simulator.h"
#include "content/public/test/simple_url_loader_test_helper.h"
#include "net/base/escape.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_request.h"
@ -284,13 +284,13 @@ class VariationsHttpHeadersBrowserTest : public InProcessBrowserTest {
GURL absolute_import = GetExampleUrlWithPath("/workers/empty.js");
const std::string worker_path = base::StrCat(
{worker, "?import=",
net::EscapeQueryParamValue(absolute_import.spec(), false)});
base::EscapeQueryParamValue(absolute_import.spec(), false)});
GURL worker_url = GetGoogleUrlWithPath(worker_path);
// Build the page URL that tells the page to create the worker.
const std::string page_path = base::StrCat(
{page,
"?worker_url=", net::EscapeQueryParamValue(worker_url.spec(), false)});
const std::string page_path =
base::StrCat({page, "?worker_url=",
base::EscapeQueryParamValue(worker_url.spec(), false)});
GURL page_url = GetGoogleUrlWithPath(page_path);
// Navigate and test.
@ -807,7 +807,7 @@ IN_PROC_BROWSER_TEST_F(VariationsHttpHeadersBrowserTest, ServiceWorkerScript) {
GURL absolute_import = GetExampleUrlWithPath("/service_worker/empty.js");
const std::string worker_path =
"/service_worker/import_scripts_worker.js?import=" +
net::EscapeQueryParamValue(absolute_import.spec(), false);
base::EscapeQueryParamValue(absolute_import.spec(), false);
RegisterServiceWorker(worker_path);
// Test that the header is present on the main script request.

@ -5,6 +5,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/path_service.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
@ -28,7 +29,6 @@
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_navigation_observer.h"
#include "net/base/escape.h"
#include "net/base/features.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
@ -951,7 +951,7 @@ IN_PROC_BROWSER_TEST_P(SamePartyIsFirstPartyCookiePolicyBrowserTest,
NavigateFrameTo(
kHostD, base::StrCat({
"/server-redirect?",
net::EscapeQueryParamValue(
base::EscapeQueryParamValue(
https_server_.GetURL(kHostA, "/echoheader?cookie").spec(),
/*use_plus=*/false),
}));
@ -975,7 +975,7 @@ IN_PROC_BROWSER_TEST_P(SamePartyIsFirstPartyCookiePolicyBrowserTest,
NavigateFrameTo(
kHostD, base::StrCat({
"/script_redirect.html?",
net::EscapeQueryParamValue(
base::EscapeQueryParamValue(
https_server_.GetURL(kHostA, "/echoheader?cookie").spec(),
/*use_plus=*/false),
}));

@ -27,6 +27,7 @@
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted_memory.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@ -51,7 +52,6 @@
#include "dbus/bus.h"
#include "dbus/message.h"
#include "dbus/object_proxy.h"
#include "net/base/escape.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "skia/ext/image_operations.h"
#include "ui/base/l10n/l10n_util.h"
@ -683,7 +683,7 @@ class NotificationPlatformBridgeLinuxImpl
if (linkify_context_if_possible) {
if (base::Contains(capabilities_, kCapabilityBodyHyperlinks)) {
body << "<a href=\""
<< net::EscapeForHTML(notification->origin_url().spec())
<< base::EscapeForHTML(notification->origin_url().spec())
<< "\">" << context_display_text << "</a>\n\n";
} else {
body << context_display_text << "\n\n";
@ -717,7 +717,7 @@ class NotificationPlatformBridgeLinuxImpl
ResizeImageToFdoMaxSize(notification->image()).As1xPNGBytes());
if (image_file) {
body << "<img src=\""
<< "file://" + net::EscapePath(image_file->file_path().value())
<< "file://" + base::EscapePath(image_file->file_path().value())
<< "\" alt=\"\"/>\n";
data->resource_files.push_back(std::move(image_file));
}

@ -7,6 +7,7 @@
#include "base/base64.h"
#include "base/feature_list.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/stringprintf.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
@ -39,7 +40,6 @@
#include "content/public/browser/navigation_handle.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "net/base/escape.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "services/metrics/public/cpp/ukm_builders.h"
@ -282,7 +282,7 @@ class OptimizationGuideKeyedServiceBrowserTest
GURL request_url = request.GetURL();
std::string dest =
net::UnescapeBinaryURLComponent(request_url.query_piece());
base::UnescapeBinaryURLComponent(request_url.query_piece());
auto http_response =
std::make_unique<net::test_server::BasicHttpResponse>();

@ -8,6 +8,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.h"
@ -44,7 +45,6 @@
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/test_navigation_observer.h"
#include "media/base/media_switches.h"
#include "net/base/escape.h"
#include "net/base/net_errors.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/controllable_http_response.h"
@ -555,7 +555,7 @@ class CreativeOriginAdsPageLoadMetricsObserverBrowserTest
query_pieces.push_back(")");
std::string out = base::StrCat(query_pieces);
if (should_escape)
out = net::EscapeQueryParamValue(out, false /* use_plus */);
out = base::EscapeQueryParamValue(out, false /* use_plus */);
return out;
}

@ -282,7 +282,7 @@ CompromisedCredentialForUI PasswordCheckManager::MakeUICredential(
url_formatter::kFormatUrlOmitHTTPS |
url_formatter::kFormatUrlOmitTrivialSubdomains |
url_formatter::kFormatUrlTrimAfterHost,
net::UnescapeRule::SPACES, nullptr, nullptr, nullptr);
base::UnescapeRule::SPACES, nullptr, nullptr, nullptr);
ui_credential.change_password_url =
password_manager::CreateChangePasswordUrl(ui_credential.url).spec();
}

@ -138,7 +138,7 @@ std::u16string CredentialEditBridge::GetDisplayURLOrAppName() {
url_formatter::kFormatUrlOmitHTTPS |
url_formatter::kFormatUrlOmitTrivialSubdomains |
url_formatter::kFormatUrlTrimAfterHost,
net::UnescapeRule::SPACES, nullptr, nullptr, nullptr);
base::UnescapeRule::SPACES, nullptr, nullptr, nullptr);
}
std::u16string CredentialEditBridge::GetDisplayFederationOrigin() {
@ -149,6 +149,6 @@ std::u16string CredentialEditBridge::GetDisplayFederationOrigin() {
url_formatter::kFormatUrlOmitHTTPS |
url_formatter::kFormatUrlOmitTrivialSubdomains |
url_formatter::kFormatUrlTrimAfterHost,
net::UnescapeRule::SPACES, nullptr, nullptr, nullptr)
base::UnescapeRule::SPACES, nullptr, nullptr, nullptr)
: std::u16string();
}

@ -6,8 +6,8 @@
#include <utility>
#include "base/strings/escape.h"
#include "base/strings/string_split.h"
#include "net/base/escape.h"
#include "url/gurl.h"
#include "url/third_party/mozilla/url_parse.h"
@ -36,9 +36,9 @@ absl::optional<GURL> RewriteHandler::HandleRewriteIfNecessary(
if (query_str.substr(key.begin, key.len) == url_rule.query_param) {
// Unescape the inner URL since it was escaped to be made a query
// param.
std::string unescaped = net::UnescapeURLComponent(
std::string unescaped = base::UnescapeURLComponent(
query_str.substr(value.begin, value.len),
net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS);
base::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS);
return GURL(unescaped);
}
}

@ -8,6 +8,7 @@
#include "base/feature_list.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/escape.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pdf_util.h"
@ -17,7 +18,6 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_user_data.h"
#include "net/base/escape.h"
#include "net/http/http_response_headers.h"
#if BUILDFLAG(ENABLE_PLUGINS)
@ -150,7 +150,7 @@ void PDFIFrameNavigationThrottle::OnPluginsLoaded(
void PDFIFrameNavigationThrottle::LoadPlaceholderHTML() {
// Prepare the params to navigate to the placeholder.
std::string html = GetPDFPlaceholderHTML(navigation_handle()->GetURL());
GURL data_url("data:text/html," + net::EscapePath(html));
GURL data_url("data:text/html," + base::EscapePath(html));
content::OpenURLParams params =
content::OpenURLParams::FromNavigationHandle(navigation_handle());
params.url = data_url;

@ -4,6 +4,7 @@
#include "base/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/escape.h"
#include "base/test/bind.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/ui/browser.h"
@ -16,7 +17,6 @@
#include "content/public/test/browser_test.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/prerender_test_util.h"
#include "net/base/escape.h"
#include "net/dns/mock_host_resolver.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "url/gurl.h"
@ -98,7 +98,7 @@ IN_PROC_BROWSER_TEST_F(PDFIFrameNavigationThrottleBrowserTest,
embedded_test_server()->GetURL("/pdf/test-bookmarks.pdf");
const std::string html = GetPDFPlaceholderHTML(kPdfUrl);
const GURL kFallbackPdfUrl("data:text/html," + net::EscapePath(html));
const GURL kFallbackPdfUrl("data:text/html," + base::EscapePath(html));
TestNavigationManager pdf_navigation(web_contents(), kFallbackPdfUrl);
// Trigger a prerender of a page containing an iframe with a pdf file.

@ -15,6 +15,7 @@
#include "base/files/file_path.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/escape.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool/thread_pool_instance.h"
@ -55,7 +56,6 @@
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/prerender_test_util.h"
#include "content/public/test/simple_url_loader_test_helper.h"
#include "net/base/escape.h"
#include "net/base/features.h"
#include "net/base/network_isolation_key.h"
#include "net/dns/mock_host_resolver.h"
@ -510,7 +510,7 @@ class LoadingPredictorBrowserTest : public InProcessBrowserTest {
GURL request_url = request.GetURL();
std::string dest =
net::UnescapeBinaryURLComponent(request_url.query_piece());
base::UnescapeBinaryURLComponent(request_url.query_piece());
auto http_response =
std::make_unique<net::test_server::BasicHttpResponse>();

@ -12,6 +12,7 @@
#include "base/memory/ref_counted.h"
#include "base/metrics/statistics_recorder.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
@ -67,7 +68,6 @@
#include "content/public/test/prerender_test_util.h"
#include "content/public/test/url_loader_interceptor.h"
#include "content/public/test/url_loader_monitor.h"
#include "net/base/escape.h"
#include "net/base/features.h"
#include "net/base/load_flags.h"
#include "net/base/request_priority.h"
@ -90,7 +90,7 @@ const char kExpectedPurposeHeaderOnPrefetch[] = "Purpose";
std::string CreateServerRedirect(const std::string& dest_url) {
const char* const kServerRedirectBase = "/server-redirect?";
return kServerRedirectBase + net::EscapeQueryParamValue(dest_url, false);
return kServerRedirectBase + base::EscapeQueryParamValue(dest_url, false);
}
// This is the public key of tools/origin_trials/eftest.key, used to validate
@ -1142,7 +1142,7 @@ IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, Prefetch301Subresource) {
// Checks a client redirect is not followed.
IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchClientRedirect) {
PrefetchFromFile(
"/client-redirect/?" + net::EscapeQueryParamValue(kPrefetchPage, false),
"/client-redirect/?" + base::EscapeQueryParamValue(kPrefetchPage, false),
FINAL_STATUS_NOSTATE_PREFETCH_FINISHED);
ASSERT_TRUE(ui_test_utils::NavigateToURL(
current_browser(), src_server()->GetURL(kPrefetchPage2)));

@ -18,6 +18,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/process/process.h"
#include "base/process/process_info.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
@ -36,7 +37,6 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/grit/chromium_strings.h"
#include "content/public/common/result_codes.h"
#include "net/base/escape.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/win/hwnd_util.h"

@ -6,12 +6,12 @@
#include "base/bind.h"
#include "base/check.h"
#include "base/strings/escape.h"
#include "chrome/browser/profile_resetter/profile_reset_report.pb.h"
#include "chrome/browser/profile_resetter/reset_report_uploader.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/storage_partition.h"
#include "google_apis/google_api_keys.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/cpp/resource_request.h"
@ -26,7 +26,7 @@ GURL GetClientReportUrl(const std::string& report_url) {
GURL url(report_url);
std::string api_key = google_apis::GetAPIKey();
if (!api_key.empty())
url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true));
url = url.Resolve("?key=" + base::EscapeQueryParamValue(api_key, true));
return url;
}

@ -15,6 +15,7 @@
#include "base/files/file_path.h"
#include "base/location.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/escape.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/single_thread_task_runner.h"
@ -46,7 +47,6 @@
#include "components/signin/public/identity_manager/identity_manager.h"
#include "content/public/browser/browser_thread.h"
#include "extensions/buildflags/buildflags.h"
#include "net/base/escape.h"
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_service.h"

@ -24,6 +24,7 @@
#include "base/metrics/user_metrics.h"
#include "base/no_destructor.h"
#include "base/observer_list.h"
#include "base/strings/escape.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/branding_buildflags.h"
@ -161,7 +162,6 @@
#include "extensions/buildflags/buildflags.h"
#include "media/base/media_switches.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "net/base/escape.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "pdf/buildflags.h"
#include "ppapi/buildflags/buildflags.h"
@ -868,18 +868,18 @@ std::u16string RenderViewContextMenu::FormatURLForClipboard(const GURL& url) {
GURL url_to_format = url;
url_formatter::FormatUrlTypes format_types;
net::UnescapeRule::Type unescape_rules;
base::UnescapeRule::Type unescape_rules;
if (url.SchemeIs(url::kMailToScheme)) {
GURL::Replacements replacements;
replacements.ClearQuery();
url_to_format = url.ReplaceComponents(replacements);
format_types = url_formatter::kFormatUrlOmitMailToScheme;
unescape_rules =
net::UnescapeRule::PATH_SEPARATORS |
net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS;
base::UnescapeRule::PATH_SEPARATORS |
base::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS;
} else {
format_types = url_formatter::kFormatUrlOmitNothing;
unescape_rules = net::UnescapeRule::NONE;
unescape_rules = base::UnescapeRule::NONE;
}
return url_formatter::FormatUrl(url_to_format, format_types, unescape_rules,

@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/escape.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/policy/chrome_browser_policy_connector.h"
#include "chrome/browser/profiles/profile_manager.h"
@ -23,7 +24,6 @@
#include "content/public/browser/global_routing_id.h"
#include "content/public/browser/web_contents.h"
#include "google_apis/google_api_keys.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_cache.h"
#include "net/http/http_status_code.h"
@ -138,7 +138,7 @@ GURL PPAPIDownloadRequest::GetDownloadRequestUrl() {
GURL url(kDownloadRequestUrl);
std::string api_key = google_apis::GetAPIKey();
if (!api_key.empty())
url = url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true));
url = url.Resolve("?key=" + base::EscapeQueryParamValue(api_key, true));
return url;
}

@ -10,10 +10,10 @@
#include "base/bind.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/escape.h"
#include "components/safe_browsing/core/common/features.h"
#include "components/safe_browsing/core/common/proto/csd.pb.h"
#include "google_apis/google_api_keys.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
@ -110,7 +110,7 @@ GURL IncidentReportUploaderImpl::GetIncidentReportUrl() {
std::string api_key(google_apis::GetAPIKey());
if (api_key.empty())
return url;
return url.Resolve("?key=" + net::EscapeQueryParamValue(api_key, true));
return url.Resolve("?key=" + base::EscapeQueryParamValue(api_key, true));
}
void IncidentReportUploaderImpl::OnURLLoaderComplete(

@ -7,6 +7,7 @@
#include "base/base64.h"
#include "base/logging.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/escape.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "chrome/app/chrome_command_ids.h"
@ -27,7 +28,6 @@
#include "components/feed/feed_feature_list.h"
#include "components/vector_icons/vector_icons.h"
#include "content/public/browser/browser_context.h"
#include "net/base/escape.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/image/image.h"
@ -133,7 +133,7 @@ void SharingHubModel::ExecuteThirdPartyAction(Profile* profile,
std::string url_found = url_it->second.spec();
size_t location_shared_url = url_found.find(kUrlReplace);
if (location_shared_url != std::string::npos) {
std::string escaped_url = net::EscapeUrlEncodedData(url, false);
std::string escaped_url = base::EscapeUrlEncodedData(url, false);
url_found.replace(location_shared_url, strlen(kUrlReplace), escaped_url);
} else {
LOG(ERROR) << "Third Party Share API did not contain URL param.";
@ -142,7 +142,7 @@ void SharingHubModel::ExecuteThirdPartyAction(Profile* profile,
size_t location_title = url_found.find(kTitleReplace);
if (location_title != std::string::npos) {
std::string escaped_title =
net::EscapeQueryParamValue(base::UTF16ToUTF8(title), false);
base::EscapeQueryParamValue(base::UTF16ToUTF8(title), false);
url_found.replace(location_title, strlen(kTitleReplace), escaped_title);
}

@ -6,6 +6,7 @@
#include "base/feature_list.h"
#include "base/no_destructor.h"
#include "base/strings/escape.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
@ -16,7 +17,6 @@
#include "content/public/browser/network_service_instance.h"
#include "content/public/browser/storage_partition.h"
#include "google_apis/google_api_keys.h"
#include "net/base/escape.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/network_service.mojom.h"
@ -115,7 +115,7 @@ GURL& SCTReportingService::GetReportURLInstance() {
GURL& SCTReportingService::GetHashdanceLookupQueryURLInstance() {
static base::NoDestructor<GURL> instance(
std::string(kHashdanceLookupQueryURL) +
net::EscapeQueryParamValue(google_apis::GetAPIKey(), /*use_plus=*/true));
base::EscapeQueryParamValue(google_apis::GetAPIKey(), /*use_plus=*/true));
return *instance;
}

@ -19,6 +19,7 @@
#include "base/memory/raw_ptr.h"
#include "base/metrics/field_trial.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/pattern.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
@ -160,7 +161,6 @@
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/sync_call_restrictions.h"
#include "net/base/escape.h"
#include "net/base/features.h"
#include "net/base/host_port_pair.h"
#include "net/base/io_buffer.h"
@ -7440,10 +7440,10 @@ IN_PROC_BROWSER_TEST_F(SSLUIMITMSoftwareEnabledTest, EnterpriseManaged) {
const std::string expected_primary_paragraph =
l10n_util::GetStringFUTF8(IDS_MITM_SOFTWARE_PRIMARY_PARAGRAPH_ENTERPRISE,
net::EscapeForHTML(kTestMITMSoftwareName16));
base::EscapeForHTML(kTestMITMSoftwareName16));
const std::string expected_explanation = l10n_util::GetStringFUTF8(
IDS_MITM_SOFTWARE_EXPLANATION_ENTERPRISE,
net::EscapeForHTML(kTestMITMSoftwareName16),
base::EscapeForHTML(kTestMITMSoftwareName16),
l10n_util::GetStringUTF16(IDS_MITM_SOFTWARE_EXPLANATION));
WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
@ -7466,7 +7466,7 @@ IN_PROC_BROWSER_TEST_F(SSLUIMITMSoftwareEnabledTest, NotEnterpriseManaged) {
// has escaped HTML characters which throw an error.
const std::string expected_explanation = l10n_util::GetStringFUTF8(
IDS_MITM_SOFTWARE_EXPLANATION_NONENTERPRISE,
net::EscapeForHTML(kTestMITMSoftwareName16),
base::EscapeForHTML(kTestMITMSoftwareName16),
l10n_util::GetStringUTF16(IDS_MITM_SOFTWARE_EXPLANATION));
WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();

@ -8,6 +8,7 @@
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/strings/escape.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "chrome/browser/profiles/profile.h"
@ -24,7 +25,6 @@
#include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/google_service_auth_error.h"
#include "google_apis/google_api_keys.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
@ -64,7 +64,7 @@ constexpr char kClassifyUrlRestricted[] = "restricted";
std::string GetClassifyURLRequestString(
kids_chrome_management::ClassifyUrlRequest* request_proto) {
std::string query =
net::EscapeQueryParamValue(request_proto->url(), true /* use_plus */);
base::EscapeQueryParamValue(request_proto->url(), true /* use_plus */);
return base::StringPrintf(kClassifyUrlDataFormat, query.c_str(),
request_proto->region_code().c_str());
}

@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/waitable_event.h"
@ -29,7 +30,6 @@
#include "components/sync/protocol/entity_specifics.pb.h"
#include "components/sync/protocol/password_specifics.pb.h"
#include "content/public/test/test_utils.h"
#include "net/base/escape.h"
#include "url/gurl.h"
using password_manager::PasswordForm;
@ -91,11 +91,11 @@ sync_pb::EntitySpecifics EncryptPasswordSpecifics(
}
std::string GetClientTag(const sync_pb::PasswordSpecificsData& password_data) {
return net::EscapePath(GURL(password_data.origin()).spec()) + "|" +
net::EscapePath(password_data.username_element()) + "|" +
net::EscapePath(password_data.username_value()) + "|" +
net::EscapePath(password_data.password_element()) + "|" +
net::EscapePath(password_data.signon_realm());
return base::EscapePath(GURL(password_data.origin()).spec()) + "|" +
base::EscapePath(password_data.username_element()) + "|" +
base::EscapePath(password_data.username_value()) + "|" +
base::EscapePath(password_data.password_element()) + "|" +
base::EscapePath(password_data.signon_realm());
}
} // namespace

@ -9,12 +9,12 @@
#include "base/files/file_util.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/escape.h"
#include "chrome/browser/sync_file_system/drive_backend/fake_drive_service_helper.h"
#include "components/drive/drive_uploader.h"
#include "components/drive/service/fake_drive_service.h"
#include "google_apis/common/api_error_codes.h"
#include "google_apis/common/test_util.h"
#include "net/base/escape.h"
namespace sync_file_system {
namespace drive_backend {

@ -417,7 +417,7 @@ SharesheetHeaderView::ExtractShareText() {
const auto format_types = url_formatter::kFormatUrlOmitDefaults &
~url_formatter::kFormatUrlOmitHTTP;
const auto formatted_text = url_formatter::FormatUrl(
extracted_text.url, format_types, net::UnescapeRule::NORMAL,
extracted_text.url, format_types, base::UnescapeRule::NORMAL,
/*new_parsed=*/nullptr,
/*prefix_end=*/nullptr, /*offset_for_adjustment=*/nullptr);
url_label->SetTooltipText(formatted_text);

@ -28,6 +28,7 @@
#include "base/debug/dump_without_crashing.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/escape.h"
#include "base/strings/pattern.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@ -103,7 +104,6 @@
#include "extensions/browser/extension_system.h"
#include "extensions/browser/management_policy.h"
#include "extensions/common/extension.h"
#include "net/base/escape.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/base/l10n/l10n_util.h"
@ -855,7 +855,7 @@ void ChromeShelfController::DoShowAppInfoFlow(Profile* profile,
// browser extension app uses '#' as a delimiter.
std::string escaped_id =
app_type == apps::AppType::kStandaloneBrowserChromeApp
? net::EscapeAllExceptUnreserved(app_id)
? base::EscapeAllExceptUnreserved(app_id)
: app_id;
chrome::ShowAppManagementPage(profile, escaped_id,
ash::settings::AppManagementEntryPoint::

@ -10,6 +10,7 @@
#include "ash/public/cpp/app_menu_constants.h"
#include "ash/public/cpp/shelf_model.h"
#include "ash/public/cpp/shelf_types.h"
#include "base/strings/escape.h"
#include "base/task/sequenced_task_runner.h"
#include "base/threading/sequenced_task_runner_handle.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
@ -24,7 +25,6 @@
#include "chrome/browser/ui/chrome_pages.h"
#include "chrome/browser/ui/webui/settings/ash/app_management/app_management_uma.h"
#include "chrome/grit/generated_resources.h"
#include "net/base/escape.h"
#include "ui/base/models/image_model.h"
#include "ui/gfx/vector_icon_types.h"
#include "ui/views/vector_icons.h"
@ -112,7 +112,7 @@ void StandaloneBrowserExtensionAppContextMenu::ExecuteCommand(int command_id,
// Normally app ids would only contain alphanumerics, but Lacros uses '#'
// as a delimiter.
std::string escaped_id = net::EscapeAllExceptUnreserved(app_id_);
std::string escaped_id = base::EscapeAllExceptUnreserved(app_id_);
chrome::ShowAppManagementPage(ProfileManager::GetPrimaryUserProfile(),
escaped_id, entry);
return;

@ -14,6 +14,7 @@
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
@ -61,7 +62,6 @@
#include "components/user_manager/user_manager.h"
#include "extensions/browser/api/vpn_provider/vpn_service.h"
#include "extensions/browser/api/vpn_provider/vpn_service_factory.h"
#include "net/base/escape.h"
#include "third_party/cros_system_api/dbus/shill/dbus-constants.h"
#include "ui/events/event_constants.h"
#include "url/gurl.h"
@ -620,11 +620,11 @@ void SystemTrayClientImpl::ShowNetworkSettingsHelper(
// kWifi*, but it's actually a generic page.
page = chromeos::settings::mojom::kWifiDetailsSubpagePath;
page += "?guid=";
page += net::EscapeUrlEncodedData(network_id, true);
page += base::EscapeUrlEncodedData(network_id, true);
page += "&name=";
page += net::EscapeUrlEncodedData(network_state->name(), true);
page += base::EscapeUrlEncodedData(network_state->name(), true);
page += "&type=";
page += net::EscapeUrlEncodedData(
page += base::EscapeUrlEncodedData(
chromeos::network_util::TranslateShillTypeToONC(network_state->type()),
true);
page += "&settingId=";

@ -143,7 +143,7 @@ std::u16string FormatBookmarkURLForDisplay(const GURL& url) {
if (url.has_username())
format_types &= ~url_formatter::kFormatUrlOmitHTTP;
return url_formatter::FormatUrl(url, format_types, net::UnescapeRule::SPACES,
return url_formatter::FormatUrl(url, format_types, base::UnescapeRule::SPACES,
nullptr, nullptr, nullptr);
}

@ -13,6 +13,7 @@
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/escape.h"
#include "base/strings/utf_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
@ -136,7 +137,6 @@
#include "content/public/common/url_utils.h"
#include "content/public/common/user_agent.h"
#include "extensions/buildflags/buildflags.h"
#include "net/base/escape.h"
#include "printing/buildflags/buildflags.h"
#include "rlz/buildflags/buildflags.h"
#include "ui/base/clipboard/clipboard_buffer.h"

@ -12,6 +12,7 @@
#include "base/feature_list.h"
#include "base/logging.h"
#include "base/metrics/user_metrics.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
@ -45,7 +46,6 @@
#include "extensions/browser/extension_prefs.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension_urls.h"
#include "net/base/escape.h"
#include "net/base/url_util.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/window_open_disposition.h"
@ -251,8 +251,8 @@ void ShowHistory(Browser* browser, const std::string& host_name) {
if (!host_name.empty()) {
GURL::Replacements replacements;
std::string query("q=");
query += net::EscapeQueryParamValue(base::StrCat({"host:", host_name}),
/*use_plus=*/false);
query += base::EscapeQueryParamValue(base::StrCat({"host:", host_name}),
/*use_plus=*/false);
replacements.SetQueryStr(query);
url = url.ReplaceComponents(replacements);
}

@ -417,7 +417,7 @@ class API_AVAILABLE(macos(10.12.2)) TouchBarNotificationBridge
std::u16string displayText = url_formatter::FormatUrl(
contents->GetLastCommittedURL(),
url_formatter::kFormatUrlOmitTrailingSlashOnBareHostname,
net::UnescapeRule::SPACES, &parsed, nullptr, nullptr);
base::UnescapeRule::SPACES, &parsed, nullptr, nullptr);
base::scoped_nsobject<NSMutableAttributedString> attributedString(
[[NSMutableAttributedString alloc]

@ -260,7 +260,7 @@ GetSearchOverriddenParams(Profile* profile) {
url_formatter::kFormatUrlTrimAfterHost |
url_formatter::kFormatUrlOmitHTTP | url_formatter::kFormatUrlOmitHTTPS;
std::u16string formatted_search_url = url_formatter::FormatUrl(
search_url, kFormatRules, net::UnescapeRule::SPACES, nullptr, nullptr,
search_url, kFormatRules, base::UnescapeRule::SPACES, nullptr, nullptr,
nullptr);
constexpr char kGenericDialogHistogramName[] =

@ -5,13 +5,13 @@
#include "chrome/browser/ui/quick_answers/quick_answers_ui_controller.h"
#include "base/bind.h"
#include "base/strings/escape.h"
#include "base/strings/stringprintf.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/ui/quick_answers/quick_answers_controller_impl.h"
#include "chromeos/components/quick_answers/quick_answers_model.h"
#include "chromeos/strings/grit/chromeos_strings.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "net/base/escape.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/base/l10n/l10n_util.h"
@ -96,7 +96,7 @@ void QuickAnswersUiController::OnQuickAnswersViewPressed() {
controller_->DismissQuickAnswers(QuickAnswersExitPoint::kQuickAnswersClick);
OpenUrl(GURL(kGoogleSearchUrlPrefix +
net::EscapeUrlEncodedData(query_, /*use_plus=*/true)));
base::EscapeUrlEncodedData(query_, /*use_plus=*/true)));
controller_->OnQuickAnswerClick();
}

@ -9,6 +9,7 @@
#include "base/memory/raw_ptr.h"
#include "base/notreached.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
@ -37,7 +38,6 @@
#include "content/public/test/test_utils.h"
#include "google_apis/gaia/core_account_id.h"
#include "google_apis/gaia/gaia_switches.h"
#include "net/base/escape.h"
#include "net/dns/mock_host_resolver.h"
#include "net/http/http_status_code.h"
#include "net/test/embedded_test_server/controllable_http_response.h"
@ -101,7 +101,7 @@ std::unique_ptr<net::test_server::HttpResponse> HandleReauthURL(
GURL request_url = request.GetURL();
std::string parameter =
net::UnescapeBinaryURLComponent(request_url.query_piece());
base::UnescapeBinaryURLComponent(request_url.query_piece());
if (parameter.empty()) {
// Parameterless request redirects to the fake challenge page.

@ -24,7 +24,7 @@ namespace {
std::u16string FormatUrlToSubdomain(const GURL& url) {
std::u16string formated_url = url_formatter::FormatUrl(
url, url_formatter::kFormatUrlOmitTrivialSubdomains,
net::UnescapeRule::SPACES, nullptr, nullptr, nullptr);
base::UnescapeRule::SPACES, nullptr, nullptr, nullptr);
return base::UTF8ToUTF16(GURL(formated_url).host());
}

@ -1621,7 +1621,7 @@ std::unique_ptr<views::View> BookmarkBarView::CreateBookmarkButton(
node->url(), node->GetTitle());
button->GetViewAccessibility().OverrideDescription(url_formatter::FormatUrl(
node->url(), url_formatter::kFormatUrlOmitDefaults,
net::UnescapeRule::SPACES, nullptr, nullptr, nullptr));
base::UnescapeRule::SPACES, nullptr, nullptr, nullptr));
} else {
button = std::make_unique<BookmarkFolderButton>(
base::BindRepeating(&BookmarkBarView::OnMenuButtonPressed,

Some files were not shown because too many files have changed in this diff Show More