summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorrobertphillips@google.com <robertphillips@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-01 12:45:36 +0000
committerrobertphillips@google.com <robertphillips@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-01 12:45:36 +0000
commit966224629669f9a2ef62a2e40d3d4b67c1235689 (patch)
tree92dc190252e562be3cccbb76bdec373169d825c7 /remoting
parent035213a6e5c49f37dcc7966b02efc2b6f14d2c84 (diff)
downloadchromium_src-966224629669f9a2ef62a2e40d3d4b67c1235689.zip
chromium_src-966224629669f9a2ef62a2e40d3d4b67c1235689.tar.gz
chromium_src-966224629669f9a2ef62a2e40d3d4b67c1235689.tar.bz2
Revert 232331 "It2Me native messaging: GYP and source refactoring"
> It2Me native messaging: GYP and source refactoring > > 1. Add "me2me" to the names of all the me2me specific GYP targets and source files. This makes it easier for my next CL that will add the It2Me native messaging host component. > 2. Create a remoting_native_messaging_base GYP target that contains the common native messaging plumbing code shared between remoting_core, remoting_me2me_native_messaging_host and the to-be-created remoting_it2me_native_messaging_host. > 3. Clean up some dependencies in remoting.gyp: e.g. the native messaging manifest should be depended on by the archive targets, not the native messaging host binary targets. > 4. Rename It2MeImpl to It2MeHost. > > BUG=309844 > > Review URL: https://codereview.chromium.org/49113003 TBR=weitaosu@chromium.org Review URL: https://codereview.chromium.org/50033003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232341 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/host/host_main.cc10
-rw-r--r--remoting/host/it2me/it2me_impl.cc (renamed from remoting/host/it2me/it2me_host.cc)71
-rw-r--r--remoting/host/it2me/it2me_impl.h (renamed from remoting/host/it2me/it2me_host.h)22
-rw-r--r--remoting/host/plugin/host_script_object.cc26
-rw-r--r--remoting/host/plugin/host_script_object.h16
-rw-r--r--remoting/host/setup/native_messaging_channel.cc (renamed from remoting/host/native_messaging/native_messaging_channel.cc)2
-rw-r--r--remoting/host/setup/native_messaging_channel.h (renamed from remoting/host/native_messaging/native_messaging_channel.h)12
-rw-r--r--remoting/host/setup/native_messaging_host.cc (renamed from remoting/host/setup/me2me_native_messaging_host.cc)2
-rw-r--r--remoting/host/setup/native_messaging_host.h (renamed from remoting/host/setup/me2me_native_messaging_host.h)8
-rw-r--r--remoting/host/setup/native_messaging_host_main.cc (renamed from remoting/host/setup/me2me_native_messaging_host_main.cc)2
-rw-r--r--remoting/host/setup/native_messaging_host_unittest.cc (renamed from remoting/host/setup/me2me_native_messaging_host_unittest.cc)4
-rw-r--r--remoting/host/setup/native_messaging_manifest.json (renamed from remoting/host/setup/me2me_native_messaging_manifest.json)2
-rw-r--r--remoting/host/setup/native_messaging_reader.cc (renamed from remoting/host/native_messaging/native_messaging_reader.cc)2
-rw-r--r--remoting/host/setup/native_messaging_reader.h (renamed from remoting/host/native_messaging/native_messaging_reader.h)6
-rw-r--r--remoting/host/setup/native_messaging_reader_unittest.cc (renamed from remoting/host/native_messaging/native_messaging_reader_unittest.cc)2
-rw-r--r--remoting/host/setup/native_messaging_writer.cc (renamed from remoting/host/native_messaging/native_messaging_writer.cc)2
-rw-r--r--remoting/host/setup/native_messaging_writer.h (renamed from remoting/host/native_messaging/native_messaging_writer.h)6
-rw-r--r--remoting/host/setup/native_messaging_writer_unittest.cc (renamed from remoting/host/native_messaging/native_messaging_writer_unittest.cc)2
-rw-r--r--remoting/remoting.gyp80
19 files changed, 133 insertions, 144 deletions
diff --git a/remoting/host/host_main.cc b/remoting/host/host_main.cc
index 512bc64..bf3dc17 100644
--- a/remoting/host/host_main.cc
+++ b/remoting/host/host_main.cc
@@ -21,7 +21,7 @@
#include "remoting/base/resources.h"
#include "remoting/host/host_exit_codes.h"
#include "remoting/host/logging.h"
-#include "remoting/host/setup/me2me_native_messaging_host.h"
+#include "remoting/host/setup/native_messaging_host.h"
#include "remoting/host/usage_stats_consent.h"
#if defined(OS_MACOSX)
@@ -155,10 +155,7 @@ int RdpDesktopSessionMain() {
MainRoutineFn SelectMainRoutine(const std::string& process_type) {
MainRoutineFn main_routine = NULL;
- if (process_type == kProcessTypeHost) {
- main_routine = &HostProcessMain;
-#if defined(OS_WIN)
- } else if (process_type == kProcessTypeDaemon) {
+ if (process_type == kProcessTypeDaemon) {
main_routine = &DaemonProcessMain;
} else if (process_type == kProcessTypeDesktop) {
main_routine = &DesktopProcessMain;
@@ -166,9 +163,10 @@ MainRoutineFn SelectMainRoutine(const std::string& process_type) {
main_routine = &ElevatedControllerMain;
} else if (process_type == kProcessTypeRdpDesktopSession) {
main_routine = &RdpDesktopSessionMain;
+ } else if (process_type == kProcessTypeHost) {
+ main_routine = &HostProcessMain;
} else if (process_type == kProcessTypeNativeMessagingHost) {
main_routine = &NativeMessagingHostMain;
-#endif // defined(OS_WIN)
}
return main_routine;
diff --git a/remoting/host/it2me/it2me_host.cc b/remoting/host/it2me/it2me_impl.cc
index 465ca27..7b1b4c4 100644
--- a/remoting/host/it2me/it2me_host.cc
+++ b/remoting/host/it2me/it2me_impl.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/it2me/it2me_host.h"
+#include "remoting/host/it2me/it2me_impl.h"
#include "base/bind.h"
#include "base/strings/string_util.h"
@@ -32,10 +32,10 @@ const int kMaxLoginAttempts = 5;
} // namespace
-It2MeHost::It2MeHost(
+It2MeImpl::It2MeImpl(
scoped_ptr<ChromotingHostContext> host_context,
scoped_refptr<base::SingleThreadTaskRunner> plugin_task_runner,
- base::WeakPtr<It2MeHost::Observer> observer,
+ base::WeakPtr<It2MeImpl::Observer> observer,
const XmppSignalStrategy::XmppServerConfig& xmpp_server_config,
const std::string& directory_bot_jid)
: host_context_(host_context.Pass()),
@@ -50,11 +50,11 @@ It2MeHost::It2MeHost(
DCHECK(plugin_task_runner_->BelongsToCurrentThread());
}
-void It2MeHost::Connect() {
+void It2MeImpl::Connect() {
if (!host_context_->ui_task_runner()->BelongsToCurrentThread()) {
DCHECK(plugin_task_runner_->BelongsToCurrentThread());
host_context_->ui_task_runner()->PostTask(
- FROM_HERE, base::Bind(&It2MeHost::Connect, this));
+ FROM_HERE, base::Bind(&It2MeImpl::Connect, this));
return;
}
@@ -67,18 +67,18 @@ void It2MeHost::Connect() {
policy_watcher_.reset(
policy_hack::PolicyWatcher::Create(host_context_->network_task_runner()));
policy_watcher_->StartWatching(
- base::Bind(&It2MeHost::OnPolicyUpdate, this));
+ base::Bind(&It2MeImpl::OnPolicyUpdate, this));
// Switch to the network thread to start the actual connection.
host_context_->network_task_runner()->PostTask(
- FROM_HERE, base::Bind(&It2MeHost::ReadPolicyAndConnect, this));
+ FROM_HERE, base::Bind(&It2MeImpl::ReadPolicyAndConnect, this));
}
-void It2MeHost::Disconnect() {
+void It2MeImpl::Disconnect() {
if (!host_context_->network_task_runner()->BelongsToCurrentThread()) {
DCHECK(plugin_task_runner_->BelongsToCurrentThread());
host_context_->network_task_runner()->PostTask(
- FROM_HERE, base::Bind(&It2MeHost::Disconnect, this));
+ FROM_HERE, base::Bind(&It2MeImpl::Disconnect, this));
return;
}
@@ -109,16 +109,16 @@ void It2MeHost::Disconnect() {
// SignalStrategy::Listener handlers are not allowed to destroy
// SignalStrategy, so post task to destroy the host later.
host_context_->network_task_runner()->PostTask(
- FROM_HERE, base::Bind(&It2MeHost::ShutdownOnNetworkThread, this));
+ FROM_HERE, base::Bind(&It2MeImpl::ShutdownOnNetworkThread, this));
return;
}
}
-void It2MeHost::RequestNatPolicy() {
+void It2MeImpl::RequestNatPolicy() {
if (!host_context_->network_task_runner()->BelongsToCurrentThread()) {
DCHECK(plugin_task_runner_->BelongsToCurrentThread());
host_context_->network_task_runner()->PostTask(
- FROM_HERE, base::Bind(&It2MeHost::RequestNatPolicy, this));
+ FROM_HERE, base::Bind(&It2MeImpl::RequestNatPolicy, this));
return;
}
@@ -126,7 +126,7 @@ void It2MeHost::RequestNatPolicy() {
UpdateNatPolicy(nat_traversal_enabled_);
}
-void It2MeHost::ReadPolicyAndConnect() {
+void It2MeImpl::ReadPolicyAndConnect() {
DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread());
SetState(kStarting);
@@ -138,11 +138,11 @@ void It2MeHost::ReadPolicyAndConnect() {
} else {
// Otherwise, create the policy watcher, and thunk the connect.
pending_connect_ =
- base::Bind(&It2MeHost::FinishConnect, this);
+ base::Bind(&It2MeImpl::FinishConnect, this);
}
}
-void It2MeHost::FinishConnect() {
+void It2MeImpl::FinishConnect() {
DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread());
if (state_ != kStarting) {
@@ -172,7 +172,7 @@ void It2MeHost::FinishConnect() {
scoped_ptr<RegisterSupportHostRequest> register_request(
new RegisterSupportHostRequest(
signal_strategy.get(), host_key_pair_, directory_bot_jid_,
- base::Bind(&It2MeHost::OnReceivedSupportID,
+ base::Bind(&It2MeImpl::OnReceivedSupportID,
base::Unretained(this))));
// Beyond this point nothing can fail, so save the config and request.
@@ -231,7 +231,7 @@ void It2MeHost::FinishConnect() {
return;
}
-void It2MeHost::ShutdownOnNetworkThread() {
+void It2MeImpl::ShutdownOnNetworkThread() {
DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread());
DCHECK(state_ == kDisconnecting || state_ == kDisconnected);
@@ -247,10 +247,10 @@ void It2MeHost::ShutdownOnNetworkThread() {
}
host_context_->ui_task_runner()->PostTask(
- FROM_HERE, base::Bind(&It2MeHost::ShutdownOnUiThread, this));
+ FROM_HERE, base::Bind(&It2MeImpl::ShutdownOnUiThread, this));
}
-void It2MeHost::ShutdownOnUiThread() {
+void It2MeImpl::ShutdownOnUiThread() {
DCHECK(host_context_->ui_task_runner()->BelongsToCurrentThread());
// Destroy the DesktopEnvironmentFactory, to free thread references.
@@ -265,7 +265,7 @@ void It2MeHost::ShutdownOnUiThread() {
}
}
-void It2MeHost::OnAccessDenied(const std::string& jid) {
+void It2MeImpl::OnAccessDenied(const std::string& jid) {
DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread());
++failed_login_attempts_;
@@ -274,7 +274,8 @@ void It2MeHost::OnAccessDenied(const std::string& jid) {
}
}
-void It2MeHost::OnClientAuthenticated(const std::string& jid) {
+void It2MeImpl::OnClientAuthenticated(
+ const std::string& jid) {
DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread());
if (state_ == kDisconnecting) {
@@ -299,19 +300,21 @@ void It2MeHost::OnClientAuthenticated(const std::string& jid) {
// Pass the client user name to the script object before changing state.
plugin_task_runner_->PostTask(
- FROM_HERE, base::Bind(&It2MeHost::Observer::OnClientAuthenticated,
+ FROM_HERE, base::Bind(&It2MeImpl::Observer::OnClientAuthenticated,
observer_, client_username));
SetState(kConnected);
}
-void It2MeHost::OnClientDisconnected(const std::string& jid) {
+void It2MeImpl::OnClientDisconnected(
+ const std::string& jid) {
DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread());
Disconnect();
}
-void It2MeHost::OnPolicyUpdate(scoped_ptr<base::DictionaryValue> policies) {
+void It2MeImpl::OnPolicyUpdate(
+ scoped_ptr<base::DictionaryValue> policies) {
DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread());
bool nat_policy;
@@ -333,7 +336,8 @@ void It2MeHost::OnPolicyUpdate(scoped_ptr<base::DictionaryValue> policies) {
}
}
-void It2MeHost::UpdateNatPolicy(bool nat_traversal_enabled) {
+void It2MeImpl::UpdateNatPolicy(
+ bool nat_traversal_enabled) {
DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread());
VLOG(2) << "UpdateNatPolicy: " << nat_traversal_enabled;
@@ -348,11 +352,12 @@ void It2MeHost::UpdateNatPolicy(bool nat_traversal_enabled) {
// Notify the web-app of the policy setting.
plugin_task_runner_->PostTask(
- FROM_HERE, base::Bind(&It2MeHost::Observer::OnNatPolicyChanged,
+ FROM_HERE, base::Bind(&It2MeImpl::Observer::OnNatPolicyChanged,
observer_, nat_traversal_enabled_));
}
-void It2MeHost::UpdateHostDomainPolicy(const std::string& host_domain) {
+void It2MeImpl::UpdateHostDomainPolicy(
+ const std::string& host_domain) {
DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread());
VLOG(2) << "UpdateHostDomainPolicy: " << host_domain;
@@ -365,13 +370,13 @@ void It2MeHost::UpdateHostDomainPolicy(const std::string& host_domain) {
required_host_domain_ = host_domain;
}
-It2MeHost::~It2MeHost() {
+It2MeImpl::~It2MeImpl() {
// Check that resources that need to be torn down on the UI thread are gone.
DCHECK(!desktop_environment_factory_.get());
DCHECK(!policy_watcher_.get());
}
-void It2MeHost::SetState(It2MeHostState state) {
+void It2MeImpl::SetState(It2MeHostState state) {
DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread());
switch (state_) {
@@ -415,16 +420,16 @@ void It2MeHost::SetState(It2MeHostState state) {
// Post a state-change notification to the web-app.
plugin_task_runner_->PostTask(
- FROM_HERE, base::Bind(&It2MeHost::Observer::OnStateChanged,
+ FROM_HERE, base::Bind(&It2MeImpl::Observer::OnStateChanged,
observer_, state));
}
-bool It2MeHost::IsConnected() const {
+bool It2MeImpl::IsConnected() const {
return state_ == kRequestedAccessCode || state_ == kReceivedAccessCode ||
state_ == kConnected;
}
-void It2MeHost::OnReceivedSupportID(
+void It2MeImpl::OnReceivedSupportID(
bool success,
const std::string& support_id,
const base::TimeDelta& lifetime) {
@@ -454,7 +459,7 @@ void It2MeHost::OnReceivedSupportID(
// Pass the Access Code to the script object before changing state.
plugin_task_runner_->PostTask(
- FROM_HERE, base::Bind(&It2MeHost::Observer::OnStoreAccessCode,
+ FROM_HERE, base::Bind(&It2MeImpl::Observer::OnStoreAccessCode,
observer_, access_code, lifetime));
SetState(kReceivedAccessCode);
diff --git a/remoting/host/it2me/it2me_host.h b/remoting/host/it2me/it2me_impl.h
index 6a40276..f31709b 100644
--- a/remoting/host/it2me/it2me_host.h
+++ b/remoting/host/it2me/it2me_impl.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef REMOTING_HOST_IT2ME_IT2ME_HOST_H_
-#define REMOTING_HOST_IT2ME_IT2ME_HOST_H_
+#ifndef REMOTING_HOST_IT2ME__IT2ME_IMPL_H_
+#define REMOTING_HOST_IT2ME__IT2ME_IMPL_H_
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
@@ -40,8 +40,8 @@ enum It2MeHostState {
};
// Internal implementation of the plugin's It2Me host function.
-class It2MeHost
- : public base::RefCountedThreadSafe<It2MeHost>,
+class It2MeImpl
+ : public base::RefCountedThreadSafe<It2MeImpl>,
public HostStatusObserver {
public:
@@ -54,10 +54,10 @@ class It2MeHost
virtual void OnStateChanged(It2MeHostState state) = 0;
};
- It2MeHost(
+ It2MeImpl(
scoped_ptr<ChromotingHostContext> context,
scoped_refptr<base::SingleThreadTaskRunner> plugin_task_runner,
- base::WeakPtr<It2MeHost::Observer> observer,
+ base::WeakPtr<It2MeImpl::Observer> observer,
const XmppSignalStrategy::XmppServerConfig& xmpp_server_config,
const std::string& directory_bot_jid);
@@ -79,9 +79,9 @@ class It2MeHost
virtual void OnClientDisconnected(const std::string& jid) OVERRIDE;
private:
- friend class base::RefCountedThreadSafe<It2MeHost>;
+ friend class base::RefCountedThreadSafe<It2MeImpl>;
- virtual ~It2MeHost();
+ virtual ~It2MeImpl();
// Updates state of the host. Can be called only on the network thread.
void SetState(It2MeHostState state);
@@ -118,7 +118,7 @@ class It2MeHost
// Caller supplied fields.
scoped_ptr<ChromotingHostContext> host_context_;
scoped_refptr<base::SingleThreadTaskRunner> plugin_task_runner_;
- base::WeakPtr<It2MeHost::Observer> observer_;
+ base::WeakPtr<It2MeImpl::Observer> observer_;
XmppSignalStrategy::XmppServerConfig xmpp_server_config_;
std::string directory_bot_jid_;
@@ -153,9 +153,9 @@ class It2MeHost
// variable contains the thunk if it is necessary.
base::Closure pending_connect_;
- DISALLOW_COPY_AND_ASSIGN(It2MeHost);
+ DISALLOW_COPY_AND_ASSIGN(It2MeImpl);
};
} // namespace remoting
-#endif // REMOTING_HOST_IT2ME_IT2ME_HOST_H_
+#endif // REMOTING_HOST_IT2ME__IT2ME_IMPL_H_
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc
index 542f725..66d228c 100644
--- a/remoting/host/plugin/host_script_object.cc
+++ b/remoting/host/plugin/host_script_object.cc
@@ -130,9 +130,9 @@ HostNPScriptObject::~HostNPScriptObject() {
HostLogHandler::UnregisterLoggingScriptObject(this);
// Stop the It2Me host if the caller forgot to.
- if (it2me_host_.get()) {
- it2me_host_->Disconnect();
- it2me_host_ = NULL;
+ if (it2me_impl_.get()) {
+ it2me_impl_->Disconnect();
+ it2me_impl_ = NULL;
}
}
@@ -315,9 +315,9 @@ bool HostNPScriptObject::SetProperty(const std::string& property_name,
if (property_name == kAttrNameOnNatTraversalPolicyChanged) {
if (NPVARIANT_IS_OBJECT(*value)) {
on_nat_traversal_policy_changed_func_ = NPVARIANT_TO_OBJECT(*value);
- if (it2me_host_.get()) {
- // Ask the It2Me host to notify the web-app of the policy.
- it2me_host_->RequestNatPolicy();
+ if (it2me_impl_.get()) {
+ // Ask the It2Me implementation to notify the web-app of the policy.
+ it2me_impl_->RequestNatPolicy();
}
return true;
} else {
@@ -454,7 +454,7 @@ bool HostNPScriptObject::Connect(const NPVariant* args,
return false;
}
- if (it2me_host_.get()) {
+ if (it2me_impl_.get()) {
SetException("connect: can be called only when disconnected");
return false;
}
@@ -483,11 +483,11 @@ bool HostNPScriptObject::Connect(const NPVariant* args,
return false;
}
- // Create the It2Me host and start connecting.
- it2me_host_ = new It2MeHost(
+ // Create the It2Me host implementation and start connecting.
+ it2me_impl_ = new It2MeImpl(
host_context.Pass(), plugin_task_runner_, weak_ptr_,
xmpp_config, directory_bot_jid_);
- it2me_host_->Connect();
+ it2me_impl_->Connect();
return true;
}
@@ -501,9 +501,9 @@ bool HostNPScriptObject::Disconnect(const NPVariant* args,
return false;
}
- if (it2me_host_.get()) {
- it2me_host_->Disconnect();
- it2me_host_ = NULL;
+ if (it2me_impl_.get()) {
+ it2me_impl_->Disconnect();
+ it2me_impl_ = NULL;
}
return true;
diff --git a/remoting/host/plugin/host_script_object.h b/remoting/host/plugin/host_script_object.h
index 2558903..74abcd9 100644
--- a/remoting/host/plugin/host_script_object.h
+++ b/remoting/host/plugin/host_script_object.h
@@ -13,7 +13,7 @@
#include "base/thread_task_runner_handle.h"
#include "base/time/time.h"
#include "remoting/base/auto_thread_task_runner.h"
-#include "remoting/host/it2me/it2me_host.h"
+#include "remoting/host/it2me/it2me_impl.h"
#include "remoting/host/plugin/host_plugin_utils.h"
#include "remoting/host/setup/daemon_controller.h"
#include "remoting/jingle_glue/xmpp_signal_strategy.h"
@@ -25,7 +25,7 @@ namespace remoting {
// HostNPScriptObject creates threads that are required to run
// ChromotingHost and starts/stops the host on those threads. When
// destroyed it synchronously shuts down the host and all threads.
-class HostNPScriptObject : public It2MeHost::Observer {
+class HostNPScriptObject : public It2MeImpl::Observer {
public:
HostNPScriptObject(NPP plugin,
NPObject* parent,
@@ -157,7 +157,7 @@ class HostNPScriptObject : public It2MeHost::Observer {
bool StopDaemon(const NPVariant* args, uint32_t arg_count, NPVariant* result);
//////////////////////////////////////////////////////////
- // Implementation of It2MeHost::Observer methods.
+ // Implementation of It2MeImpl::Observer methods.
// Notifies OnStateChanged handler of a state change.
virtual void OnStateChanged(It2MeHostState state) OVERRIDE;
@@ -266,21 +266,21 @@ class HostNPScriptObject : public It2MeHost::Observer {
// It2Me host state.
// Internal implementation of the It2Me host function.
- scoped_refptr<It2MeHost> it2me_host_;
+ scoped_refptr<It2MeImpl> it2me_impl_;
- // Cached, read-only copies of |it2me_host_| session state.
+ // Cached, read-only copies of |it2me_impl_| session state.
It2MeHostState state_;
std::string access_code_;
base::TimeDelta access_code_lifetime_;
std::string client_username_;
- // IT2Me Talk server configuration used by |it2me_host_| to connect.
+ // IT2Me Talk server configuration used by |it2me_impl_| to connect.
XmppSignalStrategy::XmppServerConfig xmpp_server_config_;
- // Chromoting Bot JID used by |it2me_host_| to register the host.
+ // Chromoting Bot JID used by |it2me_impl_| to register the host.
std::string directory_bot_jid_;
- // Callbacks to notify in response to |it2me_host_| events.
+ // Callbacks to notify in response to |it2me_impl_| events.
ScopedRefNPObject on_nat_traversal_policy_changed_func_;
ScopedRefNPObject on_state_changed_func_;
diff --git a/remoting/host/native_messaging/native_messaging_channel.cc b/remoting/host/setup/native_messaging_channel.cc
index 3d4cf60..b93fd94 100644
--- a/remoting/host/native_messaging/native_messaging_channel.cc
+++ b/remoting/host/setup/native_messaging_channel.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/native_messaging/native_messaging_channel.h"
+#include "remoting/host/setup/native_messaging_channel.h"
#include "base/basictypes.h"
#include "base/bind.h"
diff --git a/remoting/host/native_messaging/native_messaging_channel.h b/remoting/host/setup/native_messaging_channel.h
index f597847..9b0c229 100644
--- a/remoting/host/native_messaging/native_messaging_channel.h
+++ b/remoting/host/setup/native_messaging_channel.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_CHANNEL_H_
-#define REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_CHANNEL_H_
+#ifndef REMOTING_HOST_SETUP_NATIVE_MESSAGING_CHANNEL_H_
+#define REMOTING_HOST_SETUP_NATIVE_MESSAGING_CHANNEL_H_
#include "base/callback.h"
#include "base/memory/ref_counted.h"
@@ -11,8 +11,8 @@
#include "base/memory/weak_ptr.h"
#include "base/platform_file.h"
#include "base/threading/non_thread_safe.h"
-#include "remoting/host/native_messaging/native_messaging_reader.h"
-#include "remoting/host/native_messaging/native_messaging_writer.h"
+#include "remoting/host/setup/native_messaging_reader.h"
+#include "remoting/host/setup/native_messaging_writer.h"
namespace base {
class DictionaryValue;
@@ -45,7 +45,7 @@ class NativeMessagingChannel : public base::NonThreadSafe {
};
// Constructs an object taking the ownership of |input| and |output|. Closes
- // |input| and |output| to prevent the caller from using them.
+ // |input| and |output| to prevent the caller frmo using them.
NativeMessagingChannel(
scoped_ptr<Delegate> delegate,
base::PlatformFile input,
@@ -91,4 +91,4 @@ class NativeMessagingChannel : public base::NonThreadSafe {
} // namespace remoting
-#endif // REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_CHANNEL_H_
+#endif // REMOTING_HOST_SETUP_NATIVE_MESSAGING_CHANNEL_H_
diff --git a/remoting/host/setup/me2me_native_messaging_host.cc b/remoting/host/setup/native_messaging_host.cc
index 63297a9..38ecdb1 100644
--- a/remoting/host/setup/me2me_native_messaging_host.cc
+++ b/remoting/host/setup/native_messaging_host.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/setup/me2me_native_messaging_host.h"
+#include "remoting/host/setup/native_messaging_host.h"
#include <string>
diff --git a/remoting/host/setup/me2me_native_messaging_host.h b/remoting/host/setup/native_messaging_host.h
index 179b0fe..4a359d7 100644
--- a/remoting/host/setup/me2me_native_messaging_host.h
+++ b/remoting/host/setup/native_messaging_host.h
@@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef REMOTING_HOST_SETUP_ME2ME_NATIVE_MESSAGING_HOST_H_
-#define REMOTING_HOST_SETUP_ME2ME_NATIVE_MESSAGING_HOST_H_
+#ifndef REMOTING_HOST_SETUP_NATIVE_MESSAGING_HOST_H_
+#define REMOTING_HOST_SETUP_NATIVE_MESSAGING_HOST_H_
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
-#include "remoting/host/native_messaging/native_messaging_channel.h"
#include "remoting/host/setup/daemon_controller.h"
+#include "remoting/host/setup/native_messaging_channel.h"
#include "remoting/host/setup/oauth_client.h"
namespace base {
@@ -155,4 +155,4 @@ int NativeMessagingHostMain();
} // namespace remoting
-#endif // REMOTING_HOST_SETUP_ME2ME_NATIVE_MESSAGING_HOST_H_
+#endif // REMOTING_HOST_SETUP_NATIVE_MESSAGING_HOST_H_
diff --git a/remoting/host/setup/me2me_native_messaging_host_main.cc b/remoting/host/setup/native_messaging_host_main.cc
index e69abfc..d9db325 100644
--- a/remoting/host/setup/me2me_native_messaging_host_main.cc
+++ b/remoting/host/setup/native_messaging_host_main.cc
@@ -5,7 +5,7 @@
#include "base/at_exit.h"
#include "base/command_line.h"
#include "remoting/host/logging.h"
-#include "remoting/host/setup/me2me_native_messaging_host.h"
+#include "remoting/host/setup/native_messaging_host.h"
int main(int argc, char** argv) {
// This object instance is required by Chrome code (such as MessageLoop).
diff --git a/remoting/host/setup/me2me_native_messaging_host_unittest.cc b/remoting/host/setup/native_messaging_host_unittest.cc
index 0d6e700..164b77d 100644
--- a/remoting/host/setup/me2me_native_messaging_host_unittest.cc
+++ b/remoting/host/setup/native_messaging_host_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/setup/me2me_native_messaging_host.h"
+#include "remoting/host/setup/native_messaging_host.h"
#include "base/basictypes.h"
#include "base/compiler_specific.h"
@@ -17,8 +17,8 @@
#include "net/base/file_stream.h"
#include "net/base/net_util.h"
#include "remoting/base/auto_thread_task_runner.h"
-#include "remoting/host/native_messaging/native_messaging_channel.h"
#include "remoting/host/pin_hash.h"
+#include "remoting/host/setup/native_messaging_channel.h"
#include "remoting/host/setup/test_util.h"
#include "remoting/protocol/pairing_registry.h"
#include "remoting/protocol/protocol_mock_objects.h"
diff --git a/remoting/host/setup/me2me_native_messaging_manifest.json b/remoting/host/setup/native_messaging_manifest.json
index d0b2fb1..84884a2 100644
--- a/remoting/host/setup/me2me_native_messaging_manifest.json
+++ b/remoting/host/setup/native_messaging_manifest.json
@@ -2,7 +2,7 @@
"name": "com.google.chrome.remote_desktop",
"description": "{% trans %}REMOTING_HOST_PLUGIN_NAME{% endtrans %}",
"type": "stdio",
- "path": "{{ ME2ME_NATIVE_MESSAGING_HOST_PATH }}",
+ "path": "{{ NATIVE_MESSAGING_HOST_PATH }}",
"allowed_origins": [
"chrome-extension://ljacajndfccfgnfohlgkdphmbnpkjflk/",
"chrome-extension://gbchcmhmhahfdphkhkmpfmihenigjmpp/",
diff --git a/remoting/host/native_messaging/native_messaging_reader.cc b/remoting/host/setup/native_messaging_reader.cc
index 031daf7..7151653 100644
--- a/remoting/host/native_messaging/native_messaging_reader.cc
+++ b/remoting/host/setup/native_messaging_reader.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/native_messaging/native_messaging_reader.h"
+#include "remoting/host/setup/native_messaging_reader.h"
#include <string>
diff --git a/remoting/host/native_messaging/native_messaging_reader.h b/remoting/host/setup/native_messaging_reader.h
index 06eb4cc..b9c81c3 100644
--- a/remoting/host/native_messaging/native_messaging_reader.h
+++ b/remoting/host/setup/native_messaging_reader.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_READER_H_
-#define REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_READER_H_
+#ifndef REMOTING_HOST_SETUP_NATIVE_MESSAGING_READER_H_
+#define REMOTING_HOST_SETUP_NATIVE_MESSAGING_READER_H_
#include "base/basictypes.h"
#include "base/callback.h"
@@ -73,4 +73,4 @@ class NativeMessagingReader {
} // namespace remoting
-#endif // REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_READER_H_
+#endif // REMOTING_HOST_SETUP_NATIVE_MESSAGING_READER_H_
diff --git a/remoting/host/native_messaging/native_messaging_reader_unittest.cc b/remoting/host/setup/native_messaging_reader_unittest.cc
index 26ed78d..c78b4c2 100644
--- a/remoting/host/native_messaging/native_messaging_reader_unittest.cc
+++ b/remoting/host/setup/native_messaging_reader_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/native_messaging/native_messaging_reader.h"
+#include "remoting/host/setup/native_messaging_reader.h"
#include "base/basictypes.h"
#include "base/bind.h"
diff --git a/remoting/host/native_messaging/native_messaging_writer.cc b/remoting/host/setup/native_messaging_writer.cc
index 9788f21..15d6cd7 100644
--- a/remoting/host/native_messaging/native_messaging_writer.cc
+++ b/remoting/host/setup/native_messaging_writer.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/native_messaging/native_messaging_writer.h"
+#include "remoting/host/setup/native_messaging_writer.h"
#include <string>
diff --git a/remoting/host/native_messaging/native_messaging_writer.h b/remoting/host/setup/native_messaging_writer.h
index 6208f91..72e5345 100644
--- a/remoting/host/native_messaging/native_messaging_writer.h
+++ b/remoting/host/setup/native_messaging_writer.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_WRITER_H_
-#define REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_WRITER_H_
+#ifndef REMOTING_HOST_SETUP_NATIVE_MESSAGING_WRITER_H_
+#define REMOTING_HOST_SETUP_NATIVE_MESSAGING_WRITER_H_
#include "base/platform_file.h"
#include "net/base/file_stream.h"
@@ -34,4 +34,4 @@ class NativeMessagingWriter {
} // namespace remoting
-#endif // REMOTING_HOST_NATIVE_MESSAGING_NATIVE_MESSAGING_WRITER_H_
+#endif // REMOTING_HOST_SETUP_NATIVE_MESSAGING_WRITER_H_
diff --git a/remoting/host/native_messaging/native_messaging_writer_unittest.cc b/remoting/host/setup/native_messaging_writer_unittest.cc
index 52bdb1f..c0cfbd1 100644
--- a/remoting/host/native_messaging/native_messaging_writer_unittest.cc
+++ b/remoting/host/setup/native_messaging_writer_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "remoting/host/native_messaging/native_messaging_writer.h"
+#include "remoting/host/setup/native_messaging_writer.h"
#include "base/basictypes.h"
#include "base/json/json_reader.h"
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index 0284b35..4835be6 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -529,23 +529,6 @@
}, # end of target 'remoting_host'
{
- 'target_name': 'remoting_native_messaging_base',
- 'type': 'static_library',
- 'variables': { 'enable_wexit_time_destructors': 1, },
- 'dependencies': [
- '../base/base.gyp:base',
- ],
- 'sources': [
- 'host/native_messaging/native_messaging_channel.cc',
- 'host/native_messaging/native_messaging_channel.h',
- 'host/native_messaging/native_messaging_reader.cc',
- 'host/native_messaging/native_messaging_reader.h',
- 'host/native_messaging/native_messaging_writer.cc',
- 'host/native_messaging/native_messaging_writer.h',
- ],
- }, # end of target 'remoting_native_messaging_base'
-
- {
'target_name': 'remoting_me2me_host_static',
'type': 'static_library',
'variables': { 'enable_wexit_time_destructors': 1, },
@@ -606,8 +589,14 @@
'host/setup/daemon_installer_win.h',
'host/setup/host_starter.cc',
'host/setup/host_starter.h',
- 'host/setup/me2me_native_messaging_host.cc',
- 'host/setup/me2me_native_messaging_host.h',
+ 'host/setup/native_messaging_channel.cc',
+ 'host/setup/native_messaging_channel.h',
+ 'host/setup/native_messaging_host.cc',
+ 'host/setup/native_messaging_host.h',
+ 'host/setup/native_messaging_reader.cc',
+ 'host/setup/native_messaging_reader.h',
+ 'host/setup/native_messaging_writer.cc',
+ 'host/setup/native_messaging_writer.h',
'host/setup/oauth_client.cc',
'host/setup/oauth_client.h',
'host/setup/oauth_helper.cc',
@@ -759,8 +748,8 @@
'remoting_resources',
],
'sources': [
- 'host/it2me/it2me_host.cc',
- 'host/it2me/it2me_host.h',
+ 'host/it2me/it2me_impl.cc',
+ 'host/it2me/it2me_impl.h',
],
}, # end of target 'remoting_it2me_host_static'
{
@@ -910,8 +899,7 @@
'dependencies': [
'remoting_me2me_host',
'remoting_start_host',
- 'remoting_me2me_native_messaging_host',
- 'remoting_me2me_native_messaging_manifest',
+ 'remoting_native_messaging_host',
],
'actions': [
{
@@ -1033,7 +1021,7 @@
], # end of 'conditions'
}, # end of target 'remoting_me2me_host'
{
- 'target_name': 'remoting_me2me_native_messaging_host',
+ 'target_name': 'remoting_native_messaging_host',
'type': 'executable',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [
@@ -1041,10 +1029,13 @@
'remoting_host',
'remoting_host_logging',
'remoting_host_setup_base',
- 'remoting_native_messaging_base',
+ 'remoting_native_messaging_manifest',
+ ],
+ 'defines': [
+ 'VERSION=<(version_full)',
],
'sources': [
- 'host/setup/me2me_native_messaging_host_main.cc',
+ 'host/setup/native_messaging_host_main.cc',
],
'conditions': [
['OS=="linux" and linux_use_tcmalloc==1', {
@@ -1053,7 +1044,7 @@
],
}],
],
- }, # end of target 'remoting_me2me_native_messaging_host'
+ }, # end of target 'remoting_native_messaging_host'
], # end of 'targets'
}], # 'OS!="win" and enable_remoting_host==1'
@@ -1167,8 +1158,7 @@
'remoting_host_prefpane',
'remoting_host_uninstaller',
'remoting_me2me_host',
- 'remoting_me2me_native_messaging_host',
- 'remoting_me2me_native_messaging_manifest',
+ 'remoting_native_messaging_host',
],
'variables': {
'host_name': '<!(python <(version_py_path) -f <(branding_path) -t "@HOST_PLUGIN_FILE_NAME@")',
@@ -1198,7 +1188,7 @@
'PrivilegedHelperTools/org.chromium.chromoting.me2me_host.app',
'Applications/<(host_uninstaller_name).app',
'PrivilegedHelperTools/org.chromium.chromoting.me2me_host.app/Contents/MacOS/native_messaging_host',
- 'Config/com.google.chrome.remote_desktop.json',
+ 'Config/com.google.chrome.remote_desktop.json',
],
'source_files': [
'<@(remoting_host_installer_mac_files)',
@@ -1546,7 +1536,6 @@
'remoting_lib_ps',
'remoting_lib_rc',
'remoting_me2me_host_static',
- 'remoting_native_messaging_base',
'remoting_protocol',
'remoting_version_resources',
],
@@ -1581,7 +1570,6 @@
'host/remoting_me2me_host.cc',
'host/sas_injector.h',
'host/sas_injector_win.cc',
- 'host/setup/me2me_native_messaging_host_main.cc',
'host/verify_config_window_win.cc',
'host/verify_config_window_win.h',
'host/win/chromoting_module.cc',
@@ -1976,7 +1964,7 @@
'remoting_core',
'remoting_desktop',
'remoting_host_exe',
- 'remoting_me2me_native_messaging_manifest',
+ 'remoting_native_messaging_manifest',
],
'compiled_inputs': [
'<(PRODUCT_DIR)/remoting_core.dll',
@@ -2333,16 +2321,16 @@
],
}, # end of target 'remoting_webapp'
- # Generates 'me2me_native_messaging_manifest.json' to be included in the
+ # Generates 'native_messaging_manifest.json' to be included in the
# installation.
{
- 'target_name': 'remoting_me2me_native_messaging_manifest',
+ 'target_name': 'remoting_native_messaging_manifest',
'type': 'none',
'dependencies': [
'remoting_resources',
],
'variables': {
- 'input': 'host/setup/me2me_native_messaging_manifest.json',
+ 'input': 'host/setup/native_messaging_manifest.json',
'output': '<(PRODUCT_DIR)/remoting/com.google.chrome.remote_desktop.json',
},
'target_conditions': [
@@ -2350,19 +2338,19 @@
'conditions': [
[ 'OS == "win"', {
'variables': {
- 'me2me_native_messaging_host_path': 'remoting_host.exe',
+ 'native_messaging_host_path': 'remoting_host.exe',
},
}], [ 'OS == "mac"', {
'variables': {
- 'me2me_native_messaging_host_path': '/Library/PrivilegedHelperTools/org.chromium.chromoting.me2me_host.app/Contents/MacOS/native_messaging_host',
+ 'native_messaging_host_path': '/Library/PrivilegedHelperTools/org.chromium.chromoting.me2me_host.app/Contents/MacOS/native_messaging_host',
},
}], ['OS == "linux"', {
'variables': {
- 'me2me_native_messaging_host_path': '/opt/google/chrome-remote-desktop/native-messaging-host',
+ 'native_messaging_host_path': '/opt/google/chrome-remote-desktop/native-messaging-host',
},
}], ['OS != "linux" and OS != "mac" and OS != "win"', {
'variables': {
- 'me2me_native_messaging_host_path': '/opt/google/chrome-remote-desktop/native-messaging-host',
+ 'native_messaging_host_path': '/opt/google/chrome-remote-desktop/native-messaging-host',
},
}],
], # conditions
@@ -2379,7 +2367,7 @@
'action': [
'python',
'<(remoting_localize_path)',
- '--define', 'ME2ME_NATIVE_MESSAGING_HOST_PATH=<(me2me_native_messaging_host_path)',
+ '--define', 'NATIVE_MESSAGING_HOST_PATH=<(native_messaging_host_path)',
'--locale_dir', '<(webapp_locale_dir)',
'--template', '<(input)',
'--locale_output',
@@ -2392,7 +2380,7 @@
},
],
], # target_conditions
- }, # end of target 'remoting_me2me_native_messaging_manifest'
+ }, # end of target 'remoting_native_messaging_manifest'
{
'target_name': 'remoting_resources',
'type': 'none',
@@ -2799,7 +2787,6 @@
'remoting_host_event_logger',
'remoting_host_setup_base',
'remoting_jingle_glue',
- 'remoting_native_messaging_base',
'remoting_protocol',
'remoting_resources',
'../third_party/webrtc/modules/modules.gyp:desktop_capture',
@@ -2864,8 +2851,6 @@
'host/linux/x_server_clipboard_unittest.cc',
'host/local_input_monitor_unittest.cc',
'host/log_to_server_unittest.cc',
- 'host/native_messaging/native_messaging_reader_unittest.cc',
- 'host/native_messaging/native_messaging_writer_unittest.cc',
'host/pairing_registry_delegate_linux_unittest.cc',
'host/pairing_registry_delegate_win_unittest.cc',
'host/pin_hash_unittest.cc',
@@ -2881,7 +2866,9 @@
'host/screen_capturer_fake.h',
'host/screen_resolution_unittest.cc',
'host/server_log_entry_unittest.cc',
- 'host/setup/me2me_native_messaging_host_unittest.cc',
+ 'host/setup/native_messaging_host_unittest.cc',
+ 'host/setup/native_messaging_reader_unittest.cc',
+ 'host/setup/native_messaging_writer_unittest.cc',
'host/setup/oauth_helper_unittest.cc',
'host/setup/pin_validator_unittest.cc',
'host/token_validator_factory_impl_unittest.cc',
@@ -2984,7 +2971,6 @@
'dependencies!': [
'remoting_host',
'remoting_host_setup_base',
- 'remoting_native_messaging_base',
],
'sources/': [
['exclude', 'codec/*'],