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

Unified Diff: chrome/browser/chromeos/attestation/attestation_policy_observer.h

Issue 18053006: Added retry support to AttestationPolicyObserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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: chrome/browser/chromeos/attestation/attestation_policy_observer.h
diff --git a/chrome/browser/chromeos/attestation/attestation_policy_observer.h b/chrome/browser/chromeos/attestation/attestation_policy_observer.h
index 1ae4e50861c56daf60cd0bb2b99f23cb23d730f9..29c33555f411b191ba5fa571ceaadad4c0e87402 100644
--- a/chrome/browser/chromeos/attestation/attestation_policy_observer.h
+++ b/chrome/browser/chromeos/attestation/attestation_policy_observer.h
@@ -50,6 +50,11 @@ class AttestationPolicyObserver : public content::NotificationObserver {
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // Sets the retry delay in seconds; useful in testing.
+ void set_retry_delay(int retry_delay) {
+ retry_delay_ = retry_delay;
+ }
+
private:
// Checks attestation policy and starts any necessary work.
void Start();
@@ -80,11 +85,16 @@ class AttestationPolicyObserver : public content::NotificationObserver {
// Marks a key as uploaded in the payload proto.
void MarkAsUploaded(const std::string& key_payload);
+ // Reschedules a policy check (i.e. a call to Start) for a later time.
+ void Reschedule();
+
CrosSettings* cros_settings_;
policy::CloudPolicyClient* policy_client_;
CryptohomeClient* cryptohome_client_;
AttestationFlow* attestation_flow_;
scoped_ptr<AttestationFlow> default_attestation_flow_;
+ int num_retries_;
+ int retry_delay_;
// Note: This should remain the last member so it'll be destroyed and
// invalidate the weak pointers before any other members are destroyed.

Powered by Google App Engine
This is Rietveld 408576698