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

Unified Diff: metrics_library.h

Issue 3171023: Add weekly crash counters, refactor metrics_daemon, respect opt-in in library. (Closed) Base URL: http://src.chromium.org/git/metrics.git
Patch Set: Respond to review Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « metrics_daemon_test.cc ('k') | metrics_library.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: metrics_library.h
diff --git a/metrics_library.h b/metrics_library.h
index 76fa451ea7748f38041feae9698d51a2296dc768..52da94d27a5cb122f6c91c68aa2969422df53d17 100644
--- a/metrics_library.h
+++ b/metrics_library.h
@@ -27,6 +27,9 @@ class MetricsLibrary : public MetricsLibraryInterface {
// Initializes the library.
void Init();
+ // Returns whether or not metrics collection is enabled.
+ bool AreMetricsEnabled();
+
// Sends histogram data to Chrome for transport to UMA and returns
// true on success. This method results in the equivalent of an
// asynchronous non-blocking RPC to UMA_HISTOGRAM_CUSTOM_COUNTS
@@ -69,6 +72,7 @@ class MetricsLibrary : public MetricsLibraryInterface {
private:
friend class CMetricsLibraryTest;
friend class MetricsLibraryTest;
+ FRIEND_TEST(MetricsLibraryTest, AreMetricsEnabled);
FRIEND_TEST(MetricsLibraryTest, FormatChromeMessage);
FRIEND_TEST(MetricsLibraryTest, FormatChromeMessageTooLong);
FRIEND_TEST(MetricsLibraryTest, SendMessageToChrome);
@@ -89,7 +93,14 @@ class MetricsLibrary : public MetricsLibraryInterface {
int32_t FormatChromeMessage(int32_t buffer_size, char* buffer,
const char* format, ...);
+ // Time at which we last checked if metrics were enabled.
+ static time_t cached_enabled_time_;
+
+ // Cached state of whether or not metrics were enabled.
+ static bool cached_enabled_;
+
const char* uma_events_file_;
+ const char* consent_file_;
};
#endif // METRICS_LIBRARY_H_
« no previous file with comments | « metrics_daemon_test.cc ('k') | metrics_library.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698