summaryrefslogtreecommitdiffstats
path: root/net/socket
diff options
context:
space:
mode:
authorkulkarni.a <kulkarni.a@samsung.com>2014-08-28 00:41:34 -0700
committerCommit bot <commit-bot@chromium.org>2014-08-28 07:42:22 +0000
commitcd7b446148ba6ef5874000c3679d6431b6d5588b (patch)
tree61bc4ee2c37e7bf31656e112bd1d9204f869cc98 /net/socket
parenta67fc9609e16eb3ce75a4a0e39f0e2622f1ba4da (diff)
downloadchromium_src-cd7b446148ba6ef5874000c3679d6431b6d5588b.zip
chromium_src-cd7b446148ba6ef5874000c3679d6431b6d5588b.tar.gz
chromium_src-cd7b446148ba6ef5874000c3679d6431b6d5588b.tar.bz2
Declaring the weak_ptr_factory in proper order.
Cleaning up weak_ptr_factory destruction order in "src/net" module. WeakPtrFactory should remain the last member so it'll be destroyed and invalidate its weak pointers before any other members are destroyed. BUG=303818 Review URL: https://codereview.chromium.org/506523002 Cr-Commit-Position: refs/heads/master@{#292344}
Diffstat (limited to 'net/socket')
-rw-r--r--net/socket/ssl_client_socket_openssl.cc4
-rw-r--r--net/socket/ssl_client_socket_openssl.h3
2 files changed, 3 insertions, 4 deletions
diff --git a/net/socket/ssl_client_socket_openssl.cc b/net/socket/ssl_client_socket_openssl.cc
index 8b5e25a..f7b9d28 100644
--- a/net/socket/ssl_client_socket_openssl.cc
+++ b/net/socket/ssl_client_socket_openssl.cc
@@ -338,7 +338,6 @@ SSLClientSocketOpenSSL::SSLClientSocketOpenSSL(
const SSLClientSocketContext& context)
: transport_send_busy_(false),
transport_recv_busy_(false),
- weak_factory_(this),
pending_read_error_(kNoPendingReadResult),
transport_read_error_(OK),
transport_write_error_(OK),
@@ -361,7 +360,8 @@ SSLClientSocketOpenSSL::SSLClientSocketOpenSSL(
handshake_succeeded_(false),
marked_session_as_good_(false),
transport_security_state_(context.transport_security_state),
- net_log_(transport_->socket()->NetLog()) {
+ net_log_(transport_->socket()->NetLog()),
+ weak_factory_(this) {
}
SSLClientSocketOpenSSL::~SSLClientSocketOpenSSL() {
diff --git a/net/socket/ssl_client_socket_openssl.h b/net/socket/ssl_client_socket_openssl.h
index 889e4b2..14ea3c8 100644
--- a/net/socket/ssl_client_socket_openssl.h
+++ b/net/socket/ssl_client_socket_openssl.h
@@ -183,8 +183,6 @@ class SSLClientSocketOpenSSL : public SSLClientSocket {
CompletionCallback user_read_callback_;
CompletionCallback user_write_callback_;
- base::WeakPtrFactory<SSLClientSocketOpenSSL> weak_factory_;
-
// Used by Read function.
scoped_refptr<IOBuffer> user_read_buf_;
int user_read_buf_len_;
@@ -290,6 +288,7 @@ class SSLClientSocketOpenSSL : public SSLClientSocket {
std::string pinning_failure_log_;
BoundNetLog net_log_;
+ base::WeakPtrFactory<SSLClientSocketOpenSSL> weak_factory_;
};
} // namespace net