diff options
author | kelvinp <kelvinp@chromium.org> | 2014-10-30 14:46:16 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-30 21:46:48 +0000 |
commit | 561074cfd46c253dcdc456fdc63693aff4d1be32 (patch) | |
tree | a943021c67127b2abfbd5bcc73c4f93e143e9514 /remoting/host/it2me/it2me_native_messaging_host.cc | |
parent | d5587416cd28f2449ec86fa2f23e0f1de04878cc (diff) | |
download | chromium_src-561074cfd46c253dcdc456fdc63693aff4d1be32.zip chromium_src-561074cfd46c253dcdc456fdc63693aff4d1be32.tar.gz chromium_src-561074cfd46c253dcdc456fdc63693aff4d1be32.tar.bz2 |
Remote assistance on Chrome OS Part IV - It2MeHost
This CL links the it2me host to the Chrome binary on ChromeOS
behind a flag.
The following changes are made to the it2me host so that it can be run in the browser process.
1. Initializes SSL server sockets and specific CPU media features on ChromeOS startup.
2. Fixes a crash in it2me shutdown by making It2meHost owns the ChromotingHostContext.
3. Replace the blocking shutdown wait on PolicyWatcher with a callback.
Implements policy_watcher on ChromeOS using policy services.
4. Re-use existing threads, url request context getters and policy service on ChromeOS.
5. Fixed a incorrect DCHECK regarding the color format of the frames captured on ChromeOS.
BUG=334087
Committed: https://crrev.com/54dde6f02d121ff745e66b57205583087ff720ec
Cr-Commit-Position: refs/heads/master@{#302034}
Review URL: https://codereview.chromium.org/639233002
Cr-Commit-Position: refs/heads/master@{#302162}
Diffstat (limited to 'remoting/host/it2me/it2me_native_messaging_host.cc')
-rw-r--r-- | remoting/host/it2me/it2me_native_messaging_host.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/remoting/host/it2me/it2me_native_messaging_host.cc b/remoting/host/it2me/it2me_native_messaging_host.cc index 24ddc1b..93286b3 100644 --- a/remoting/host/it2me/it2me_native_messaging_host.cc +++ b/remoting/host/it2me/it2me_native_messaging_host.cc @@ -15,8 +15,9 @@ #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_fetcher.h" +#include "net/url_request/url_request_context_getter.h" #include "remoting/base/auth_token_util.h" #include "remoting/base/service_urls.h" #include "remoting/host/chromoting_host_context.h" @@ -35,23 +36,22 @@ const remoting::protocol::NameMapElement<It2MeHostState> kIt2MeHostStates[] = { {kConnected, "CONNECTED"}, {kDisconnecting, "DISCONNECTING"}, {kError, "ERROR"}, - {kInvalidDomainError, "INVALID_DOMAIN_ERROR"}, }; + {kInvalidDomainError, "INVALID_DOMAIN_ERROR"}, +}; } // namespace It2MeNativeMessagingHost::It2MeNativeMessagingHost( - scoped_refptr<AutoThreadTaskRunner> task_runner, + scoped_ptr<ChromotingHostContext> context, scoped_ptr<It2MeHostFactory> factory) : client_(NULL), + host_context_(context.Pass()), factory_(factory.Pass()), weak_factory_(this) { weak_ptr_ = weak_factory_.GetWeakPtr(); - // 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()); + // Ensures runtime specific CPU features are initialized. + media::InitializeCPUSpecificMediaFeatures(); const ServiceUrls* service_urls = ServiceUrls::GetInstance(); const bool xmpp_server_valid = @@ -203,8 +203,7 @@ void It2MeNativeMessagingHost::ProcessConnect( #endif // !defined(NDEBUG) // Create the It2Me host and start connecting. - it2me_host_ = factory_->CreateIt2MeHost(host_context_.get(), - host_context_->ui_task_runner(), + it2me_host_ = factory_->CreateIt2MeHost(host_context_->Copy(), weak_ptr_, xmpp_config, directory_bot_jid_); |