summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--remoting/host/constants.cc11
-rw-r--r--remoting/host/constants.h5
-rw-r--r--remoting/host/dns_blackhole_checker.cc70
-rw-r--r--remoting/host/dns_blackhole_checker.h53
-rw-r--r--remoting/host/policy_hack/policy_watcher.cc5
-rw-r--r--remoting/host/policy_hack/policy_watcher_linux.cc4
-rw-r--r--remoting/host/policy_hack/policy_watcher_unittest.cc4
-rw-r--r--remoting/host/remoting_me2me_host.cc94
-rw-r--r--remoting/host/signaling_connector.cc50
-rw-r--r--remoting/host/signaling_connector.h18
-rw-r--r--remoting/host/simple_host_process.cc7
-rw-r--r--remoting/remoting.gyp3
12 files changed, 253 insertions, 71 deletions
diff --git a/remoting/host/constants.cc b/remoting/host/constants.cc
deleted file mode 100644
index 8016b96..0000000
--- a/remoting/host/constants.cc
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (c) 2012 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.
-
-#include "remoting/host/constants.h"
-
-namespace remoting {
-
-const char kDefaultTalkGadgetPrefix[] = "org.chromium.chromoting";
-
-} // namespace remoting
diff --git a/remoting/host/constants.h b/remoting/host/constants.h
index 54aa228..0d37c38 100644
--- a/remoting/host/constants.h
+++ b/remoting/host/constants.h
@@ -9,11 +9,6 @@
namespace remoting {
-// This is the default prefix that is prepended to ".talkgadget.google.com"
-// to form the complete talkgadget domain name. Policy settings allow admins
-// to change the prefix that is used.
-extern const char kDefaultTalkGadgetPrefix[];
-
// Known host exit codes.
// Please keep this enum in sync with:
// remoting/host/installer/mac/PrivilegedHelperTools/
diff --git a/remoting/host/dns_blackhole_checker.cc b/remoting/host/dns_blackhole_checker.cc
new file mode 100644
index 0000000..fb4ae03
--- /dev/null
+++ b/remoting/host/dns_blackhole_checker.cc
@@ -0,0 +1,70 @@
+// Copyright (c) 2012 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.
+
+#include "remoting/host/dns_blackhole_checker.h"
+
+#include "googleurl/src/gurl.h"
+#include "net/url_request/url_fetcher.h"
+#include "remoting/host/chromoting_host_context.h"
+#include "remoting/host/constants.h"
+
+namespace remoting {
+
+// Default prefix added to the base talkgadget URL.
+const char kDefaultHostTalkGadgetPrefix[] = "chromoting-host";
+
+// The base talkgadget URL.
+const char kTalkGadgetUrl[] = ".talkgadget.google.com/talkgadget/"
+ "oauth/chrome-remote-desktop-host";
+
+DnsBlackholeChecker::DnsBlackholeChecker(
+ ChromotingHostContext* context,
+ std::string talkgadget_prefix)
+ : context_(context),
+ talkgadget_prefix_(talkgadget_prefix) {
+}
+
+DnsBlackholeChecker::~DnsBlackholeChecker() {
+}
+
+// This is called in response to the TalkGadget http request initiated from
+// CheckStatus().
+void DnsBlackholeChecker::OnURLFetchComplete(const net::URLFetcher* source) {
+ int response = source->GetResponseCode();
+ bool allow = false;
+ if (source->GetResponseCode() == 200) {
+ LOG(INFO) << "Successfully connected to host talkgadget.";
+ allow = true;
+ } else {
+ LOG(INFO) << "Unable to connect to host talkgadget (" << response << ")";
+ }
+ url_fetcher_.reset(NULL);
+ callback_.Run(allow);
+ callback_.Reset();
+}
+
+void DnsBlackholeChecker::CheckForDnsBlackhole(
+ const base::Callback<void(bool)>& callback) {
+ // Make sure we're not currently in the middle of a connection check.
+ if (!url_fetcher_.get()) {
+ DCHECK(callback_.is_null());
+ callback_ = callback;
+ std::string talkgadget_url("https://");
+ if (talkgadget_prefix_.empty()) {
+ talkgadget_url += kDefaultHostTalkGadgetPrefix;
+ } else {
+ talkgadget_url += talkgadget_prefix_;
+ }
+ talkgadget_url += kTalkGadgetUrl;
+ LOG(INFO) << "Verifying connection to " << talkgadget_url;
+ url_fetcher_.reset(net::URLFetcher::Create(GURL(talkgadget_url),
+ net::URLFetcher::GET, this));
+ url_fetcher_->SetRequestContext(context_->url_request_context_getter());
+ url_fetcher_->Start();
+ } else {
+ LOG(INFO) << "Pending connection check";
+ }
+}
+
+} // namespace remoting
diff --git a/remoting/host/dns_blackhole_checker.h b/remoting/host/dns_blackhole_checker.h
new file mode 100644
index 0000000..4ff75b4
--- /dev/null
+++ b/remoting/host/dns_blackhole_checker.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2012 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.
+
+#ifndef REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_
+#define REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_
+
+#include "net/url_request/url_fetcher_delegate.h"
+
+#include "base/callback.h"
+
+namespace remoting {
+
+// This is the default prefix that is prepended to the kTalkGadgetUrl to form
+// the complete talkgadget URL used by the host. Policy settings allow admins
+// to change the prefix that is used.
+extern const char kDefaultHostTalkGadgetPrefix[];
+
+class ChromotingHostContext;
+
+class DnsBlackholeChecker : public net::URLFetcherDelegate {
+ public:
+ DnsBlackholeChecker(ChromotingHostContext* context,
+ std::string talkgadget_prefix);
+ virtual ~DnsBlackholeChecker();
+
+ // net::URLFetcherDelegate interface.
+ virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
+
+ // Initiates a check the verify that the host talkgadget has not been "DNS
+ // blackholed" to prevent connections. If this is called again before the
+ // callback has been called, then the second call is ignored.
+ void CheckForDnsBlackhole(const base::Callback<void(bool)>& callback);
+
+ private:
+ ChromotingHostContext* context_;
+
+ // URL fetcher used to verify access to the host talkgadget.
+ scoped_ptr<net::URLFetcher> url_fetcher_;
+
+ // The string pre-pended to '.talkgadget.google.com' to create the full
+ // talkgadget domain name for the host.
+ std::string talkgadget_prefix_;
+
+ // Called with the results of the connection check.
+ base::Callback<void(bool)> callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(DnsBlackholeChecker);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_DNS_BLACKHOLE_CHECKER_H_
diff --git a/remoting/host/policy_hack/policy_watcher.cc b/remoting/host/policy_hack/policy_watcher.cc
index 270bccb..bfa83f4 100644
--- a/remoting/host/policy_hack/policy_watcher.cc
+++ b/remoting/host/policy_hack/policy_watcher.cc
@@ -15,7 +15,7 @@
#include "base/synchronization/waitable_event.h"
#include "base/time.h"
#include "base/values.h"
-#include "remoting/host/constants.h"
+#include "remoting/host/dns_blackhole_checker.h"
namespace remoting {
namespace policy_hack {
@@ -96,7 +96,8 @@ scoped_ptr<base::DictionaryValue> AddDefaultValuesWhenNecessary(
PolicyWatcher::kHostDomainPolicyName, "", "");
CopyStringOrDefault(to.get(), from,
PolicyWatcher::kHostTalkGadgetPrefixPolicyName,
- kDefaultTalkGadgetPrefix, kDefaultTalkGadgetPrefix);
+ kDefaultHostTalkGadgetPrefix,
+ kDefaultHostTalkGadgetPrefix);
CopyBooleanOrDefault(to.get(), from,
PolicyWatcher::kHostRequireCurtainPolicyName,
false, false);
diff --git a/remoting/host/policy_hack/policy_watcher_linux.cc b/remoting/host/policy_hack/policy_watcher_linux.cc
index 351e8e5..9d0e5ed 100644
--- a/remoting/host/policy_hack/policy_watcher_linux.cc
+++ b/remoting/host/policy_hack/policy_watcher_linux.cc
@@ -33,7 +33,9 @@ namespace policy_hack {
namespace {
const FilePath::CharType kPolicyDir[] =
- FILE_PATH_LITERAL("/etc/opt/chrome/policies/managed");
+ // Always read the Chrome policies (even on Chromium) so that policy
+ // enforcement can't be bypassed by running Chromium.
+ FILE_PATH_LITERAL("/etc/opt/chrome/policies/managed");
// Amount of time we wait for the files on disk to settle before trying to load
// them. This alleviates the problem of reading partially written files and
diff --git a/remoting/host/policy_hack/policy_watcher_unittest.cc b/remoting/host/policy_hack/policy_watcher_unittest.cc
index 5267a38..9f74541 100644
--- a/remoting/host/policy_hack/policy_watcher_unittest.cc
+++ b/remoting/host/policy_hack/policy_watcher_unittest.cc
@@ -6,7 +6,7 @@
#include "base/bind.h"
#include "base/message_loop.h"
#include "base/synchronization/waitable_event.h"
-#include "remoting/host/constants.h"
+#include "remoting/host/dns_blackhole_checker.h"
#include "remoting/host/policy_hack/fake_policy_watcher.h"
#include "remoting/host/policy_hack/mock_policy_callback.h"
#include "remoting/host/policy_hack/policy_watcher.h"
@@ -99,7 +99,7 @@ class PolicyWatcherTest : public testing::Test {
dict.SetBoolean(PolicyWatcher::kHostRequireTwoFactorPolicyName, false);
dict.SetString(PolicyWatcher::kHostDomainPolicyName, "");
dict.SetString(PolicyWatcher::kHostTalkGadgetPrefixPolicyName,
- kDefaultTalkGadgetPrefix);
+ kDefaultHostTalkGadgetPrefix);
dict.SetBoolean(PolicyWatcher::kHostRequireCurtainPolicyName, false);
}
};
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index fa01ee2..2d67463 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -36,6 +36,7 @@
#include "remoting/host/composite_host_config.h"
#include "remoting/host/constants.h"
#include "remoting/host/desktop_environment.h"
+#include "remoting/host/dns_blackhole_checker.h"
#include "remoting/host/event_executor.h"
#include "remoting/host/heartbeat_sender.h"
#include "remoting/host/host_config.h"
@@ -392,6 +393,11 @@ class HostProcess
&bool_value)) {
OnCurtainPolicyUpdate(bool_value);
}
+ if (policies->GetString(
+ policy_hack::PolicyWatcher::kHostTalkGadgetPrefixPolicyName,
+ &string_value)) {
+ OnHostTalkGadgetPrefixPolicyUpdate(string_value);
+ }
}
void OnHostDomainPolicyUpdate(const std::string& host_domain) {
@@ -459,47 +465,63 @@ class HostProcess
#endif
}
+ void OnHostTalkGadgetPrefixPolicyUpdate(
+ const std::string& talkgadget_prefix) {
+ if (!context_->network_task_runner()->BelongsToCurrentThread()) {
+ context_->network_task_runner()->PostTask(FROM_HERE, base::Bind(
+ &HostProcess::OnHostTalkGadgetPrefixPolicyUpdate,
+ base::Unretained(this), talkgadget_prefix));
+ return;
+ }
+
+ if (talkgadget_prefix != talkgadget_prefix_) {
+ LOG(INFO) << "Restarting host due to updated talkgadget policy:";
+ talkgadget_prefix_ = talkgadget_prefix;
+ RestartHost();
+ }
+ }
+
void StartHost() {
DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
DCHECK(!host_);
+ DCHECK(!signal_strategy_.get());
if (shutting_down_)
return;
- if (!signal_strategy_.get()) {
- signal_strategy_.reset(
- new XmppSignalStrategy(context_->url_request_context_getter(),
- xmpp_login_, xmpp_auth_token_,
- xmpp_auth_service_));
+ signal_strategy_.reset(
+ new XmppSignalStrategy(context_->url_request_context_getter(),
+ xmpp_login_, xmpp_auth_token_,
+ xmpp_auth_service_));
- signaling_connector_.reset(new SignalingConnector(
- signal_strategy_.get(),
- base::Bind(&HostProcess::OnAuthFailed, base::Unretained(this))));
+ scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker(
+ new DnsBlackholeChecker(context_.get(), talkgadget_prefix_));
- if (!oauth_refresh_token_.empty()) {
- OAuthClientInfo client_info = {
- kUnofficialOAuth2ClientId,
- kUnofficialOAuth2ClientSecret
- };
+ signaling_connector_.reset(new SignalingConnector(
+ signal_strategy_.get(), context_.get(), dns_blackhole_checker.Pass(),
+ base::Bind(&HostProcess::OnAuthFailed, base::Unretained(this))));
+
+ if (!oauth_refresh_token_.empty()) {
+ OAuthClientInfo client_info = {
+ kUnofficialOAuth2ClientId,
+ kUnofficialOAuth2ClientSecret
+ };
#ifdef OFFICIAL_BUILD
- if (oauth_use_official_client_id_) {
- OAuthClientInfo official_client_info = {
- kOfficialOAuth2ClientId,
- kOfficialOAuth2ClientSecret
- };
-
- client_info = official_client_info;
- }
-#endif // OFFICIAL_BUILD
+ if (oauth_use_official_client_id_) {
+ OAuthClientInfo official_client_info = {
+ kOfficialOAuth2ClientId,
+ kOfficialOAuth2ClientSecret
+ };
- scoped_ptr<SignalingConnector::OAuthCredentials> oauth_credentials(
- new SignalingConnector::OAuthCredentials(
- xmpp_login_, oauth_refresh_token_, client_info));
- signaling_connector_->EnableOAuth(
- oauth_credentials.Pass(),
- context_->url_request_context_getter());
+ client_info = official_client_info;
}
+#endif // OFFICIAL_BUILD
+
+ scoped_ptr<SignalingConnector::OAuthCredentials> oauth_credentials(
+ new SignalingConnector::OAuthCredentials(
+ xmpp_login_, oauth_refresh_token_, client_info));
+ signaling_connector_->EnableOAuth(oauth_credentials.Pass());
}
if (!desktop_environment_.get()) {
@@ -577,9 +599,7 @@ class HostProcess
restarting_ = false;
host_ = NULL;
- log_to_server_.reset();
- host_event_logger_.reset();
- heartbeat_sender_.reset();
+ ResetHost();
StartHost();
}
@@ -605,13 +625,19 @@ class HostProcess
// Destroy networking objects while we are on the network thread.
host_ = NULL;
+ ResetHost();
+
+ message_loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure());
+ }
+
+ void ResetHost() {
+ DCHECK(context_->network_task_runner()->BelongsToCurrentThread());
+
host_event_logger_.reset();
log_to_server_.reset();
heartbeat_sender_.reset();
signaling_connector_.reset();
signal_strategy_.reset();
-
- message_loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure());
}
MessageLoop message_loop_;
@@ -634,6 +660,8 @@ class HostProcess
scoped_ptr<policy_hack::PolicyWatcher> policy_watcher_;
bool allow_nat_traversal_;
+ std::string talkgadget_prefix_;
+
scoped_ptr<base::files::FilePathWatcher> config_watcher_;
scoped_ptr<base::DelayTimer<HostProcess> > config_updated_timer_;
diff --git a/remoting/host/signaling_connector.cc b/remoting/host/signaling_connector.cc
index 9e95219..960c015 100644
--- a/remoting/host/signaling_connector.cc
+++ b/remoting/host/signaling_connector.cc
@@ -6,7 +6,10 @@
#include "base/bind.h"
#include "base/callback.h"
+#include "net/url_request/url_fetcher.h"
#include "remoting/host/chromoting_host_context.h"
+#include "remoting/host/constants.h"
+#include "remoting/host/dns_blackhole_checker.h"
#include "remoting/host/url_request_context.h"
namespace remoting {
@@ -33,12 +36,17 @@ SignalingConnector::OAuthCredentials::OAuthCredentials(
SignalingConnector::SignalingConnector(
XmppSignalStrategy* signal_strategy,
+ ChromotingHostContext* context,
+ scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker,
const base::Closure& auth_failed_callback)
: signal_strategy_(signal_strategy),
+ context_(context),
auth_failed_callback_(auth_failed_callback),
+ dns_blackhole_checker_(dns_blackhole_checker.Pass()),
reconnect_attempts_(0),
refreshing_oauth_token_(false) {
DCHECK(!auth_failed_callback_.is_null());
+ DCHECK(dns_blackhole_checker_.get());
net::NetworkChangeNotifier::AddConnectionTypeObserver(this);
net::NetworkChangeNotifier::AddIPAddressObserver(this);
signal_strategy_->AddListener(this);
@@ -52,11 +60,10 @@ SignalingConnector::~SignalingConnector() {
}
void SignalingConnector::EnableOAuth(
- scoped_ptr<OAuthCredentials> oauth_credentials,
- net::URLRequestContextGetter* url_context) {
+ scoped_ptr<OAuthCredentials> oauth_credentials) {
oauth_credentials_ = oauth_credentials.Pass();
gaia_oauth_client_.reset(new GaiaOAuthClient(
- OAuthProviderInfo::GetDefault(), url_context));
+ OAuthProviderInfo::GetDefault(), context_->url_request_context_getter()));
}
void SignalingConnector::OnSignalStrategyStateChange(
@@ -85,12 +92,6 @@ bool SignalingConnector::OnSignalStrategyIncomingStanza(
return false;
}
-void SignalingConnector::OnIPAddressChanged() {
- DCHECK(CalledOnValidThread());
- LOG(INFO) << "IP address has changed.";
- ResetAndTryReconnect();
-}
-
void SignalingConnector::OnConnectionTypeChanged(
net::NetworkChangeNotifier::ConnectionType type) {
DCHECK(CalledOnValidThread());
@@ -100,6 +101,12 @@ void SignalingConnector::OnConnectionTypeChanged(
}
}
+void SignalingConnector::OnIPAddressChanged() {
+ DCHECK(CalledOnValidThread());
+ LOG(INFO) << "IP address has changed.";
+ ResetAndTryReconnect();
+}
+
void SignalingConnector::OnRefreshTokenResponse(const std::string& user_email,
const std::string& access_token,
int expires_seconds) {
@@ -147,7 +154,7 @@ void SignalingConnector::ScheduleTryReconnect() {
DCHECK(CalledOnValidThread());
if (timer_.IsRunning() || net::NetworkChangeNotifier::IsOffline())
return;
- int delay_s = std::min(1 << (reconnect_attempts_ * 2),
+ int delay_s = std::min(1 << reconnect_attempts_,
kMaxReconnectDelaySeconds);
timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(delay_s),
this, &SignalingConnector::TryReconnect);
@@ -163,6 +170,29 @@ void SignalingConnector::ResetAndTryReconnect() {
void SignalingConnector::TryReconnect() {
DCHECK(CalledOnValidThread());
+ DCHECK(dns_blackhole_checker_.get());
+
+ // This will check if this machine is allowed to access the chromoting
+ // host talkgadget.
+ dns_blackhole_checker_->CheckForDnsBlackhole(
+ base::Bind(&SignalingConnector::OnDnsBlackholeCheckerDone,
+ base::Unretained(this)));
+}
+
+void SignalingConnector::OnDnsBlackholeCheckerDone(bool allow) {
+ DCHECK(CalledOnValidThread());
+
+ // Unable to access the host talkgadget. Don't allow the connection, but
+ // schedule a reconnect in case this is a transient problem rather than
+ // an outright block.
+ if (!allow) {
+ reconnect_attempts_++;
+ LOG(INFO) << "Talkgadget check failed. Scheduling reconnect. Attempt "
+ << reconnect_attempts_;
+ ScheduleTryReconnect();
+ return;
+ }
+
if (signal_strategy_->GetState() == SignalStrategy::DISCONNECTED) {
bool need_new_auth_token = oauth_credentials_.get() &&
(auth_token_expiry_time_.is_null() ||
diff --git a/remoting/host/signaling_connector.h b/remoting/host/signaling_connector.h
index f1466b7..0ab17f4 100644
--- a/remoting/host/signaling_connector.h
+++ b/remoting/host/signaling_connector.h
@@ -14,11 +14,15 @@
#include "remoting/jingle_glue/xmpp_signal_strategy.h"
namespace net {
+class URLFetcher;
class URLRequestContextGetter;
} // namespace net
namespace remoting {
+class ChromotingHostContext;
+class DnsBlackholeChecker;
+
// SignalingConnector listens for SignalStrategy status notifications
// and attempts to keep it connected when possible. When signalling is
// not connected it keeps trying to reconnect it until it is
@@ -52,13 +56,14 @@ class SignalingConnector
// The |auth_failed_callback| is called when authentication fails.
SignalingConnector(XmppSignalStrategy* signal_strategy,
+ ChromotingHostContext* context,
+ scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker,
const base::Closure& auth_failed_callback);
virtual ~SignalingConnector();
// May be called immediately after the constructor to enable OAuth
// access token updating.
- void EnableOAuth(scoped_ptr<OAuthCredentials> oauth_credentials,
- net::URLRequestContextGetter* url_context);
+ void EnableOAuth(scoped_ptr<OAuthCredentials> oauth_credentials);
// SignalStrategy::Listener interface.
virtual void OnSignalStrategyStateChange(
@@ -66,13 +71,13 @@ class SignalingConnector
virtual bool OnSignalStrategyIncomingStanza(
const buzz::XmlElement* stanza) OVERRIDE;
- // NetworkChangeNotifier::IPAddressObserver interface.
- virtual void OnIPAddressChanged() OVERRIDE;
-
// NetworkChangeNotifier::ConnectionTypeObserver interface.
virtual void OnConnectionTypeChanged(
net::NetworkChangeNotifier::ConnectionType type) OVERRIDE;
+ // NetworkChangeNotifier::IPAddressObserver interface.
+ virtual void OnIPAddressChanged() OVERRIDE;
+
// GaiaOAuthClient::Delegate interface.
virtual void OnRefreshTokenResponse(const std::string& user_email,
const std::string& access_token,
@@ -84,14 +89,17 @@ class SignalingConnector
void ScheduleTryReconnect();
void ResetAndTryReconnect();
void TryReconnect();
+ void OnDnsBlackholeCheckerDone(bool allow);
void RefreshOAuthToken();
XmppSignalStrategy* signal_strategy_;
+ ChromotingHostContext* context_;
base::Closure auth_failed_callback_;
scoped_ptr<OAuthCredentials> oauth_credentials_;
scoped_ptr<GaiaOAuthClient> gaia_oauth_client_;
+ scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker_;
// Number of times we tried to connect without success.
int reconnect_attempts_;
diff --git a/remoting/host/simple_host_process.cc b/remoting/host/simple_host_process.cc
index 5d03329..6353a3d1 100644
--- a/remoting/host/simple_host_process.cc
+++ b/remoting/host/simple_host_process.cc
@@ -38,6 +38,7 @@
#include "remoting/host/chromoting_host.h"
#include "remoting/host/constants.h"
#include "remoting/host/desktop_environment.h"
+#include "remoting/host/dns_blackhole_checker.h"
#include "remoting/host/event_executor.h"
#include "remoting/host/heartbeat_sender.h"
#include "remoting/host/host_key_pair.h"
@@ -220,8 +221,10 @@ class SimpleHost : public HeartbeatSender::Listener {
signal_strategy_.reset(new XmppSignalStrategy(
context_.url_request_context_getter(),
xmpp_login_, xmpp_auth_token_, xmpp_auth_service_));
+ scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker(
+ new DnsBlackholeChecker(&context_, kDefaultHostTalkGadgetPrefix));
signaling_connector_.reset(new SignalingConnector(
- signal_strategy_.get(),
+ signal_strategy_.get(), &context_, dns_blackhole_checker.Pass(),
base::Bind(&SimpleHost::OnAuthFailed, base::Unretained(this))));
if (fake_) {
@@ -304,6 +307,7 @@ class SimpleHost : public HeartbeatSender::Listener {
log_to_server_.reset();
heartbeat_sender_.reset();
signaling_connector_.reset();
+ dns_blackhole_checker_.reset();
signal_strategy_.reset();
message_loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure());
@@ -327,6 +331,7 @@ class SimpleHost : public HeartbeatSender::Listener {
std::string xmpp_auth_service_;
scoped_ptr<XmppSignalStrategy> signal_strategy_;
+ scoped_ptr<DnsBlackholeChecker> dns_blackhole_checker_;
scoped_ptr<SignalingConnector> signaling_connector_;
scoped_ptr<DesktopEnvironment> desktop_environment_;
scoped_ptr<LogToServer> log_to_server_;
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index fe14fa1..75c7ad2 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -1209,7 +1209,6 @@
'host/clipboard_win.cc',
'host/composite_host_config.cc',
'host/composite_host_config.h',
- 'host/constants.cc',
'host/constants.h',
'host/constants_mac.cc',
'host/constants_mac.h',
@@ -1227,6 +1226,8 @@
'host/disconnect_window_mac.h',
'host/disconnect_window_mac.mm',
'host/disconnect_window_win.cc',
+ 'host/dns_blackhole_checker.cc',
+ 'host/dns_blackhole_checker.h',
'host/event_executor.h',
'host/event_executor_linux.cc',
'host/event_executor_mac.cc',