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

Side by Side Diff: chrome/browser/chromeos/policy/device_cloud_policy_invalidator.cc

Issue 465433002: Separate UMA histograms for user and device policy invalidation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/policy/device_cloud_policy_invalidator.h" 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_invalidator.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // |CloudPolicyInvalidator| will be created later when a connected service 244 // |CloudPolicyInvalidator| will be created later when a connected service
245 // becomes available. 245 // becomes available.
246 CreateInvalidator(device_invalidation_service_.get()); 246 CreateInvalidator(device_invalidation_service_.get());
247 } 247 }
248 } 248 }
249 249
250 void DeviceCloudPolicyInvalidator::CreateInvalidator( 250 void DeviceCloudPolicyInvalidator::CreateInvalidator(
251 invalidation::InvalidationService* invalidation_service) { 251 invalidation::InvalidationService* invalidation_service) {
252 invalidation_service_ = invalidation_service; 252 invalidation_service_ = invalidation_service;
253 invalidator_.reset(new CloudPolicyInvalidator( 253 invalidator_.reset(new CloudPolicyInvalidator(
254 false /* handling_user_policy */,
254 g_browser_process->platform_part()->browser_policy_connector_chromeos()-> 255 g_browser_process->platform_part()->browser_policy_connector_chromeos()->
255 GetDeviceCloudPolicyManager()->core(), 256 GetDeviceCloudPolicyManager()->core(),
256 base::MessageLoopProxy::current(), 257 base::MessageLoopProxy::current(),
257 scoped_ptr<base::Clock>(new base::DefaultClock()))); 258 scoped_ptr<base::Clock>(new base::DefaultClock())));
258 invalidator_->Initialize(invalidation_service); 259 invalidator_->Initialize(invalidation_service);
259 } 260 }
260 261
261 void DeviceCloudPolicyInvalidator::DestroyInvalidator() { 262 void DeviceCloudPolicyInvalidator::DestroyInvalidator() {
262 if (invalidator_) 263 if (invalidator_)
263 invalidator_->Shutdown(); 264 invalidator_->Shutdown();
264 invalidator_.reset(); 265 invalidator_.reset();
265 invalidation_service_ = NULL; 266 invalidation_service_ = NULL;
266 } 267 }
267 268
268 void DeviceCloudPolicyInvalidator::DestroyDeviceInvalidationService() { 269 void DeviceCloudPolicyInvalidator::DestroyDeviceInvalidationService() {
269 device_invalidation_service_observer_.reset(); 270 device_invalidation_service_observer_.reset();
270 device_invalidation_service_.reset(); 271 device_invalidation_service_.reset();
271 } 272 }
272 273
273 } // namespace policy 274 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698