Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/policy/policy_load_status.h" | |
| 6 | |
| 7 #include "base/metrics/histogram.h" | |
| 8 #include "base/stringprintf.h" | |
| 9 #include "chrome/browser/policy/policy_types.h" | |
| 10 | |
| 11 namespace policy { | |
| 12 | |
| 13 namespace { | |
| 14 | |
| 15 const char kHistogramName[] = "Enterprise.PolicyLoadStatus"; | |
| 16 | |
| 17 } // namespace | |
| 18 | |
| 19 PolicyLoadStatusSample::PolicyLoadStatusSample() | |
| 20 : histogram_(base::LinearHistogram::FactoryGet( | |
|
Joao da Silva
2013/04/17 10:48:47
nit: indent
Mattias Nissler (ping if slow)
2013/04/17 13:41:36
Done.
| |
| 21 kHistogramName, 0, POLICY_LOAD_STATUS_SIZE, POLICY_LOAD_STATUS_SIZE + 1, | |
| 22 base::Histogram::kUmaTargetedHistogramFlag)) { | |
| 23 Add(POLICY_LOAD_STATUS_STARTED); | |
| 24 } | |
| 25 | |
| 26 PolicyLoadStatusSample::~PolicyLoadStatusSample() { | |
| 27 for (int i = 0; i < POLICY_LOAD_STATUS_SIZE; ++i) { | |
| 28 if (status_bits_[i]) | |
| 29 histogram_->Add(i); | |
| 30 } | |
| 31 } | |
| 32 | |
| 33 void PolicyLoadStatusSample::Add(PolicyLoadStatus status) { | |
| 34 status_bits_[status] = true; | |
| 35 } | |
| 36 | |
| 37 } // namespace policy | |
| OLD | NEW |