OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 // | 5 // |
6 // C wrapper to libmetrics | 6 // C wrapper to libmetrics |
7 // | 7 // |
8 | 8 |
9 #include "c_metrics_library.h" | 9 #include "c_metrics_library.h" |
10 #include "metrics_library.h" | 10 #include "metrics_library.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 } | 44 } |
45 | 45 |
46 extern "C" int CMetricsLibrarySendUserActionToUMA(CMetricsLibrary handle, | 46 extern "C" int CMetricsLibrarySendUserActionToUMA(CMetricsLibrary handle, |
47 const char* action) { | 47 const char* action) { |
48 MetricsLibrary* lib = reinterpret_cast<MetricsLibrary*>(handle); | 48 MetricsLibrary* lib = reinterpret_cast<MetricsLibrary*>(handle); |
49 if (lib == NULL) | 49 if (lib == NULL) |
50 return 0; | 50 return 0; |
51 return lib->SendUserActionToUMA(std::string(action)); | 51 return lib->SendUserActionToUMA(std::string(action)); |
52 } | 52 } |
53 | 53 |
| 54 extern "C" int CMetricsLibrarySendCrashToUMA(CMetricsLibrary handle, |
| 55 const char* crash_kind) { |
| 56 MetricsLibrary* lib = reinterpret_cast<MetricsLibrary*>(handle); |
| 57 if (lib == NULL) |
| 58 return 0; |
| 59 return lib->SendCrashToUMA(crash_kind); |
| 60 } |
| 61 |
54 extern "C" int CMetricsLibraryAreMetricsEnabled(CMetricsLibrary handle) { | 62 extern "C" int CMetricsLibraryAreMetricsEnabled(CMetricsLibrary handle) { |
55 MetricsLibrary* lib = reinterpret_cast<MetricsLibrary*>(handle); | 63 MetricsLibrary* lib = reinterpret_cast<MetricsLibrary*>(handle); |
56 if (lib == NULL) | 64 if (lib == NULL) |
57 return 0; | 65 return 0; |
58 return lib->AreMetricsEnabled(); | 66 return lib->AreMetricsEnabled(); |
59 } | 67 } |
OLD | NEW |