Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(853)

Unified Diff: remoting/host/it2me/it2me_native_messaging_host.h

Issue 637463002: Revert "Remote Assistance on Chrome OS Part III - NativeMessageHost" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/host/it2me/it2me_native_messaging_host.h
diff --git a/remoting/host/it2me/it2me_native_messaging_host.h b/remoting/host/it2me/it2me_native_messaging_host.h
index 18e738bc46ace83c9a6b40a45638a7735c9e559d..f9d8ac9753f97230cf674ddf86c340bf07972431 100644
--- a/remoting/host/it2me/it2me_native_messaging_host.h
+++ b/remoting/host/it2me/it2me_native_messaging_host.h
@@ -8,38 +8,40 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
-#include "extensions/browser/api/messaging/native_message_host.h"
+#include "extensions/browser/api/messaging/native_messaging_channel.h"
#include "remoting/base/auto_thread_task_runner.h"
#include "remoting/host/it2me/it2me_host.h"
namespace base {
class DictionaryValue;
-class Value;
} // namespace base
namespace remoting {
// Implementation of the native messaging host process.
-class It2MeNativeMessagingHost : public It2MeHost::Observer,
- public extensions::NativeMessageHost {
+class It2MeNativeMessagingHost
+ : public It2MeHost::Observer,
+ public extensions::NativeMessagingChannel::EventHandler {
public:
- It2MeNativeMessagingHost(scoped_refptr<AutoThreadTaskRunner> task_runner,
- scoped_ptr<It2MeHostFactory> factory);
+ It2MeNativeMessagingHost(
+ scoped_refptr<AutoThreadTaskRunner> task_runner,
+ scoped_ptr<extensions::NativeMessagingChannel> channel,
+ scoped_ptr<It2MeHostFactory> factory);
virtual ~It2MeNativeMessagingHost();
- // extensions::NativeMessageHost implementation.
- virtual void OnMessage(const std::string& message) override;
- virtual void Start(Client* client) override;
- virtual scoped_refptr<base::SingleThreadTaskRunner> task_runner()
- const override;
+ void Start(const base::Closure& quit_closure);
+
+ // extensions::NativeMessagingChannel::EventHandler implementation.
+ virtual void OnMessage(scoped_ptr<base::Value> message) OVERRIDE;
+ virtual void OnDisconnect() OVERRIDE;
// It2MeHost::Observer implementation.
virtual void OnClientAuthenticated(const std::string& client_username)
- override;
+ OVERRIDE;
virtual void OnStoreAccessCode(const std::string& access_code,
- base::TimeDelta access_code_lifetime) override;
- virtual void OnNatPolicyChanged(bool nat_traversal_enabled) override;
- virtual void OnStateChanged(It2MeHostState state) override;
+ base::TimeDelta access_code_lifetime) OVERRIDE;
+ virtual void OnNatPolicyChanged(bool nat_traversal_enabled) OVERRIDE;
+ virtual void OnStateChanged(It2MeHostState state) OVERRIDE;
static std::string HostStateToString(It2MeHostState host_state);
@@ -55,9 +57,12 @@ class It2MeNativeMessagingHost : public It2MeHost::Observer,
scoped_ptr<base::DictionaryValue> response);
void SendErrorAndExit(scoped_ptr<base::DictionaryValue> response,
const std::string& description) const;
- void SendMessageToClient(scoped_ptr<base::DictionaryValue> message) const;
- Client* client_;
+ base::Closure quit_closure_;
+
+ scoped_refptr<AutoThreadTaskRunner> task_runner() const;
+
+ scoped_ptr<extensions::NativeMessagingChannel> channel_;
scoped_ptr<It2MeHostFactory> factory_;
scoped_ptr<ChromotingHostContext> host_context_;
scoped_refptr<It2MeHost> it2me_host_;

Powered by Google App Engine
This is Rietveld 408576698