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

Unified Diff: net/http/http_network_transaction.cc

Issue 23775010: net: Bind WeakPtr to HttpNetworkTransaction::io_callback_ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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_network_transaction.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction.cc
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index a63a2aa43b974acbc11ec1ebe599e4f6ca294399..ccfbef2e69c1e91218d2e200ff1f51d444f69bca 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -118,8 +118,6 @@ base::Value* NetLogSSLVersionFallbackCallback(
HttpNetworkTransaction::HttpNetworkTransaction(RequestPriority priority,
HttpNetworkSession* session)
: pending_auth_target_(HttpAuth::AUTH_NONE),
- io_callback_(base::Bind(&HttpNetworkTransaction::OnIOComplete,
- base::Unretained(this))),
session_(session),
request_(NULL),
priority_(priority),
@@ -128,7 +126,11 @@ HttpNetworkTransaction::HttpNetworkTransaction(RequestPriority priority,
request_headers_(),
read_buf_len_(0),
next_state_(STATE_NONE),
- establishing_tunnel_(false) {
+ establishing_tunnel_(false),
+ weak_ptr_factory_(this) {
+ io_callback_ = base::Bind(&HttpNetworkTransaction::OnIOComplete,
+ weak_ptr_factory_.GetWeakPtr());
+
session->ssl_config_service()->GetSSLConfig(&server_ssl_config_);
if (session->http_stream_factory()->has_next_protos()) {
server_ssl_config_.next_protos =
« no previous file with comments | « net/http/http_network_transaction.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698