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

Side by Side Diff: net/socket/client_socket_factory.cc

Issue 15829004: Update net/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: license twerk Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/socket/client_socket_factory.h" 5 #include "net/socket/client_socket_factory.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/thread_task_runner_handle.h" 8 #include "base/thread_task_runner_handle.h"
9 #include "base/threading/sequenced_worker_pool.h" 9 #include "base/threading/sequenced_worker_pool.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // false or if the dedicated NSS thread failed to start. If so, cause NSS 91 // false or if the dedicated NSS thread failed to start. If so, cause NSS
92 // functions to execute on the current task runner. 92 // functions to execute on the current task runner.
93 // 93 //
94 // Note: The current task runner is obtained on each call due to unit 94 // Note: The current task runner is obtained on each call due to unit
95 // tests, which may create and tear down the current thread's TaskRunner 95 // tests, which may create and tear down the current thread's TaskRunner
96 // between each test. Because the DefaultClientSocketFactory is leaky, it 96 // between each test. Because the DefaultClientSocketFactory is leaky, it
97 // may span multiple tests, and thus the current task runner may change 97 // may span multiple tests, and thus the current task runner may change
98 // from call to call. 98 // from call to call.
99 scoped_refptr<base::SequencedTaskRunner> nss_task_runner( 99 scoped_refptr<base::SequencedTaskRunner> nss_task_runner(
100 nss_thread_task_runner_); 100 nss_thread_task_runner_);
101 if (!nss_task_runner) 101 if (!nss_task_runner.get())
102 nss_task_runner = base::ThreadTaskRunnerHandle::Get(); 102 nss_task_runner = base::ThreadTaskRunnerHandle::Get();
103 103
104 #if defined(USE_OPENSSL) 104 #if defined(USE_OPENSSL)
105 return new SSLClientSocketOpenSSL(transport_socket, host_and_port, 105 return new SSLClientSocketOpenSSL(transport_socket, host_and_port,
106 ssl_config, context); 106 ssl_config, context);
107 #elif defined(USE_NSS) || defined(OS_MACOSX) || defined(OS_WIN) 107 #elif defined(USE_NSS) || defined(OS_MACOSX) || defined(OS_WIN)
108 return new SSLClientSocketNSS(nss_task_runner, transport_socket, 108 return new SSLClientSocketNSS(nss_task_runner.get(),
109 host_and_port, ssl_config, context); 109 transport_socket,
110 host_and_port,
111 ssl_config,
112 context);
110 #else 113 #else
111 NOTIMPLEMENTED(); 114 NOTIMPLEMENTED();
112 return NULL; 115 return NULL;
113 #endif 116 #endif
114 } 117 }
115 118
116 virtual void ClearSSLSessionCache() OVERRIDE { 119 virtual void ClearSSLSessionCache() OVERRIDE {
117 SSLClientSocket::ClearSessionCache(); 120 SSLClientSocket::ClearSessionCache();
118 } 121 }
119 122
(...skipping 18 matching lines...) Expand all
138 return CreateSSLClientSocket(socket_handle, host_and_port, ssl_config, 141 return CreateSSLClientSocket(socket_handle, host_and_port, ssl_config,
139 context); 142 context);
140 } 143 }
141 144
142 // static 145 // static
143 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() { 146 ClientSocketFactory* ClientSocketFactory::GetDefaultFactory() {
144 return g_default_client_socket_factory.Pointer(); 147 return g_default_client_socket_factory.Pointer();
145 } 148 }
146 149
147 } // namespace net 150 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/buffered_write_stream_socket.cc ('k') | net/socket/client_socket_pool_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698