diff options
Diffstat (limited to 'net/http')
-rw-r--r-- | net/http/http_auth_cache_unittest.cc | 2 | ||||
-rw-r--r-- | net/http/http_auth_controller_unittest.cc | 2 | ||||
-rw-r--r-- | net/http/http_auth_handler_basic.cc | 4 | ||||
-rw-r--r-- | net/http/http_auth_handler_basic_unittest.cc | 4 | ||||
-rw-r--r-- | net/http/http_auth_handler_digest.cc | 8 | ||||
-rw-r--r-- | net/http/http_auth_handler_digest_unittest.cc | 7 | ||||
-rw-r--r-- | net/http/http_auth_handler_ntlm_portable.cc | 6 | ||||
-rw-r--r-- | net/http/http_auth_handler_unittest.cc | 3 | ||||
-rw-r--r-- | net/http/http_content_disposition.cc | 4 | ||||
-rw-r--r-- | net/http/http_content_disposition_unittest.cc | 4 | ||||
-rw-r--r-- | net/http/http_network_transaction_unittest.cc | 2 | ||||
-rw-r--r-- | net/http/http_pipelined_network_transaction_unittest.cc | 3 | ||||
-rw-r--r-- | net/http/http_proxy_client_socket_pool_unittest.cc | 4 | ||||
-rw-r--r-- | net/http/url_security_manager_win.cc | 2 |
14 files changed, 31 insertions, 24 deletions
diff --git a/net/http/http_auth_cache_unittest.cc b/net/http/http_auth_cache_unittest.cc index a4ea1c6..565e1a7 100644 --- a/net/http/http_auth_cache_unittest.cc +++ b/net/http/http_auth_cache_unittest.cc @@ -13,6 +13,8 @@ #include "net/http/http_auth_handler.h" #include "testing/gtest/include/gtest/gtest.h" +using base::ASCIIToUTF16; + namespace net { namespace { diff --git a/net/http/http_auth_controller_unittest.cc b/net/http/http_auth_controller_unittest.cc index 2a18369..210f1e4 100644 --- a/net/http/http_auth_controller_unittest.cc +++ b/net/http/http_auth_controller_unittest.cc @@ -224,7 +224,7 @@ TEST(HttpAuthControllerTest, NoExplicitCredentialsAllowed) { ASSERT_EQ(OK, controller->HandleAuthChallenge(headers, false, false, dummy_log)); ASSERT_TRUE(controller->HaveAuthHandler()); - controller->ResetAuth(AuthCredentials(ASCIIToUTF16("Hello"), + controller->ResetAuth(AuthCredentials(base::ASCIIToUTF16("Hello"), base::string16())); EXPECT_TRUE(controller->HaveAuth()); EXPECT_TRUE(controller->IsAuthSchemeDisabled(HttpAuth::AUTH_SCHEME_MOCK)); diff --git a/net/http/http_auth_handler_basic.cc b/net/http/http_auth_handler_basic.cc index e445c93..daab5a7 100644 --- a/net/http/http_auth_handler_basic.cc +++ b/net/http/http_auth_handler_basic.cc @@ -91,8 +91,8 @@ int HttpAuthHandlerBasic::GenerateAuthTokenImpl( DCHECK(credentials); // TODO(eroman): is this the right encoding of username/password? std::string base64_username_password; - base::Base64Encode(UTF16ToUTF8(credentials->username()) + ":" + - UTF16ToUTF8(credentials->password()), + base::Base64Encode(base::UTF16ToUTF8(credentials->username()) + ":" + + base::UTF16ToUTF8(credentials->password()), &base64_username_password); *auth_token = "Basic " + base64_username_password; return OK; diff --git a/net/http/http_auth_handler_basic_unittest.cc b/net/http/http_auth_handler_basic_unittest.cc index 5e05b76..075afa2 100644 --- a/net/http/http_auth_handler_basic_unittest.cc +++ b/net/http/http_auth_handler_basic_unittest.cc @@ -36,8 +36,8 @@ TEST(HttpAuthHandlerBasicTest, GenerateAuthToken) { scoped_ptr<HttpAuthHandler> basic; EXPECT_EQ(OK, factory.CreateAuthHandlerFromString( challenge, HttpAuth::AUTH_SERVER, origin, BoundNetLog(), &basic)); - AuthCredentials credentials(ASCIIToUTF16(tests[i].username), - ASCIIToUTF16(tests[i].password)); + AuthCredentials credentials(base::ASCIIToUTF16(tests[i].username), + base::ASCIIToUTF16(tests[i].password)); HttpRequestInfo request_info; std::string auth_token; int rv = basic->GenerateAuthToken(&credentials, &request_info, diff --git a/net/http/http_auth_handler_digest.cc b/net/http/http_auth_handler_digest.cc index a8e301a..e0a1ef6 100644 --- a/net/http/http_auth_handler_digest.cc +++ b/net/http/http_auth_handler_digest.cc @@ -322,9 +322,9 @@ std::string HttpAuthHandlerDigest::AssembleResponseDigest( const std::string& nc) const { // ha1 = MD5(A1) // TODO(eroman): is this the right encoding? - std::string ha1 = base::MD5String(UTF16ToUTF8(credentials.username()) + ":" + - original_realm_ + ":" + - UTF16ToUTF8(credentials.password())); + std::string ha1 = base::MD5String(base::UTF16ToUTF8(credentials.username()) + + ":" + original_realm_ + ":" + + base::UTF16ToUTF8(credentials.password())); if (algorithm_ == HttpAuthHandlerDigest::ALGORITHM_MD5_SESS) ha1 = base::MD5String(ha1 + ":" + nonce_ + ":" + cnonce); @@ -352,7 +352,7 @@ std::string HttpAuthHandlerDigest::AssembleCredentials( // TODO(eroman): is this the right encoding? std::string authorization = (std::string("Digest username=") + HttpUtil::Quote( - UTF16ToUTF8(credentials.username()))); + base::UTF16ToUTF8(credentials.username()))); authorization += ", realm=" + HttpUtil::Quote(original_realm_); authorization += ", nonce=" + HttpUtil::Quote(nonce_); authorization += ", uri=" + HttpUtil::Quote(path); diff --git a/net/http/http_auth_handler_digest_unittest.cc b/net/http/http_auth_handler_digest_unittest.cc index dee44eb..aa5176e 100644 --- a/net/http/http_auth_handler_digest_unittest.cc +++ b/net/http/http_auth_handler_digest_unittest.cc @@ -67,7 +67,8 @@ bool RespondToChallenge(HttpAuth::Target target, TestCompletionCallback callback; scoped_ptr<HttpRequestInfo> request(new HttpRequestInfo()); request->url = GURL(request_url); - AuthCredentials credentials(ASCIIToUTF16("foo"), ASCIIToUTF16("bar")); + AuthCredentials credentials(base::ASCIIToUTF16("foo"), + base::ASCIIToUTF16("bar")); int rv_generate = handler->GenerateAuthToken( &credentials, request.get(), callback.callback(), token); if (rv_generate != OK) { @@ -530,8 +531,8 @@ TEST(HttpAuthHandlerDigestTest, AssembleCredentials) { digest->AssembleCredentials(tests[i].req_method, tests[i].req_path, AuthCredentials( - ASCIIToUTF16(tests[i].username), - ASCIIToUTF16(tests[i].password)), + base::ASCIIToUTF16(tests[i].username), + base::ASCIIToUTF16(tests[i].password)), tests[i].cnonce, tests[i].nonce_count); diff --git a/net/http/http_auth_handler_ntlm_portable.cc b/net/http/http_auth_handler_ntlm_portable.cc index d1fbf23..9faa85f 100644 --- a/net/http/http_auth_handler_ntlm_portable.cc +++ b/net/http/http_auth_handler_ntlm_portable.cc @@ -257,7 +257,7 @@ static void LM_Hash(const base::string16& password, uint8* hash) { // Convert password to OEM character set. We'll just use the native // filesystem charset. - std::string passbuf = base::SysWideToNativeMB(UTF16ToWide(password)); + std::string passbuf = base::SysWideToNativeMB(base::UTF16ToWide(password)); StringToUpperASCII(&passbuf); passbuf.resize(14, '\0'); @@ -487,7 +487,7 @@ static int GenerateType3Msg(const base::string16& domain, domain_len = domain.length() * 2; #endif } else { - oem_domain_buf = base::SysWideToNativeMB(UTF16ToWide(domain)); + oem_domain_buf = base::SysWideToNativeMB(base::UTF16ToWide(domain)); domain_ptr = oem_domain_buf.data(); domain_len = oem_domain_buf.length(); } @@ -507,7 +507,7 @@ static int GenerateType3Msg(const base::string16& domain, user_len = username.length() * 2; #endif } else { - oem_user_buf = base::SysWideToNativeMB(UTF16ToWide(username)); + oem_user_buf = base::SysWideToNativeMB(base::UTF16ToWide(username)); user_ptr = oem_user_buf.data(); user_len = oem_user_buf.length(); } diff --git a/net/http/http_auth_handler_unittest.cc b/net/http/http_auth_handler_unittest.cc index f8928fc..2476332 100644 --- a/net/http/http_auth_handler_unittest.cc +++ b/net/http/http_auth_handler_unittest.cc @@ -19,7 +19,8 @@ namespace net { TEST(HttpAuthHandlerTest, NetLog) { GURL origin("http://www.example.com"); std::string challenge = "Mock asdf"; - AuthCredentials credentials(ASCIIToUTF16("user"), ASCIIToUTF16("pass")); + AuthCredentials credentials(base::ASCIIToUTF16("user"), + base::ASCIIToUTF16("pass")); std::string auth_token; HttpRequestInfo request; diff --git a/net/http/http_content_disposition.cc b/net/http/http_content_disposition.cc index 3dbf234..68412cf 100644 --- a/net/http/http_content_disposition.cc +++ b/net/http/http_content_disposition.cc @@ -113,9 +113,9 @@ bool DecodeWord(const std::string& encoded_word, base::CodepageToUTF16(encoded_word, referrer_charset.c_str(), base::OnStringConversionError::FAIL, &utf16_output)) { - *output = UTF16ToUTF8(utf16_output); + *output = base::UTF16ToUTF8(utf16_output); } else { - *output = WideToUTF8(base::SysNativeMBToWide(encoded_word)); + *output = base::WideToUTF8(base::SysNativeMBToWide(encoded_word)); } } diff --git a/net/http/http_content_disposition_unittest.cc b/net/http/http_content_disposition_unittest.cc index 62d9577..43fef9d 100644 --- a/net/http/http_content_disposition_unittest.cc +++ b/net/http/http_content_disposition_unittest.cc @@ -198,7 +198,7 @@ TEST(HttpContentDispositionTest, Filename) { for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { HttpContentDisposition header(tests[i].header, tests[i].referrer_charset); EXPECT_EQ(tests[i].expected, - UTF8ToWide(header.filename())) + base::UTF8ToWide(header.filename())) << "Failed on input: " << tests[i].header; } } @@ -507,7 +507,7 @@ TEST(HttpContentDispositionTest, tc2231) { HttpContentDisposition header(tests[i].header, std::string()); EXPECT_EQ(tests[i].expected_type, header.type()) << "Failed on input: " << tests[i].header; - EXPECT_EQ(tests[i].expected_filename, UTF8ToWide(header.filename())) + EXPECT_EQ(tests[i].expected_filename, base::UTF8ToWide(header.filename())) << "Failed on input: " << tests[i].header; } } diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc index a0d622a..0f37ed2 100644 --- a/net/http/http_network_transaction_unittest.cc +++ b/net/http/http_network_transaction_unittest.cc @@ -69,6 +69,8 @@ #include "testing/platform_test.h" #include "url/gurl.h" +using base::ASCIIToUTF16; + //----------------------------------------------------------------------------- namespace { diff --git a/net/http/http_pipelined_network_transaction_unittest.cc b/net/http/http_pipelined_network_transaction_unittest.cc index 80b74fd..f5f3922 100644 --- a/net/http/http_pipelined_network_transaction_unittest.cc +++ b/net/http/http_pipelined_network_transaction_unittest.cc @@ -603,7 +603,8 @@ TEST_F(HttpPipelinedNetworkTransactionTest, BasicHttpAuthentication) { BoundNetLog())); EXPECT_EQ(OK, callback_.WaitForResult()); - AuthCredentials credentials(ASCIIToUTF16("user"), ASCIIToUTF16("pass")); + AuthCredentials credentials(base::ASCIIToUTF16("user"), + base::ASCIIToUTF16("pass")); EXPECT_EQ(OK, transaction.RestartWithAuth(credentials, callback_.callback())); ExpectResponse("one.html", transaction, SYNCHRONOUS); diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc index a70fe6a..9f3a652 100644 --- a/net/http/http_proxy_client_socket_pool_unittest.cc +++ b/net/http/http_proxy_client_socket_pool_unittest.cc @@ -100,8 +100,8 @@ class HttpProxyClientSocketPoolTest } void AddAuthToCache() { - const base::string16 kFoo(ASCIIToUTF16("foo")); - const base::string16 kBar(ASCIIToUTF16("bar")); + const base::string16 kFoo(base::ASCIIToUTF16("foo")); + const base::string16 kBar(base::ASCIIToUTF16("bar")); GURL proxy_url(GetParam().proxy_type == HTTP ? (std::string("http://") + kHttpProxyHost) : (std::string("https://") + kHttpsProxyHost)); diff --git a/net/http/url_security_manager_win.cc b/net/http/url_security_manager_win.cc index cb3c66e..4e2d938 100644 --- a/net/http/url_security_manager_win.cc +++ b/net/http/url_security_manager_win.cc @@ -53,7 +53,7 @@ bool URLSecurityManagerWin::CanUseDefaultCredentials( if (!const_cast<URLSecurityManagerWin*>(this)->EnsureSystemSecurityManager()) return false; - std::wstring url_w = ASCIIToWide(auth_origin.spec()); + std::wstring url_w = base::ASCIIToWide(auth_origin.spec()); DWORD policy = 0; HRESULT hr; hr = security_manager_->ProcessUrlAction(url_w.c_str(), |