diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-27 06:45:13 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-27 06:45:13 +0000 |
commit | c1b11c2ad72a240a8177704bd5c5e7f5c4c9c984 (patch) | |
tree | 020e886f7210da3b2d39af235a1cbf887cdf8d33 /remoting | |
parent | 024bd153681b77c14a1fb7950b0875711914f0c8 (diff) | |
download | chromium_src-c1b11c2ad72a240a8177704bd5c5e7f5c4c9c984.zip chromium_src-c1b11c2ad72a240a8177704bd5c5e7f5c4c9c984.tar.gz chromium_src-c1b11c2ad72a240a8177704bd5c5e7f5c4c9c984.tar.bz2 |
Make XmppSignalStrategy accept ResolvingClientSocketFactory from outside.
This is necessary to allow passing Pepper-based
ResolvingClientSocketFactory when using XMPP in the client plugin.
BUG=274652
Review URL: https://chromiumcodereview.appspot.com/23443004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@219719 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/client/jni/chromoting_jni_instance.cc | 9 | ||||
-rw-r--r-- | remoting/host/DEPS | 3 | ||||
-rw-r--r-- | remoting/host/plugin/host_script_object.cc | 9 | ||||
-rw-r--r-- | remoting/host/remoting_me2me_host.cc | 8 | ||||
-rw-r--r-- | remoting/jingle_glue/xmpp_signal_strategy.cc | 14 | ||||
-rw-r--r-- | remoting/jingle_glue/xmpp_signal_strategy.h | 13 |
6 files changed, 29 insertions, 27 deletions
diff --git a/remoting/client/jni/chromoting_jni_instance.cc b/remoting/client/jni/chromoting_jni_instance.cc index 7e45f7c..5eef55a 100644 --- a/remoting/client/jni/chromoting_jni_instance.cc +++ b/remoting/client/jni/chromoting_jni_instance.cc @@ -6,6 +6,7 @@ #include "base/bind.h" #include "base/logging.h" +#include "jingle/glue/xmpp_client_socket_factory.h" #include "net/socket/client_socket_factory.h" #include "remoting/client/audio_player.h" #include "remoting/client/jni/android_keymap.h" @@ -248,9 +249,11 @@ void ChromotingJniInstance::ConnectToHostOnNetworkThread() { view_->set_frame_producer(client_->GetFrameProducer()); - signaling_.reset(new XmppSignalStrategy( - net::ClientSocketFactory::GetDefaultFactory(), - jni_runtime_->url_requester(), xmpp_config_)); + scoped_ptr<jingle_glue::ResolvingClientSocketFactory> socket_factory( + new jingle_glue::XmppClientSocketFactory( + net::ClientSocketFactory::GetDefaultFactory(), net::SSLConfig(), + jni_runtime_->url_requester(), false)); + signaling_.reset(new XmppSignalStrategy(socket_factory.Pass(), xmpp_config_)); network_settings_.reset(new NetworkSettings( NetworkSettings::NAT_TRAVERSAL_ENABLED)); diff --git a/remoting/host/DEPS b/remoting/host/DEPS index ef945f3..90d75ca 100644 --- a/remoting/host/DEPS +++ b/remoting/host/DEPS @@ -1,8 +1,9 @@ include_rules = [ + "+jingle/glue", "+net", "+remoting/codec", - "+remoting/protocol", "+remoting/jingle_glue", + "+remoting/protocol", "+third_party/jsoncpp", "+third_party/modp_b64", "+third_party/npapi", diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc index b766cad..3ad35ab 100644 --- a/remoting/host/plugin/host_script_object.cc +++ b/remoting/host/plugin/host_script_object.cc @@ -15,6 +15,7 @@ #include "base/strings/utf_string_conversions.h" #include "base/threading/platform_thread.h" #include "base/values.h" +#include "jingle/glue/xmpp_client_socket_factory.h" #include "net/base/net_util.h" #include "net/socket/client_socket_factory.h" #include "remoting/base/auth_token_util.h" @@ -331,10 +332,12 @@ void HostNPScriptObject::It2MeImpl::FinishConnect() { host_key_pair_ = RsaKeyPair::Generate(); // Create XMPP connection. + scoped_ptr<jingle_glue::ResolvingClientSocketFactory> socket_factory( + new jingle_glue::XmppClientSocketFactory( + net::ClientSocketFactory::GetDefaultFactory(), net::SSLConfig(), + host_context_->url_request_context_getter(), false)); scoped_ptr<SignalStrategy> signal_strategy( - new XmppSignalStrategy(net::ClientSocketFactory::GetDefaultFactory(), - host_context_->url_request_context_getter(), - xmpp_server_config_)); + new XmppSignalStrategy(socket_factory.Pass(), xmpp_server_config_)); // Request registration of the host for support. scoped_ptr<RegisterSupportHostRequest> register_request( diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc index 9ed3383..e1ba452 100644 --- a/remoting/host/remoting_me2me_host.cc +++ b/remoting/host/remoting_me2me_host.cc @@ -27,6 +27,7 @@ #include "ipc/ipc_channel.h" #include "ipc/ipc_channel_proxy.h" #include "ipc/ipc_listener.h" +#include "jingle/glue/xmpp_client_socket_factory.h" #include "media/base/media.h" #include "net/base/network_change_notifier.h" #include "net/socket/client_socket_factory.h" @@ -965,9 +966,12 @@ void HostProcess::StartHost() { state_ == HOST_STOPPED) << state_; state_ = HOST_STARTED; + scoped_ptr<jingle_glue::ResolvingClientSocketFactory> socket_factory( + new jingle_glue::XmppClientSocketFactory( + net::ClientSocketFactory::GetDefaultFactory(), net::SSLConfig(), + context_->url_request_context_getter(), false)); signal_strategy_.reset( - new XmppSignalStrategy(net::ClientSocketFactory::GetDefaultFactory(), - context_->url_request_context_getter(), + new XmppSignalStrategy(socket_factory.Pass(), xmpp_server_config_)); scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker( diff --git a/remoting/jingle_glue/xmpp_signal_strategy.cc b/remoting/jingle_glue/xmpp_signal_strategy.cc index ed27833..a9da0de 100644 --- a/remoting/jingle_glue/xmpp_signal_strategy.cc +++ b/remoting/jingle_glue/xmpp_signal_strategy.cc @@ -11,12 +11,11 @@ #include "base/strings/string_util.h" #include "base/thread_task_runner_handle.h" #include "jingle/glue/chrome_async_socket.h" +#include "jingle/glue/resolving_client_socket_factory.h" #include "jingle/glue/task_pump.h" -#include "jingle/glue/xmpp_client_socket_factory.h" #include "jingle/notifier/base/gaia_constants.h" #include "jingle/notifier/base/gaia_token_pre_xmpp_auth.h" #include "net/socket/client_socket_factory.h" -#include "net/url_request/url_request_context_getter.h" #include "third_party/libjingle/source/talk/base/thread.h" #include "third_party/libjingle/source/talk/xmpp/prexmppauth.h" #include "third_party/libjingle/source/talk/xmpp/saslcookiemechanism.h" @@ -38,11 +37,9 @@ XmppSignalStrategy::XmppServerConfig::XmppServerConfig() {} XmppSignalStrategy::XmppServerConfig::~XmppServerConfig() {} XmppSignalStrategy::XmppSignalStrategy( - net::ClientSocketFactory* socket_factory, - scoped_refptr<net::URLRequestContextGetter> request_context_getter, + scoped_ptr<jingle_glue::ResolvingClientSocketFactory> socket_factory, const XmppSignalStrategy::XmppServerConfig& xmpp_server_config) - : socket_factory_(socket_factory), - request_context_getter_(request_context_getter), + : socket_factory_(socket_factory.Pass()), resource_name_(kDefaultResourceName), xmpp_client_(NULL), xmpp_server_config_(xmpp_server_config), @@ -82,11 +79,8 @@ void XmppSignalStrategy::Connect() { settings.set_use_tls( xmpp_server_config_.use_tls ? buzz::TLS_ENABLED : buzz::TLS_DISABLED); - scoped_ptr<jingle_glue::XmppClientSocketFactory> xmpp_socket_factory( - new jingle_glue::XmppClientSocketFactory( - socket_factory_, net::SSLConfig(), request_context_getter_, false)); buzz::AsyncSocket* socket = new jingle_glue::ChromeAsyncSocket( - xmpp_socket_factory.release(), kReadBufferSize, kWriteBufferSize); + socket_factory_.release(), kReadBufferSize, kWriteBufferSize); task_runner_.reset(new jingle_glue::TaskPump()); xmpp_client_ = new buzz::XmppClient(task_runner_.get()); diff --git a/remoting/jingle_glue/xmpp_signal_strategy.h b/remoting/jingle_glue/xmpp_signal_strategy.h index 4ef6b70..ecb13cc 100644 --- a/remoting/jingle_glue/xmpp_signal_strategy.h +++ b/remoting/jingle_glue/xmpp_signal_strategy.h @@ -21,10 +21,9 @@ #include "third_party/libjingle/source/talk/base/sigslot.h" #include "third_party/libjingle/source/talk/xmpp/xmppclient.h" -namespace net { -class ClientSocketFactory; -class URLRequestContextGetter; -} // namespace net +namespace jingle_glue { +class ResolvingClientSocketFactory; +} // namespace jingle_glue namespace talk_base { class TaskRunner; @@ -54,8 +53,7 @@ class XmppSignalStrategy : public base::NonThreadSafe, }; XmppSignalStrategy( - net::ClientSocketFactory* socket_factory, - scoped_refptr<net::URLRequestContextGetter> request_context_getter, + scoped_ptr<jingle_glue::ResolvingClientSocketFactory> socket_factory, const XmppServerConfig& xmpp_server_config); virtual ~XmppSignalStrategy(); @@ -93,8 +91,7 @@ class XmppSignalStrategy : public base::NonThreadSafe, void SendKeepAlive(); - net::ClientSocketFactory* socket_factory_; - scoped_refptr<net::URLRequestContextGetter> request_context_getter_; + scoped_ptr<jingle_glue::ResolvingClientSocketFactory> socket_factory_; std::string resource_name_; scoped_ptr<talk_base::TaskRunner> task_runner_; buzz::XmppClient* xmpp_client_; |