Chromium Code Reviews| Index: jingle/notifier/base/xmpp_connection.cc |
| =================================================================== |
| --- jingle/notifier/base/xmpp_connection.cc (revision 81535) |
| +++ jingle/notifier/base/xmpp_connection.cc (working copy) |
| @@ -1,4 +1,4 @@ |
| -// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| @@ -13,6 +13,7 @@ |
| #include "jingle/notifier/base/weak_xmpp_client.h" |
| #include "jingle/notifier/base/xmpp_client_socket_factory.h" |
| #include "net/base/ssl_config_service.h" |
| +#include "net/socket/client_socket_factory.h" |
| #include "talk/xmpp/xmppclientsettings.h" |
| namespace notifier { |
| @@ -21,13 +22,9 @@ |
| buzz::AsyncSocket* CreateSocket( |
| const buzz::XmppClientSettings& xmpp_client_settings, |
| - net::CertVerifier* cert_verifier) { |
| + const scoped_refptr<net::URLRequestContextGetter>& request_context_getter) { |
| bool use_fake_ssl_client_socket = |
| (xmpp_client_settings.protocol() == cricket::PROTO_SSLTCP); |
| - net::ClientSocketFactory* const client_socket_factory = |
| - new XmppClientSocketFactory( |
| - net::ClientSocketFactory::GetDefaultFactory(), |
| - use_fake_ssl_client_socket); |
| // The default SSLConfig is good enough for us for now. |
| const net::SSLConfig ssl_config; |
| // These numbers were taken from similar numbers in |
| @@ -36,16 +33,21 @@ |
| const size_t kWriteBufSize = 64U * 1024U; |
| // TODO(akalin): Use a real NetLog. |
| net::NetLog* const net_log = NULL; |
|
akalin
2011/04/15 01:47:33
remove TODO, use netlog from URLRequestContext
sanjeevr
2011/04/15 04:23:35
Done.
|
| - return new ChromeAsyncSocket( |
| - client_socket_factory, ssl_config, cert_verifier, |
| - kReadBufSize, kWriteBufSize, net_log); |
| + XmppClientSocketFactory* const client_socket_factory = |
| + new XmppClientSocketFactory( |
| + net::ClientSocketFactory::GetDefaultFactory(), |
| + ssl_config, |
| + request_context_getter, |
| + use_fake_ssl_client_socket); |
| + return new ChromeAsyncSocket(client_socket_factory, |
| + kReadBufSize, kWriteBufSize, net_log); |
| } |
| } // namespace |
| XmppConnection::XmppConnection( |
| const buzz::XmppClientSettings& xmpp_client_settings, |
| - net::CertVerifier* cert_verifier, |
| + const scoped_refptr<net::URLRequestContextGetter>& request_context_getter, |
| Delegate* delegate, buzz::PreXmppAuth* pre_xmpp_auth) |
| : task_pump_(new TaskPump()), |
| on_connect_called_(false), |
| @@ -64,7 +66,7 @@ |
| buzz::XmppReturnStatus connect_status = |
| weak_xmpp_client->Connect(xmpp_client_settings, kLanguage, |
| CreateSocket(xmpp_client_settings, |
| - cert_verifier), |
| + request_context_getter), |
| pre_xmpp_auth); |
| // buzz::XmppClient::Connect() should never fail. |
| DCHECK_EQ(connect_status, buzz::XMPP_RETURN_OK); |