diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-13 01:54:21 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-13 01:54:21 +0000 |
commit | ae63d1a45ebb5d064b76aeb5d95bb4a8c8209926 (patch) | |
tree | 44c3bcb1970905cbcb133a9ecd297040a5659a9f /jingle | |
parent | 19d32832344b6b452f24849d80475163337ed45e (diff) | |
download | chromium_src-ae63d1a45ebb5d064b76aeb5d95bb4a8c8209926.zip chromium_src-ae63d1a45ebb5d064b76aeb5d95bb4a8c8209926.tar.gz chromium_src-ae63d1a45ebb5d064b76aeb5d95bb4a8c8209926.tar.bz2 |
Pass net_log parameter properly for ProxyResolvingClientSocket
Also initialize a few more fields in the session_params object.
Remove unused net_log params.
BUG=82365
TEST=Turn on sync, look in chrome://sync-internals for entries for talk.google.com
Review URL: http://codereview.chromium.org/7014009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85235 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'jingle')
10 files changed, 23 insertions, 37 deletions
diff --git a/jingle/notifier/base/chrome_async_socket.cc b/jingle/notifier/base/chrome_async_socket.cc index c6d729f..27f13a5 100644 --- a/jingle/notifier/base/chrome_async_socket.cc +++ b/jingle/notifier/base/chrome_async_socket.cc @@ -30,8 +30,7 @@ namespace notifier { ChromeAsyncSocket::ChromeAsyncSocket( ResolvingClientSocketFactory* client_socket_factory, size_t read_buf_size, - size_t write_buf_size, - net::NetLog* net_log) + size_t write_buf_size) : connect_callback_(ALLOW_THIS_IN_INITIALIZER_LIST(this), &ChromeAsyncSocket::ProcessConnectDone), read_callback_(ALLOW_THIS_IN_INITIALIZER_LIST(this), @@ -41,8 +40,6 @@ ChromeAsyncSocket::ChromeAsyncSocket( ssl_connect_callback_(ALLOW_THIS_IN_INITIALIZER_LIST(this), &ChromeAsyncSocket::ProcessSSLConnectDone), client_socket_factory_(client_socket_factory), - bound_net_log_( - net::BoundNetLog::Make(net_log, net::NetLog::SOURCE_SOCKET)), state_(STATE_CLOSED), error_(ERROR_NONE), net_error_(net::OK), @@ -122,7 +119,7 @@ bool ChromeAsyncSocket::Connect(const talk_base::SocketAddress& address) { transport_socket_.reset( client_socket_factory_->CreateTransportClientSocket( - dest_host_port_pair, bound_net_log_.net_log())); + dest_host_port_pair)); int status = transport_socket_->Connect(&connect_callback_); if (status != net::ERR_IO_PENDING) { // We defer execution of ProcessConnectDone instead of calling it diff --git a/jingle/notifier/base/chrome_async_socket.h b/jingle/notifier/base/chrome_async_socket.h index a8a97f5..5cf1ca6 100644 --- a/jingle/notifier/base/chrome_async_socket.h +++ b/jingle/notifier/base/chrome_async_socket.h @@ -20,7 +20,6 @@ #include "base/task.h" #include "net/base/completion_callback.h" #include "net/base/net_errors.h" -#include "net/base/net_log.h" #include "talk/xmpp/asyncsocket.h" namespace net { @@ -34,12 +33,10 @@ class ResolvingClientSocketFactory; class ChromeAsyncSocket : public buzz::AsyncSocket { public: - // Takes ownership of |client_socket_factory| but not |net_log|. - // |net_log| may be NULL. + // Takes ownership of |client_socket_factory|. ChromeAsyncSocket(ResolvingClientSocketFactory* client_socket_factory, size_t read_buf_size, - size_t write_buf_size, - net::NetLog* net_log); + size_t write_buf_size); // Does not raise any signals. virtual ~ChromeAsyncSocket(); @@ -185,7 +182,6 @@ class ChromeAsyncSocket : public buzz::AsyncSocket { net::CompletionCallbackImpl<ChromeAsyncSocket> ssl_connect_callback_; scoped_ptr<ResolvingClientSocketFactory> client_socket_factory_; - net::BoundNetLog bound_net_log_; // buzz::AsyncSocket state. buzz::AsyncSocket::State state_; diff --git a/jingle/notifier/base/chrome_async_socket_unittest.cc b/jingle/notifier/base/chrome_async_socket_unittest.cc index 53a2028..6e4199d 100644 --- a/jingle/notifier/base/chrome_async_socket_unittest.cc +++ b/jingle/notifier/base/chrome_async_socket_unittest.cc @@ -18,10 +18,8 @@ #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "jingle/notifier/base/resolving_client_socket_factory.h" -#include "net/base/capturing_net_log.h" #include "net/base/cert_verifier.h" #include "net/base/net_errors.h" -#include "net/base/net_log.h" #include "net/base/ssl_config_service.h" #include "net/socket/socket_test_util.h" #include "net/url_request/url_request_context_getter.h" @@ -131,9 +129,9 @@ class MockXmppClientSocketFactory : public ResolvingClientSocketFactory { // ResolvingClientSocketFactory implementation. virtual net::StreamSocket* CreateTransportClientSocket( - const net::HostPortPair& host_and_port, net::NetLog* net_log) { + const net::HostPortPair& host_and_port) { return mock_client_socket_factory_->CreateTransportClientSocket( - address_list_, net_log, net::NetLog::Source()); + address_list_, NULL, net::NetLog::Source()); } virtual net::SSLClientSocket* CreateSSLClientSocket( @@ -157,7 +155,6 @@ class ChromeAsyncSocketTest protected: ChromeAsyncSocketTest() : ssl_socket_data_provider_(true, net::OK), - capturing_net_log_(net::CapturingNetLog::kUnbounded), addr_(0xaabbccdd, 35) {} virtual ~ChromeAsyncSocketTest() {} @@ -176,8 +173,7 @@ class ChromeAsyncSocketTest SocketAddressToAddressList(addr_))); chrome_async_socket_.reset( new ChromeAsyncSocket(mock_xmpp_client_socket_factory.release(), - 14, 20, - &capturing_net_log_)), + 14, 20)), chrome_async_socket_->SignalConnected.connect( this, &ChromeAsyncSocketTest::OnConnect); @@ -431,7 +427,6 @@ class ChromeAsyncSocketTest AsyncSocketDataProvider async_socket_data_provider_; net::SSLSocketDataProvider ssl_socket_data_provider_; - net::CapturingNetLog capturing_net_log_; scoped_ptr<ChromeAsyncSocket> chrome_async_socket_; std::deque<SignalSocketState> signal_socket_states_; const talk_base::SocketAddress addr_; diff --git a/jingle/notifier/base/proxy_resolving_client_socket.cc b/jingle/notifier/base/proxy_resolving_client_socket.cc index bdf3766..e34ca1c 100644 --- a/jingle/notifier/base/proxy_resolving_client_socket.cc +++ b/jingle/notifier/base/proxy_resolving_client_socket.cc @@ -21,8 +21,7 @@ namespace notifier { ProxyResolvingClientSocket::ProxyResolvingClientSocket( const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, const net::SSLConfig& ssl_config, - const net::HostPortPair& dest_host_port_pair, - net::NetLog* net_log) + const net::HostPortPair& dest_host_port_pair) : proxy_resolve_callback_(ALLOW_THIS_IN_INITIALIZER_LIST(this), &ProxyResolvingClientSocket::ProcessProxyResolveDone), connect_callback_(ALLOW_THIS_IN_INITIALIZER_LIST(this), @@ -32,7 +31,9 @@ ProxyResolvingClientSocket::ProxyResolvingClientSocket( dest_host_port_pair_(dest_host_port_pair), tried_direct_connect_fallback_(false), bound_net_log_( - net::BoundNetLog::Make(net_log, net::NetLog::SOURCE_SOCKET)), + net::BoundNetLog::Make( + request_context_getter->GetURLRequestContext()->net_log(), + net::NetLog::SOURCE_SOCKET)), scoped_runnable_method_factory_( ALLOW_THIS_IN_INITIALIZER_LIST(this)), user_connect_callback_(NULL) { @@ -41,13 +42,18 @@ ProxyResolvingClientSocket::ProxyResolvingClientSocket( request_context_getter->GetURLRequestContext(); DCHECK(request_context); net::HttpNetworkSession::Params session_params; + session_params.client_socket_factory = NULL; session_params.host_resolver = request_context->host_resolver(); session_params.cert_verifier = request_context->cert_verifier(); session_params.dnsrr_resolver = request_context->dnsrr_resolver(); + session_params.dns_cert_checker = request_context->dns_cert_checker(); session_params.proxy_service = request_context->proxy_service(); + session_params.ssl_host_info_factory = NULL; session_params.ssl_config_service = request_context->ssl_config_service(); session_params.http_auth_handler_factory = request_context->http_auth_handler_factory(); + session_params.network_delegate = request_context->network_delegate(); + session_params.net_log = request_context->net_log(); network_session_ = new net::HttpNetworkSession(session_params); } diff --git a/jingle/notifier/base/proxy_resolving_client_socket.h b/jingle/notifier/base/proxy_resolving_client_socket.h index f2e10e5..8e95f87 100644 --- a/jingle/notifier/base/proxy_resolving_client_socket.h +++ b/jingle/notifier/base/proxy_resolving_client_socket.h @@ -35,8 +35,7 @@ class ProxyResolvingClientSocket : public net::StreamSocket { const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, const net::SSLConfig& ssl_config, - const net::HostPortPair& dest_host_port_pair, - net::NetLog* net_log); + const net::HostPortPair& dest_host_port_pair); virtual ~ProxyResolvingClientSocket(); // net::StreamSocket implementation. diff --git a/jingle/notifier/base/proxy_resolving_client_socket_unittest.cc b/jingle/notifier/base/proxy_resolving_client_socket_unittest.cc index 22babba..c7dc618 100644 --- a/jingle/notifier/base/proxy_resolving_client_socket_unittest.cc +++ b/jingle/notifier/base/proxy_resolving_client_socket_unittest.cc @@ -6,7 +6,6 @@ #include "base/basictypes.h" #include "base/message_loop.h" -#include "net/base/capturing_net_log.h" #include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_test_util.h" #include "testing/gmock/include/gmock/gmock.h" @@ -44,7 +43,6 @@ class ProxyResolvingClientSocketTest : public testing::Test { protected: ProxyResolvingClientSocketTest() : url_request_context_getter_(new TestURLRequestContextGetter()), - capturing_net_log_(net::CapturingNetLog::kUnbounded), connect_callback_(ALLOW_THIS_IN_INITIALIZER_LIST(this), &ProxyResolvingClientSocketTest::NetCallback) { } @@ -61,7 +59,6 @@ class ProxyResolvingClientSocketTest : public testing::Test { // Needed by XmppConnection. MessageLoopForIO message_loop_; scoped_refptr<TestURLRequestContextGetter> url_request_context_getter_; - net::CapturingNetLog capturing_net_log_; net::CompletionCallbackImpl<ProxyResolvingClientSocketTest> connect_callback_; }; @@ -71,8 +68,7 @@ TEST_F(ProxyResolvingClientSocketTest, DISABLED_ConnectError) { ProxyResolvingClientSocket proxy_resolving_socket( url_request_context_getter_, net::SSLConfig(), - dest, - &capturing_net_log_); + dest); // ProxyResolvingClientSocket::Connect() will always return an error of // ERR_ADDRESS_INVALID for a 0 IP address. EXPECT_CALL(*this, NetCallback(net::ERR_ADDRESS_INVALID)).Times(1); diff --git a/jingle/notifier/base/resolving_client_socket_factory.h b/jingle/notifier/base/resolving_client_socket_factory.h index af05ac5..427c6f0 100644 --- a/jingle/notifier/base/resolving_client_socket_factory.h +++ b/jingle/notifier/base/resolving_client_socket_factory.h @@ -25,7 +25,7 @@ class ResolvingClientSocketFactory { virtual ~ResolvingClientSocketFactory() { } // Method to create a transport socket using a HostPortPair. virtual net::StreamSocket* CreateTransportClientSocket( - const net::HostPortPair& host_and_port, net::NetLog* net_log) = 0; + const net::HostPortPair& host_and_port) = 0; virtual net::SSLClientSocket* CreateSSLClientSocket( net::ClientSocketHandle* transport_socket, diff --git a/jingle/notifier/base/xmpp_client_socket_factory.cc b/jingle/notifier/base/xmpp_client_socket_factory.cc index d3704f1..0a0bb52 100644 --- a/jingle/notifier/base/xmpp_client_socket_factory.cc +++ b/jingle/notifier/base/xmpp_client_socket_factory.cc @@ -28,12 +28,11 @@ XmppClientSocketFactory::XmppClientSocketFactory( XmppClientSocketFactory::~XmppClientSocketFactory() {} net::StreamSocket* XmppClientSocketFactory::CreateTransportClientSocket( - const net::HostPortPair& host_and_port, net::NetLog* net_log) { + const net::HostPortPair& host_and_port) { net::StreamSocket* transport_socket = new ProxyResolvingClientSocket( request_context_getter_, ssl_config_, - host_and_port, - net_log); + host_and_port); return (use_fake_ssl_client_socket_ ? new FakeSSLClientSocket(transport_socket) : transport_socket); } diff --git a/jingle/notifier/base/xmpp_client_socket_factory.h b/jingle/notifier/base/xmpp_client_socket_factory.h index f09d640..bb9ae52 100644 --- a/jingle/notifier/base/xmpp_client_socket_factory.h +++ b/jingle/notifier/base/xmpp_client_socket_factory.h @@ -37,7 +37,7 @@ class XmppClientSocketFactory : public ResolvingClientSocketFactory { // ResolvingClientSocketFactory implementation. virtual net::StreamSocket* CreateTransportClientSocket( - const net::HostPortPair& host_and_port, net::NetLog* net_log); + const net::HostPortPair& host_and_port); virtual net::SSLClientSocket* CreateSSLClientSocket( net::ClientSocketHandle* transport_socket, diff --git a/jingle/notifier/base/xmpp_connection.cc b/jingle/notifier/base/xmpp_connection.cc index a347d89..86138dd 100644 --- a/jingle/notifier/base/xmpp_connection.cc +++ b/jingle/notifier/base/xmpp_connection.cc @@ -32,8 +32,6 @@ buzz::AsyncSocket* CreateSocket( // XmppSocketAdapter. const size_t kReadBufSize = 64U * 1024U; const size_t kWriteBufSize = 64U * 1024U; - net::NetLog* const net_log = - request_context_getter->GetURLRequestContext()->net_log(); XmppClientSocketFactory* const client_socket_factory = new XmppClientSocketFactory( net::ClientSocketFactory::GetDefaultFactory(), @@ -41,7 +39,7 @@ buzz::AsyncSocket* CreateSocket( request_context_getter, use_fake_ssl_client_socket); return new ChromeAsyncSocket(client_socket_factory, - kReadBufSize, kWriteBufSize, net_log); + kReadBufSize, kWriteBufSize); } } // namespace |