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

Unified Diff: net/socket/ssl_client_socket_nss.cc

Issue 16207005: Fix remaining uses of WeakPtr<T>'s operator T* conversion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/quic/quic_stream_factory.cc ('k') | net/spdy/spdy_write_queue_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/ssl_client_socket_nss.cc
diff --git a/net/socket/ssl_client_socket_nss.cc b/net/socket/ssl_client_socket_nss.cc
index 141387afd100eccac8c2976c7dae66ecaee7f004..cf216880ac40aea936115d8d159df2ed8b754bf2 100644
--- a/net/socket/ssl_client_socket_nss.cc
+++ b/net/socket/ssl_client_socket_nss.cc
@@ -282,18 +282,19 @@ void DestroyCertificates(CERTCertificate** certs, size_t len) {
// Helper functions to make it possible to log events from within the
// SSLClientSocketNSS::Core.
-void AddLogEvent(BoundNetLog* net_log, NetLog::EventType event_type) {
- if (!net_log)
+void AddLogEvent(const base::WeakPtr<BoundNetLog>& net_log,
+ NetLog::EventType event_type) {
+ if (!net_log.get())
return;
net_log->AddEvent(event_type);
}
// Helper function to make it possible to log events from within the
// SSLClientSocketNSS::Core.
-void AddLogEventWithCallback(BoundNetLog* net_log,
+void AddLogEventWithCallback(const base::WeakPtr<BoundNetLog>& net_log,
NetLog::EventType event_type,
const NetLog::ParametersCallback& callback) {
- if (!net_log)
+ if (!net_log.get())
return;
net_log->AddEvent(event_type, callback);
}
@@ -308,9 +309,10 @@ void AddLogEventWithCallback(BoundNetLog* net_log,
// Instead, provide a signature that accepts an IOBuffer*, so that a reference
// to the owning IOBuffer can be bound to the Callback. This ensures that the
// IOBuffer will stay alive long enough to cross threads if needed.
-void LogByteTransferEvent(BoundNetLog* net_log, NetLog::EventType event_type,
- int len, IOBuffer* buffer) {
- if (!net_log)
+void LogByteTransferEvent(
+ const base::WeakPtr<BoundNetLog>& net_log, NetLog::EventType event_type,
+ int len, IOBuffer* buffer) {
+ if (!net_log.get())
return;
net_log->AddByteTransferEvent(event_type, len, buffer->data());
}
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/spdy/spdy_write_queue_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698