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

Unified Diff: chrome/browser/chromeos/policy/device_cloud_policy_invalidator.cc

Issue 460573005: Pass highest handled invalidation version between invalidators (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed nits. Created 6 years, 4 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/policy/device_cloud_policy_invalidator.cc
diff --git a/chrome/browser/chromeos/policy/device_cloud_policy_invalidator.cc b/chrome/browser/chromeos/policy/device_cloud_policy_invalidator.cc
index 32070c0da837aca279ee3605a8d50071f1025f4c..229908d1235b941c640b6fbd9ad1854124b2bb80 100644
--- a/chrome/browser/chromeos/policy/device_cloud_policy_invalidator.cc
+++ b/chrome/browser/chromeos/policy/device_cloud_policy_invalidator.cc
@@ -118,7 +118,8 @@ std::string DeviceCloudPolicyInvalidator::InvalidationServiceObserver::
}
DeviceCloudPolicyInvalidator::DeviceCloudPolicyInvalidator()
- : invalidation_service_(NULL) {
+ : invalidation_service_(NULL),
+ highest_handled_invalidation_version_(0) {
// The DeviceCloudPolicyInvalidator should be created before any user
// Profiles.
DCHECK(g_browser_process->profile_manager()->GetLoadedProfiles().empty());
@@ -251,18 +252,23 @@ void DeviceCloudPolicyInvalidator::TryToCreateInvalidator() {
void DeviceCloudPolicyInvalidator::CreateInvalidator(
invalidation::InvalidationService* invalidation_service) {
invalidation_service_ = invalidation_service;
+ DCHECK(!invalidator_);
invalidator_.reset(new CloudPolicyInvalidator(
enterprise_management::DeviceRegisterRequest::DEVICE,
g_browser_process->platform_part()->browser_policy_connector_chromeos()->
GetDeviceCloudPolicyManager()->core(),
base::MessageLoopProxy::current(),
- scoped_ptr<base::Clock>(new base::DefaultClock())));
+ scoped_ptr<base::Clock>(new base::DefaultClock()),
+ highest_handled_invalidation_version_));
invalidator_->Initialize(invalidation_service);
}
void DeviceCloudPolicyInvalidator::DestroyInvalidator() {
- if (invalidator_)
+ if (invalidator_) {
+ highest_handled_invalidation_version_ =
+ invalidator_->highest_handled_invalidation_version();
invalidator_->Shutdown();
+ }
invalidator_.reset();
invalidation_service_ = NULL;
}

Powered by Google App Engine
This is Rietveld 408576698