| 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..944ecd9c304fa06088003a27af4ea12414f1617b 100644
|
| --- a/remoting/host/it2me/it2me_native_messaging_host.h
|
| +++ b/remoting/host/it2me/it2me_native_messaging_host.h
|
| @@ -23,8 +23,11 @@ namespace remoting {
|
| class It2MeNativeMessagingHost : public It2MeHost::Observer,
|
| public extensions::NativeMessageHost {
|
| public:
|
| - It2MeNativeMessagingHost(scoped_refptr<AutoThreadTaskRunner> task_runner,
|
| - scoped_ptr<It2MeHostFactory> factory);
|
| + static scoped_ptr<NativeMessageHost> Create();
|
| +
|
| + It2MeNativeMessagingHost(
|
| + scoped_refptr<ChromotingHostContext> context,
|
| + scoped_ptr<It2MeHostFactory> factory);
|
| virtual ~It2MeNativeMessagingHost();
|
|
|
| // extensions::NativeMessageHost implementation.
|
| @@ -44,6 +47,9 @@ class It2MeNativeMessagingHost : public It2MeHost::Observer,
|
| static std::string HostStateToString(It2MeHostState host_state);
|
|
|
| private:
|
| + // Called by the |host_context_| when it is initialized.
|
| + void OnContextInitialized();
|
| +
|
| // 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).
|
| @@ -59,8 +65,9 @@ class It2MeNativeMessagingHost : public It2MeHost::Observer,
|
|
|
| Client* client_;
|
| scoped_ptr<It2MeHostFactory> factory_;
|
| - scoped_ptr<ChromotingHostContext> host_context_;
|
| + scoped_refptr<ChromotingHostContext> host_context_;
|
| scoped_refptr<It2MeHost> it2me_host_;
|
| + std::vector<std::string> pending_messages_;
|
|
|
| // Cached, read-only copies of |it2me_host_| session state.
|
| It2MeHostState state_;
|
| @@ -74,6 +81,8 @@ class It2MeNativeMessagingHost : public It2MeHost::Observer,
|
| // Chromoting Bot JID used by |it2me_host_| to register the host.
|
| std::string directory_bot_jid_;
|
|
|
| + scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
|
| +
|
| base::WeakPtr<It2MeNativeMessagingHost> weak_ptr_;
|
| base::WeakPtrFactory<It2MeNativeMessagingHost> weak_factory_;
|
|
|
|
|