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

Unified Diff: remoting/host/policy_hack/policy_watcher.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.h ('k') | remoting/host/policy_hack/policy_watcher_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/policy_hack/policy_watcher.cc
diff --git a/remoting/host/policy_hack/policy_watcher.cc b/remoting/host/policy_hack/policy_watcher.cc
index e603cf5032459caaea20f88d40671df5d4aaa0cc..8e30c241ae98da24b25d1da2d87a6db6c3dabfcd 100644
--- a/remoting/host/policy_hack/policy_watcher.cc
+++ b/remoting/host/policy_hack/policy_watcher.cc
@@ -12,7 +12,6 @@
#include "base/location.h"
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
-#include "base/synchronization/waitable_event.h"
#include "base/time/time.h"
#include "base/values.h"
#include "remoting/host/dns_blackhole_checker.h"
@@ -165,19 +164,17 @@ void PolicyWatcher::StartWatching(const PolicyCallback& policy_callback) {
StartWatchingInternal();
}
-void PolicyWatcher::StopWatching(base::WaitableEvent* done) {
- if (!OnPolicyWatcherThread()) {
- task_runner_->PostTask(FROM_HERE,
- base::Bind(&PolicyWatcher::StopWatching,
- base::Unretained(this), done));
- return;
- }
+void PolicyWatcher::StopWatching(const base::Closure& stopped_callback) {
+ task_runner_->PostTaskAndReply(
+ FROM_HERE, base::Bind(&PolicyWatcher::StopWatchingOnPolicyWatcherThread,
+ base::Unretained(this)),
+ stopped_callback);
+}
+void PolicyWatcher::StopWatchingOnPolicyWatcherThread() {
StopWatchingInternal();
weak_factory_.InvalidateWeakPtrs();
policy_callback_.Reset();
-
- done->Signal();
}
void PolicyWatcher::ScheduleFallbackReloadTask() {
« no previous file with comments | « remoting/host/policy_hack/policy_watcher.h ('k') | remoting/host/policy_hack/policy_watcher_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698