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

Unified Diff: net/url_request/url_request_http_job.cc

Issue 8743019: base::Bind: Convert net::NetworkDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes. Created 9 years, 1 month 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/url_request/url_request_http_job.h ('k') | net/url_request/url_request_test_util.h » ('j') | 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 b5ef12da9d335fc7a1e4a1e4269ef781f71621ca..335d5ed9917d343692baedf3fafb22bbcec7353e 100644
--- a/net/url_request/url_request_http_job.cc
+++ b/net/url_request/url_request_http_job.cc
@@ -6,6 +6,7 @@
#include "base/base_switches.h"
#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/build_time.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
@@ -209,7 +210,8 @@ URLRequestHttpJob::URLRequestHttpJob(URLRequest* request)
ALLOW_THIS_IN_INITIALIZER_LIST(read_callback_(
this, &URLRequestHttpJob::OnReadCompleted)),
ALLOW_THIS_IN_INITIALIZER_LIST(notify_before_headers_sent_callback_(
- this, &URLRequestHttpJob::NotifyBeforeSendHeadersCallback)),
+ base::Bind(&URLRequestHttpJob::NotifyBeforeSendHeadersCallback,
+ base::Unretained(this)))),
read_in_progress_(false),
transaction_(NULL),
throttling_entry_(URLRequestThrottlerManager::GetInstance()->
@@ -228,9 +230,9 @@ URLRequestHttpJob::URLRequestHttpJob(URLRequest* request)
filter_context_(new HttpFilterContext(this))),
ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)),
weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- on_headers_received_callback_(
- this, &URLRequestHttpJob::OnHeadersReceivedCallback)),
+ ALLOW_THIS_IN_INITIALIZER_LIST(on_headers_received_callback_(
+ base::Bind(&URLRequestHttpJob::OnHeadersReceivedCallback,
+ base::Unretained(this)))),
awaiting_callback_(false) {
ResetTimer();
}
@@ -305,7 +307,7 @@ void URLRequestHttpJob::DestroyTransaction() {
void URLRequestHttpJob::StartTransaction() {
if (request_->context() && request_->context()->network_delegate()) {
int rv = request_->context()->network_delegate()->NotifyBeforeSendHeaders(
- request_, &notify_before_headers_sent_callback_,
+ request_, notify_before_headers_sent_callback_,
&request_info_.extra_headers);
// If an extension blocks the request, we rely on the callback to
// StartTransactionInternal().
@@ -714,7 +716,7 @@ void URLRequestHttpJob::OnStartCompleted(int result) {
// |on_headers_received_callback_| or
// |NetworkDelegate::URLRequestDestroyed()| has been called.
int error = request_->context()->network_delegate()->
- NotifyHeadersReceived(request_, &on_headers_received_callback_,
+ NotifyHeadersReceived(request_, on_headers_received_callback_,
headers, &override_response_headers_);
if (error != net::OK) {
if (error == net::ERR_IO_PENDING) {
« no previous file with comments | « net/url_request/url_request_http_job.h ('k') | net/url_request/url_request_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698