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

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

Issue 686373002: Revert of Remote assistance on Chrome OS Part IV - It2MeHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 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_);
« 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