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

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

Issue 103693006: Me2me Native Messaging host on Windows: restructure NativeMessagingHost and NativeMessagingChannel.… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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 dbf7fc428a21b1b9d14aa026d92cd8ab650293b4..e0fd8022620f11615cc8708052967e07fbc1490b 100644
--- a/remoting/host/it2me/it2me_native_messaging_host.h
+++ b/remoting/host/it2me/it2me_native_messaging_host.h
@@ -19,20 +19,17 @@ class DictionaryValue;
namespace remoting {
// Implementation of the native messaging host process.
-class It2MeNativeMessagingHost : public NativeMessagingChannel::Delegate,
- public It2MeHost::Observer {
+class It2MeNativeMessagingHost : public It2MeHost::Observer {
public:
typedef NativeMessagingChannel::SendMessageCallback SendMessageCallback;
- It2MeNativeMessagingHost(scoped_refptr<AutoThreadTaskRunner> task_runner,
- scoped_ptr<It2MeHostFactory> factory);
+ It2MeNativeMessagingHost(
+ scoped_refptr<AutoThreadTaskRunner> task_runner,
+ scoped_ptr<NativeMessagingChannel> channel,
+ scoped_ptr<It2MeHostFactory> factory);
virtual ~It2MeNativeMessagingHost();
- // NativeMessagingChannel::Delegate interface.
- virtual void SetSendMessageCallback(const SendMessageCallback& send_message)
- OVERRIDE;
- virtual void ProcessMessage(scoped_ptr<base::DictionaryValue> message)
- OVERRIDE;
+ void Start(const base::Closure& quit_closure);
// It2MeHost::Observer implementation
virtual void OnClientAuthenticated(const std::string& client_username)
@@ -42,15 +39,11 @@ class It2MeNativeMessagingHost : public NativeMessagingChannel::Delegate,
virtual void OnNatPolicyChanged(bool nat_traversal_enabled) OVERRIDE;
virtual void OnStateChanged(It2MeHostState state) OVERRIDE;
- static void ShutDownHost(NativeMessagingChannel::Delegate* delegate) {
- It2MeNativeMessagingHost* host =
- static_cast<It2MeNativeMessagingHost*>(delegate);
- host->ShutDown();
- }
-
static std::string HostStateToString(It2MeHostState host_state);
private:
+ void ProcessMessage(scoped_ptr<base::DictionaryValue> message);
+
// These "Process.." methods handle specific request types. The |response|
// dictionary is pre-filled by ProcessMessage() with the parts of the
// response already known ("id" and "type" fields).
@@ -65,12 +58,10 @@ class It2MeNativeMessagingHost : public NativeMessagingChannel::Delegate,
scoped_refptr<AutoThreadTaskRunner> task_runner();
- void ShutDown();
-
+ scoped_ptr<NativeMessagingChannel> channel_;
scoped_ptr<It2MeHostFactory> factory_;
scoped_ptr<ChromotingHostContext> host_context_;
scoped_refptr<It2MeHost> it2me_host_;
- SendMessageCallback send_message_;
// Cached, read-only copies of |it2me_host_| session state.
It2MeHostState state_;

Powered by Google App Engine
This is Rietveld 408576698