summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-17 23:55:43 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-17 23:55:43 +0000
commitbd6fc2fb1af851ac7e2f4a3e08ad3a92ab6ba4af (patch)
treedb093d44a2b6964ae5b54b140bdef71a8b7a337d /net
parentbec9fd9900ed7fe4ed3fe5b3d9f56ec4ba1fe56b (diff)
downloadchromium_src-bd6fc2fb1af851ac7e2f4a3e08ad3a92ab6ba4af.zip
chromium_src-bd6fc2fb1af851ac7e2f4a3e08ad3a92ab6ba4af.tar.gz
chromium_src-bd6fc2fb1af851ac7e2f4a3e08ad3a92ab6ba4af.tar.bz2
Revert 257524 "Move IsStringASCII/UTF8 to base namespace."
> Move IsStringASCII/UTF8 to base namespace. > > Use StringPiece for IsStringUTF8. > > TBR=sky > > Review URL: https://codereview.chromium.org/196793010 TBR=brettw@chromium.org Review URL: https://codereview.chromium.org/198163004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/mime_util.cc2
-rw-r--r--net/base/net_util.cc2
-rw-r--r--net/base/net_util_win.cc2
-rw-r--r--net/dns/dns_config_service_win.cc4
-rw-r--r--net/ftp/ftp_network_transaction.cc4
-rw-r--r--net/http/http_content_disposition.cc8
-rw-r--r--net/proxy/proxy_resolver_v8.cc18
7 files changed, 20 insertions, 20 deletions
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc
index aa648d9..2dee17d 100644
--- a/net/base/mime_util.cc
+++ b/net/base/mime_util.cc
@@ -640,7 +640,7 @@ static const char* legal_top_level_types[] = {
bool MimeUtil::IsMimeType(const std::string& type_string) const {
// MIME types are always ASCII and case-insensitive (at least, the top-level
// and secondary types we care about).
- if (!base::IsStringASCII(type_string))
+ if (!IsStringASCII(type_string))
return false;
if (type_string == "*/*" || type_string == "*")
diff --git a/net/base/net_util.cc b/net/base/net_util.cc
index 7e3e514..0174c65 100644
--- a/net/base/net_util.cc
+++ b/net/base/net_util.cc
@@ -802,7 +802,7 @@ std::string GetFileNameFromURL(const GURL& url,
// The URL's path should be escaped UTF-8, but may not be.
std::string decoded_filename = unescaped_url_filename;
- if (!base::IsStringUTF8(decoded_filename)) {
+ if (!IsStringUTF8(decoded_filename)) {
// TODO(jshin): this is probably not robust enough. To be sure, we need
// encoding detection.
base::string16 utf16_output;
diff --git a/net/base/net_util_win.cc b/net/base/net_util_win.cc
index 0528595..f415808 100644
--- a/net/base/net_util_win.cc
+++ b/net/base/net_util_win.cc
@@ -119,7 +119,7 @@ bool FileURLToFilePath(const GURL& url, base::FilePath* file_path) {
path = UnescapeURLComponent(path,
UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS);
- if (!base::IsStringUTF8(path)) {
+ if (!IsStringUTF8(path)) {
// Not UTF-8, assume encoding is native codepage and we're done. We know we
// are giving the conversion function a nonempty string, and it may fail if
// the given string is not in the current encoding and give us an empty
diff --git a/net/dns/dns_config_service_win.cc b/net/dns/dns_config_service_win.cc
index 8d92ca6..be7e771 100644
--- a/net/dns/dns_config_service_win.cc
+++ b/net/dns/dns_config_service_win.cc
@@ -139,7 +139,7 @@ bool ParseDomainASCII(const base::string16& widestr, std::string* domain) {
return false;
// Check if already ASCII.
- if (base::IsStringASCII(widestr)) {
+ if (IsStringASCII(widestr)) {
*domain = base::UTF16ToASCII(widestr);
return true;
}
@@ -155,7 +155,7 @@ bool ParseDomainASCII(const base::string16& widestr, std::string* domain) {
// copy. Since ASCII is a subset of UTF8 the following is equivalent).
bool success = base::UTF16ToUTF8(punycode.data(), punycode.length(), domain);
DCHECK(success);
- DCHECK(base::IsStringASCII(*domain));
+ DCHECK(IsStringASCII(*domain));
return success && !domain->empty();
}
diff --git a/net/ftp/ftp_network_transaction.cc b/net/ftp/ftp_network_transaction.cc
index 7820715..3455fc6 100644
--- a/net/ftp/ftp_network_transaction.cc
+++ b/net/ftp/ftp_network_transaction.cc
@@ -152,7 +152,7 @@ bool ExtractPortFromPASVResponse(const net::FtpCtrlResponse& response,
return false;
std::string line(response.lines[0]);
- if (!base::IsStringASCII(line))
+ if (!IsStringASCII(line))
return false;
if (line.length() < 2)
return false;
@@ -830,7 +830,7 @@ int FtpNetworkTransaction::ProcessResponseSYST(
// The response should be ASCII, which allows us to do case-insensitive
// comparisons easily. If it is not ASCII, we leave the system type
// as unknown.
- if (base::IsStringASCII(line)) {
+ if (IsStringASCII(line)) {
line = StringToLowerASCII(line);
// Remove all whitespace, to correctly handle cases like fancy "V M S"
diff --git a/net/http/http_content_disposition.cc b/net/http/http_content_disposition.cc
index 035d7e9..68412cf 100644
--- a/net/http/http_content_disposition.cc
+++ b/net/http/http_content_disposition.cc
@@ -103,9 +103,9 @@ bool DecodeWord(const std::string& encoded_word,
if (encoded_word.empty())
return true;
- if (!base::IsStringASCII(encoded_word)) {
+ if (!IsStringASCII(encoded_word)) {
// Try UTF-8, referrer_charset and the native OS default charset in turn.
- if (base::IsStringUTF8(encoded_word)) {
+ if (IsStringUTF8(encoded_word)) {
*output = encoded_word;
} else {
base::string16 utf16_output;
@@ -209,7 +209,7 @@ bool DecodeWord(const std::string& encoded_word,
if (decoded_word != encoded_word)
*parse_result_flags |=
net::HttpContentDisposition::HAS_PERCENT_ENCODED_STRINGS;
- if (base::IsStringUTF8(decoded_word)) {
+ if (IsStringUTF8(decoded_word)) {
output->swap(decoded_word);
return true;
// We can try either the OS default charset or 'origin charset' here,
@@ -335,7 +335,7 @@ bool DecodeExtValue(const std::string& param_value, std::string* decoded) {
return false;
// RFC 5987 value should be ASCII-only.
- if (!base::IsStringASCII(value)) {
+ if (!IsStringASCII(value)) {
decoded->clear();
return true;
}
diff --git a/net/proxy/proxy_resolver_v8.cc b/net/proxy/proxy_resolver_v8.cc
index 118eeea..7e44f15 100644
--- a/net/proxy/proxy_resolver_v8.cc
+++ b/net/proxy/proxy_resolver_v8.cc
@@ -110,7 +110,7 @@ class V8ExternalASCIILiteral : public v8::String::ExternalAsciiStringResource {
// throughout this object's lifetime.
V8ExternalASCIILiteral(const char* ascii, size_t length)
: ascii_(ascii), length_(length) {
- DCHECK(base::IsStringASCII(ascii));
+ DCHECK(IsStringASCII(ascii));
}
virtual const char* data() const OVERRIDE {
@@ -157,7 +157,7 @@ base::string16 V8StringToUTF16(v8::Handle<v8::String> s) {
// Converts an ASCII std::string to a V8 string.
v8::Local<v8::String> ASCIIStringToV8String(v8::Isolate* isolate,
const std::string& s) {
- DCHECK(base::IsStringASCII(s));
+ DCHECK(IsStringASCII(s));
return v8::String::NewFromUtf8(isolate, s.data(), v8::String::kNormalString,
s.size());
}
@@ -180,7 +180,7 @@ v8::Local<v8::String> ScriptDataToV8String(
// Converts an ASCII string literal to a V8 string.
v8::Local<v8::String> ASCIILiteralToV8String(v8::Isolate* isolate,
const char* ascii) {
- DCHECK(base::IsStringASCII(ascii));
+ DCHECK(IsStringASCII(ascii));
size_t length = strlen(ascii);
if (length <= kMaxStringBytesForCopy)
return v8::String::NewFromUtf8(isolate, ascii, v8::String::kNormalString,
@@ -216,7 +216,7 @@ bool GetHostnameArgument(const v8::FunctionCallbackInfo<v8::Value>& args,
const base::string16 hostname_utf16 = V8StringToUTF16(args[0]->ToString());
// If the hostname is already in ASCII, simply return it as is.
- if (base::IsStringASCII(hostname_utf16)) {
+ if (IsStringASCII(hostname_utf16)) {
*hostname = base::UTF16ToASCII(hostname_utf16);
return true;
}
@@ -237,7 +237,7 @@ bool GetHostnameArgument(const v8::FunctionCallbackInfo<v8::Value>& args,
punycode_output.length(),
hostname);
DCHECK(success);
- DCHECK(base::IsStringASCII(*hostname));
+ DCHECK(IsStringASCII(*hostname));
return success;
}
@@ -398,7 +398,7 @@ class ProxyResolverV8::Context {
base::string16 ret_str = V8StringToUTF16(ret->ToString());
- if (!base::IsStringASCII(ret_str)) {
+ if (!IsStringASCII(ret_str)) {
// TODO(eroman): Rather than failing when a wide string is returned, we
// could extend the parsing to handle IDNA hostnames by
// converting them to ASCII punycode.
@@ -660,7 +660,7 @@ class ProxyResolverV8::Context {
}
std::string ip_address_list = V8StringToUTF8(args[0]->ToString());
- if (!base::IsStringASCII(ip_address_list)) {
+ if (!IsStringASCII(ip_address_list)) {
args.GetReturnValue().SetNull();
return;
}
@@ -685,12 +685,12 @@ class ProxyResolverV8::Context {
}
std::string ip_address = V8StringToUTF8(args[0]->ToString());
- if (!base::IsStringASCII(ip_address)) {
+ if (!IsStringASCII(ip_address)) {
args.GetReturnValue().Set(false);
return;
}
std::string ip_prefix = V8StringToUTF8(args[1]->ToString());
- if (!base::IsStringASCII(ip_prefix)) {
+ if (!IsStringASCII(ip_prefix)) {
args.GetReturnValue().Set(false);
return;
}