Chromium Code Reviews| 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..4d567a6f3eb2f7c5c735c75b065c2237b60a14c8 100644 |
| --- a/remoting/host/it2me/it2me_native_messaging_host.h |
| +++ b/remoting/host/it2me/it2me_native_messaging_host.h |
| @@ -19,8 +19,7 @@ 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; |
| @@ -28,11 +27,12 @@ class It2MeNativeMessagingHost : public NativeMessagingChannel::Delegate, |
| 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( |
| + base::PlatformFile input, |
|
Sergey Ulanov
2013/12/12 19:10:28
would it be better to pass the Channel object here
weitao
2013/12/12 23:33:48
Done.
|
| + base::PlatformFile output, |
| + const base::Closure& quit_closure); |
| + |
| + void ShutDown(); |
| // It2MeHost::Observer implementation |
| virtual void OnClientAuthenticated(const std::string& client_username) |
| @@ -42,15 +42,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 +61,11 @@ class It2MeNativeMessagingHost : public NativeMessagingChannel::Delegate, |
| scoped_refptr<AutoThreadTaskRunner> task_runner(); |
| - void ShutDown(); |
| - |
| + base::Closure quit_closure_; |
| + 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_; |