Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 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 "base/metrics/histogram.h" | |
| 6 #include "chrome/browser/policy/enterprise_metrics.h" | |
| 7 #include "content/browser/browser_thread.h" | |
| 8 | |
| 9 namespace enterprise_management { | |
| 10 | |
| 11 void LogTokenOperation(TokenOperationResult result) { | |
| 12 DCHECK(result >= 0); | |
| 13 DCHECK(result < kTokenOperationsSize); | |
| 14 | |
| 15 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | |
|
gfeher
2011/06/28 09:58:58
Are you sure this is necessary? I haven't seen thi
Joao da Silva
2011/06/30 12:57:00
After checking histogram.h it seems to me that ini
| |
| 16 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | |
| 17 NewRunnableFunction(&LogTokenOperation, result)); | |
| 18 return; | |
| 19 } | |
| 20 | |
| 21 UMA_HISTOGRAM_ENUMERATION("Enterprise.DMToken", result, kTokenOperationsSize); | |
| 22 } | |
| 23 | |
| 24 void LogPolicyOperation(PolicyOperationResult result) { | |
| 25 DCHECK(result >= 0); | |
| 26 DCHECK(result < kPolicyOperationsSize); | |
| 27 | |
| 28 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | |
| 29 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | |
| 30 NewRunnableFunction(&LogPolicyOperation, result)); | |
| 31 return; | |
| 32 } | |
| 33 | |
| 34 UMA_HISTOGRAM_ENUMERATION("Enterprise.Policy", result, kPolicyOperationsSize); | |
| 35 } | |
| 36 | |
| 37 void LogEnrollmentOperation(EnrollmentResult result) { | |
| 38 DCHECK(result >= 0); | |
| 39 DCHECK(result < kEnrollmentOperationsSize); | |
| 40 | |
| 41 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | |
| 42 BrowserThread::PostTask( | |
| 43 BrowserThread::UI, FROM_HERE, | |
| 44 NewRunnableFunction(&LogEnrollmentOperation, result)); | |
| 45 return; | |
| 46 } | |
| 47 | |
| 48 UMA_HISTOGRAM_ENUMERATION("Enterprise.Enrollment", result, | |
| 49 kEnrollmentOperationsSize); | |
| 50 } | |
| 51 | |
| 52 } // namespace enterprise_management | |
| OLD | NEW |