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

Unified Diff: remoting/host/remoting_me2me_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
« no previous file with comments | « remoting/host/policy_hack/policy_watcher_win.cc ('k') | remoting/remoting_host.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/remoting_me2me_host.cc
diff --git a/remoting/host/remoting_me2me_host.cc b/remoting/host/remoting_me2me_host.cc
index 444d5aba3219f776eb867d9192663162ccd34c48..f880803c2c3388a96b66652c85f1ad8c4df16951 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) {
« no previous file with comments | « remoting/host/policy_hack/policy_watcher_win.cc ('k') | remoting/remoting_host.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698