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

Unified Diff: net/http/http_auth_handler_negotiate.cc

Issue 8990001: base::Bind: Convert most of net/http. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clang. Created 9 years 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
Index: net/http/http_auth_handler_negotiate.cc
diff --git a/net/http/http_auth_handler_negotiate.cc b/net/http/http_auth_handler_negotiate.cc
index 814cecd52a62c292e7f44b3b1b37cd9bd5c85005..cfab7419b55f088e0d7044a112920c348e706ef8 100644
--- a/net/http/http_auth_handler_negotiate.cc
+++ b/net/http/http_auth_handler_negotiate.cc
@@ -106,7 +106,6 @@ HttpAuthHandlerNegotiate::HttpAuthHandlerNegotiate(
resolver_(resolver),
already_called_(false),
has_credentials_(false),
- user_callback_(NULL),
auth_token_(NULL),
next_state_(STATE_NONE),
url_security_manager_(url_security_manager) {
@@ -212,11 +211,9 @@ bool HttpAuthHandlerNegotiate::Init(HttpAuth::ChallengeTokenizer* challenge) {
}
int HttpAuthHandlerNegotiate::GenerateAuthTokenImpl(
- const AuthCredentials* credentials,
- const HttpRequestInfo* request,
- OldCompletionCallback* callback,
- std::string* auth_token) {
- DCHECK(user_callback_ == NULL);
+ const AuthCredentials* credentials, const HttpRequestInfo* request,
+ const CompletionCallback& callback, std::string* auth_token) {
+ DCHECK(callback_.is_null());
DCHECK(auth_token_ == NULL);
auth_token_ = auth_token;
if (already_called_) {
@@ -233,7 +230,7 @@ int HttpAuthHandlerNegotiate::GenerateAuthTokenImpl(
}
int rv = DoLoop(OK);
if (rv == ERR_IO_PENDING)
- user_callback_ = callback;
+ callback_ = callback;
return rv;
}
@@ -245,10 +242,10 @@ void HttpAuthHandlerNegotiate::OnIOComplete(int result) {
void HttpAuthHandlerNegotiate::DoCallback(int rv) {
DCHECK(rv != ERR_IO_PENDING);
- DCHECK(user_callback_);
- OldCompletionCallback* callback = user_callback_;
- user_callback_ = NULL;
- callback->Run(rv);
+ DCHECK(!callback_.is_null());
+ CompletionCallback callback = callback_;
+ callback_.Reset();
+ callback.Run(rv);
}
int HttpAuthHandlerNegotiate::DoLoop(int result) {

Powered by Google App Engine
This is Rietveld 408576698