| Index: remoting/host/it2me/it2me_native_messaging_host.cc
|
| diff --git a/remoting/host/it2me/it2me_native_messaging_host.cc b/remoting/host/it2me/it2me_native_messaging_host.cc
|
| index 93286b352c9371802553d18287095285f2166fb4..24ddc1b8dc38c72475555f4c0dbc00ea915aa62d 100644
|
| --- a/remoting/host/it2me/it2me_native_messaging_host.cc
|
| +++ b/remoting/host/it2me/it2me_native_messaging_host.cc
|
| @@ -15,9 +15,8 @@
|
| #include "base/strings/stringize_macros.h"
|
| #include "base/threading/thread.h"
|
| #include "base/values.h"
|
| -#include "media/base/media.h"
|
| #include "net/base/net_util.h"
|
| -#include "net/url_request/url_request_context_getter.h"
|
| +#include "net/url_request/url_fetcher.h"
|
| #include "remoting/base/auth_token_util.h"
|
| #include "remoting/base/service_urls.h"
|
| #include "remoting/host/chromoting_host_context.h"
|
| @@ -36,22 +35,23 @@
|
| {kConnected, "CONNECTED"},
|
| {kDisconnecting, "DISCONNECTING"},
|
| {kError, "ERROR"},
|
| - {kInvalidDomainError, "INVALID_DOMAIN_ERROR"},
|
| -};
|
| + {kInvalidDomainError, "INVALID_DOMAIN_ERROR"}, };
|
|
|
| } // namespace
|
|
|
| It2MeNativeMessagingHost::It2MeNativeMessagingHost(
|
| - scoped_ptr<ChromotingHostContext> context,
|
| + scoped_refptr<AutoThreadTaskRunner> task_runner,
|
| scoped_ptr<It2MeHostFactory> factory)
|
| : client_(NULL),
|
| - host_context_(context.Pass()),
|
| factory_(factory.Pass()),
|
| weak_factory_(this) {
|
| weak_ptr_ = weak_factory_.GetWeakPtr();
|
|
|
| - // Ensures runtime specific CPU features are initialized.
|
| - media::InitializeCPUSpecificMediaFeatures();
|
| + // Initialize the host context to manage the threads for the it2me host.
|
| + // The native messaging host, rather than the It2MeHost object, owns and
|
| + // maintains the lifetime of the host context.
|
| +
|
| + host_context_.reset(ChromotingHostContext::Create(task_runner).release());
|
|
|
| const ServiceUrls* service_urls = ServiceUrls::GetInstance();
|
| const bool xmpp_server_valid =
|
| @@ -203,7 +203,8 @@
|
| #endif // !defined(NDEBUG)
|
|
|
| // Create the It2Me host and start connecting.
|
| - it2me_host_ = factory_->CreateIt2MeHost(host_context_->Copy(),
|
| + it2me_host_ = factory_->CreateIt2MeHost(host_context_.get(),
|
| + host_context_->ui_task_runner(),
|
| weak_ptr_,
|
| xmpp_config,
|
| directory_bot_jid_);
|
|
|