summaryrefslogtreecommitdiffstats
path: root/remoting/host/remoting_me2me_host.cc
diff options
context:
space:
mode:
authorkelvinp <kelvinp@chromium.org>2014-10-30 14:46:16 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-30 21:46:48 +0000
commit561074cfd46c253dcdc456fdc63693aff4d1be32 (patch)
treea943021c67127b2abfbd5bcc73c4f93e143e9514 /remoting/host/remoting_me2me_host.cc
parentd5587416cd28f2449ec86fa2f23e0f1de04878cc (diff)
downloadchromium_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/remoting_me2me_host.cc')
-rw-r--r--remoting/host/remoting_me2me_host.cc30
1 files changed, 16 insertions, 14 deletions
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 444d5ab..f880803 100644
--- a/remoting/host/remoting_me2me_host.cc
+++ b/remoting/host/remoting_me2me_host.cc
@@ -19,7 +19,6 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h"
#include "build/build_config.h"
#include "crypto/nss_util.h"
@@ -260,6 +259,8 @@ class HostProcess
void ShutdownOnNetworkThread();
+ void OnPolicyWatcherShutdown();
+
// Crashes the process in response to a daemon's request. The daemon passes
// the location of the code that detected the fatal error resulted in this
// request.
@@ -524,8 +525,8 @@ void HostProcess::OnConfigUpdated(
// already loaded so PolicyWatcher has to be started here. Separate policy
// loading from policy verifications and move |policy_watcher_|
// initialization to StartOnNetworkThread().
- policy_watcher_.reset(
- policy_hack::PolicyWatcher::Create(context_->file_task_runner()));
+ policy_watcher_ = policy_hack::PolicyWatcher::Create(
+ nullptr, context_->network_task_runner());
policy_watcher_->StartWatching(
base::Bind(&HostProcess::OnPolicyUpdate, base::Unretained(this)));
} else {
@@ -1411,24 +1412,25 @@ void HostProcess::ShutdownOnNetworkThread() {
state_ = HOST_STOPPED;
if (policy_watcher_.get()) {
- base::WaitableEvent done_event(true, false);
- policy_watcher_->StopWatching(&done_event);
- done_event.Wait();
- policy_watcher_.reset();
+ policy_watcher_->StopWatching(
+ base::Bind(&HostProcess::OnPolicyWatcherShutdown, this));
+ } else {
+ OnPolicyWatcherShutdown();
}
-
- config_watcher_.reset();
-
- // Complete the rest of shutdown on the main thread.
- context_->ui_task_runner()->PostTask(
- FROM_HERE,
- base::Bind(&HostProcess::ShutdownOnUiThread, this));
} else {
// This method is only called in STOPPING_TO_RESTART and STOPPING states.
NOTREACHED();
}
}
+void HostProcess::OnPolicyWatcherShutdown() {
+ policy_watcher_.reset();
+
+ // Complete the rest of shutdown on the main thread.
+ context_->ui_task_runner()->PostTask(
+ FROM_HERE, base::Bind(&HostProcess::ShutdownOnUiThread, this));
+}
+
void HostProcess::OnCrash(const std::string& function_name,
const std::string& file_name,
const int& line_number) {