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

Unified Diff: net/http/http_auth_sspi_win.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/http/http_auth_sspi_win.h ('k') | net/http/http_cache_transaction.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_auth_sspi_win.cc
===================================================================
--- net/http/http_auth_sspi_win.cc (revision 53997)
+++ net/http/http_auth_sspi_win.cc (working copy)
@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "base/singleton.h"
#include "base/string_util.h"
+#include "base/utf_string_conversions.h"
#include "net/base/net_errors.h"
#include "net/http/http_auth.h"
@@ -43,9 +44,9 @@
int AcquireExplicitCredentials(SSPILibrary* library,
const SEC_WCHAR* package,
- const std::wstring& domain,
- const std::wstring& user,
- const std::wstring& password,
+ const string16& domain,
+ const string16& user,
+ const string16& password,
CredHandle* cred) {
SEC_WINNT_AUTH_IDENTITY identity;
identity.Flags = SEC_WINNT_AUTH_IDENTITY_UNICODE;
@@ -159,8 +160,8 @@
return true;
}
-int HttpAuthSSPI::GenerateAuthToken(const std::wstring* username,
- const std::wstring* password,
+int HttpAuthSSPI::GenerateAuthToken(const string16* username,
+ const string16* password,
const std::wstring& spn,
std::string* auth_token) {
DCHECK((username == NULL) == (password == NULL));
@@ -199,14 +200,14 @@
return OK;
}
-int HttpAuthSSPI::OnFirstRound(const std::wstring* username,
- const std::wstring* password) {
+int HttpAuthSSPI::OnFirstRound(const string16* username,
+ const string16* password) {
DCHECK((username == NULL) == (password == NULL));
DCHECK(!SecIsValidHandle(&cred_));
int rv = OK;
if (username) {
- std::wstring domain;
- std::wstring user;
+ string16 domain;
+ string16 user;
SplitDomainAndUser(*username, &domain, &user);
rv = AcquireExplicitCredentials(library_, security_package_, domain,
user, *password, &cred_);
@@ -300,14 +301,14 @@
return OK;
}
-void SplitDomainAndUser(const std::wstring& combined,
- std::wstring* domain,
- std::wstring* user) {
+void SplitDomainAndUser(const string16& combined,
+ string16* domain,
+ string16* user) {
// |combined| may be in the form "user" or "DOMAIN\user".
- // Separatethe two parts if they exist.
+ // Separate the two parts if they exist.
// TODO(cbentzel): I believe user@domain is also a valid form.
size_t backslash_idx = combined.find(L'\\');
- if (backslash_idx == std::wstring::npos) {
+ if (backslash_idx == string16::npos) {
domain->clear();
*user = combined;
} else {
« no previous file with comments | « net/http/http_auth_sspi_win.h ('k') | net/http/http_cache_transaction.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698