Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: net/ftp/ftp_network_transaction.cc

Issue 3040016: Net: Convert username and password to string16. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: address comments Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/ftp/ftp_network_transaction.h ('k') | net/ftp/ftp_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/ftp/ftp_network_transaction.cc
===================================================================
--- net/ftp/ftp_network_transaction.cc (revision 53997)
+++ net/ftp/ftp_network_transaction.cc (working copy)
@@ -212,8 +212,8 @@
if (request_->url.has_username()) {
GetIdentityFromURL(request_->url, &username_, &password_);
} else {
- username_ = L"anonymous";
- password_ = L"chrome@example.com";
+ username_ = ASCIIToUTF16("anonymous");
+ password_ = ASCIIToUTF16("chrome@example.com");
}
DetectTypecode();
@@ -234,8 +234,8 @@
return OK;
}
-int FtpNetworkTransaction::RestartWithAuth(const std::wstring& username,
- const std::wstring& password,
+int FtpNetworkTransaction::RestartWithAuth(const string16& username,
+ const string16& password,
CompletionCallback* callback) {
ResetStateForRestart();
@@ -653,7 +653,7 @@
// Some servers (for example Pure-FTPd) apparently close the control
// connection when anonymous login is not permitted. For more details
// see http://crbug.com/25023.
- if (command_sent_ == COMMAND_USER && username_ == L"anonymous")
+ if (command_sent_ == COMMAND_USER && username_ == ASCIIToUTF16("anonymous"))
response_.needs_auth = true;
return Stop(ERR_EMPTY_RESPONSE);
}
@@ -700,7 +700,7 @@
// USER Command.
int FtpNetworkTransaction::DoCtrlWriteUSER() {
- std::string command = "USER " + WideToUTF8(username_);
+ std::string command = "USER " + UTF16ToUTF8(username_);
if (!IsValidFTPCommandString(command))
return Stop(ERR_MALFORMED_IDENTITY);
@@ -732,7 +732,7 @@
// PASS command.
int FtpNetworkTransaction::DoCtrlWritePASS() {
- std::string command = "PASS " + WideToUTF8(password_);
+ std::string command = "PASS " + UTF16ToUTF8(password_);
if (!IsValidFTPCommandString(command))
return Stop(ERR_MALFORMED_IDENTITY);
« no previous file with comments | « net/ftp/ftp_network_transaction.h ('k') | net/ftp/ftp_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698