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

Unified Diff: remoting/host/policy_hack/policy_watcher.cc

Issue 746723002: Revert of Reporting of policy errors via host-offline-reason: part 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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_linux.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 d0f59572c31ed2480d409bea355a8b5e68d89515..8e30c241ae98da24b25d1da2d87a6db6c3dabfcd 100644
--- a/remoting/host/policy_hack/policy_watcher.cc
+++ b/remoting/host/policy_hack/policy_watcher.cc
@@ -118,7 +118,6 @@
PolicyWatcher::PolicyWatcher(
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: task_runner_(task_runner),
- transient_policy_error_retry_counter_(0),
old_policies_(new base::DictionaryValue()),
default_values_(new base::DictionaryValue()),
weak_factory_(this) {
@@ -152,20 +151,16 @@
PolicyWatcher::~PolicyWatcher() {
}
-void PolicyWatcher::StartWatching(
- const PolicyUpdatedCallback& policy_updated_callback,
- const PolicyErrorCallback& policy_error_callback) {
+void PolicyWatcher::StartWatching(const PolicyCallback& policy_callback) {
if (!OnPolicyWatcherThread()) {
task_runner_->PostTask(FROM_HERE,
base::Bind(&PolicyWatcher::StartWatching,
base::Unretained(this),
- policy_updated_callback,
- policy_error_callback));
+ policy_callback));
return;
}
- policy_updated_callback_ = policy_updated_callback;
- policy_error_callback_ = policy_error_callback;
+ policy_callback_ = policy_callback;
StartWatchingInternal();
}
@@ -179,8 +174,7 @@
void PolicyWatcher::StopWatchingOnPolicyWatcherThread() {
StopWatchingInternal();
weak_factory_.InvalidateWeakPtrs();
- policy_updated_callback_.Reset();
- policy_error_callback_.Reset();
+ policy_callback_.Reset();
}
void PolicyWatcher::ScheduleFallbackReloadTask() {
@@ -208,8 +202,6 @@
void PolicyWatcher::UpdatePolicies(
const base::DictionaryValue* new_policies_raw) {
DCHECK(OnPolicyWatcherThread());
-
- transient_policy_error_retry_counter_ = 0;
// Use default values for any missing policies.
scoped_ptr<base::DictionaryValue> new_policies =
@@ -234,20 +226,7 @@
// Notify our client of the changed policies.
if (!changed_policies->empty()) {
- policy_updated_callback_.Run(changed_policies.Pass());
- }
-}
-
-void PolicyWatcher::SignalPolicyError() {
- transient_policy_error_retry_counter_ = 0;
- policy_error_callback_.Run();
-}
-
-void PolicyWatcher::SignalTransientPolicyError() {
- const int kMaxRetryCount = 5;
- transient_policy_error_retry_counter_ += 1;
- if (transient_policy_error_retry_counter_ >= kMaxRetryCount) {
- SignalPolicyError();
+ policy_callback_.Run(changed_policies.Pass());
}
}
« no previous file with comments | « remoting/host/policy_hack/policy_watcher.h ('k') | remoting/host/policy_hack/policy_watcher_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698