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

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

Issue 639233002: Remote assistance on Chrome OS Part IV - It2MeHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build error on ozone Created 6 years, 2 months 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.cc
diff --git a/remoting/host/it2me/it2me_native_messaging_host.cc b/remoting/host/it2me/it2me_native_messaging_host.cc
index 24ddc1b8dc38c72475555f4c0dbc00ea915aa62d..93286b352c9371802553d18287095285f2166fb4 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_);
« no previous file with comments | « remoting/host/it2me/it2me_native_messaging_host.h ('k') | remoting/host/it2me/it2me_native_messaging_host_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698