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

Unified Diff: net/url_request/url_request_http_job.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
« net/socket/socket_test_util.cc ('K') | « net/url_request/url_request_http_job.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_http_job.cc
diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
index bf3df81f5661faed77169b2326f729d6f511edc8..19ed7cf7adcd8874036153adafb23c1767e34843 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -200,9 +200,8 @@ URLRequestHttpJob::URLRequestHttpJob(URLRequest* request)
proxy_auth_state_(AUTH_STATE_DONT_NEED_AUTH),
server_auth_state_(AUTH_STATE_DONT_NEED_AUTH),
ALLOW_THIS_IN_INITIALIZER_LIST(start_callback_(
- this, &URLRequestHttpJob::OnStartCompleted)),
- ALLOW_THIS_IN_INITIALIZER_LIST(read_callback_(
- this, &URLRequestHttpJob::OnReadCompleted)),
+ base::Bind(&URLRequestHttpJob::OnStartCompleted,
+ base::Unretained(this)))),
ALLOW_THIS_IN_INITIALIZER_LIST(notify_before_headers_sent_callback_(
base::Bind(&URLRequestHttpJob::NotifyBeforeSendHeadersCallback,
base::Unretained(this)))),
@@ -339,7 +338,7 @@ void URLRequestHttpJob::StartTransactionInternal() {
}
if (transaction_.get()) {
- rv = transaction_->RestartWithAuth(auth_credentials_, &start_callback_);
+ rv = transaction_->RestartWithAuth(auth_credentials_, start_callback_);
auth_credentials_ = AuthCredentials();
} else {
DCHECK(request_->context());
@@ -351,7 +350,7 @@ void URLRequestHttpJob::StartTransactionInternal() {
if (!URLRequestThrottlerManager::GetInstance()->enforce_throttling() ||
!throttling_entry_->ShouldRejectRequest(request_info_.load_flags)) {
rv = transaction_->Start(
- &request_info_, &start_callback_, request_->net_log());
+ &request_info_, start_callback_, request_->net_log());
start_time_ = base::TimeTicks::Now();
} else {
// Special error code for the exponential back-off module.
@@ -1026,7 +1025,7 @@ void URLRequestHttpJob::ContinueWithCertificate(
// be notifying our consumer asynchronously via OnStartCompleted.
SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0));
- int rv = transaction_->RestartWithCertificate(client_cert, &start_callback_);
+ int rv = transaction_->RestartWithCertificate(client_cert, start_callback_);
if (rv == ERR_IO_PENDING)
return;
@@ -1051,7 +1050,7 @@ void URLRequestHttpJob::ContinueDespiteLastError() {
// be notifying our consumer asynchronously via OnStartCompleted.
SetStatus(URLRequestStatus(URLRequestStatus::IO_PENDING, 0));
- int rv = transaction_->RestartIgnoringLastError(&start_callback_);
+ int rv = transaction_->RestartIgnoringLastError(start_callback_);
if (rv == ERR_IO_PENDING)
return;
@@ -1091,7 +1090,9 @@ bool URLRequestHttpJob::ReadRawData(IOBuffer* buf, int buf_size,
DCHECK(bytes_read);
DCHECK(!read_in_progress_);
- int rv = transaction_->Read(buf, buf_size, &read_callback_);
+ int rv = transaction_->Read(
+ buf, buf_size,
+ base::Bind(&URLRequestHttpJob::OnReadCompleted, base::Unretained(this)));
if (ShouldFixMismatchedContentLength(rv))
rv = 0;
« net/socket/socket_test_util.cc ('K') | « net/url_request/url_request_http_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698