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

Unified Diff: chrome/browser/policy/cloud_policy_cache_base.cc

Issue 7105018: UMA metrics for cloud policies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed detection of some events, rebased Created 9 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/policy/cloud_policy_cache_base.cc
diff --git a/chrome/browser/policy/cloud_policy_cache_base.cc b/chrome/browser/policy/cloud_policy_cache_base.cc
index 5fdf08ed3fa60c3ac5e8efd23457681e151f8e03..6491a58a9b098f5250de24f5b1726684b970544c 100644
--- a/chrome/browser/policy/cloud_policy_cache_base.cc
+++ b/chrome/browser/policy/cloud_policy_cache_base.cc
@@ -9,10 +9,13 @@
#include "base/logging.h"
#include "base/values.h"
#include "chrome/browser/policy/configuration_policy_pref_store.h"
+#include "chrome/browser/policy/enterprise_metrics.h"
#include "chrome/browser/policy/policy_notifier.h"
namespace policy {
+namespace em = enterprise_management;
+
// A thin ConfigurationPolicyProvider implementation sitting on top of
// CloudPolicyCacheBase for hooking up with ConfigurationPolicyPrefStore.
class CloudPolicyCacheBase::CloudPolicyProvider
@@ -98,6 +101,7 @@ bool CloudPolicyCacheBase::SetPolicyInternal(
&temp_timestamp, &temp_public_key_version);
if (!ok) {
LOG(WARNING) << "Decoding policy data failed.";
+ em::LogPolicyOperation(em::kPolicyFetchInvalidPolicy);
return false;
}
if (timestamp) {
@@ -106,6 +110,7 @@ bool CloudPolicyCacheBase::SetPolicyInternal(
if (check_for_timestamp_validity &&
temp_timestamp > base::Time::NowFromSystemTime()) {
LOG(WARNING) << "Rejected policy data, file is from the future.";
+ em::LogPolicyOperation(em::kPolicyFetchTimestampInFuture);
return false;
}
public_key_version_.version = temp_public_key_version.version;
@@ -118,6 +123,10 @@ bool CloudPolicyCacheBase::SetPolicyInternal(
recommended_policy_.Swap(&recommended_policy);
initialization_complete_ = true;
+ if (!new_policy_differs) {
+ em::LogPolicyOperation(em::kPolicyFetchNotModified);
+ }
+
if (new_policy_differs || initialization_was_not_complete) {
FOR_EACH_OBSERVER(ConfigurationPolicyProvider::Observer,
observer_list_, OnUpdatePolicy());

Powered by Google App Engine
This is Rietveld 408576698