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

Unified Diff: metrics_library.h

Issue 3571009: metrics: Add guest mode detection to metrics library and client (Closed) Base URL: http://git.chromium.org/git/metrics.git
Patch Set: Fix metrics_client semantics bug Created 10 years, 3 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.cc ('k') | metrics_library.cc » ('j') | metrics_library.cc » ('J')
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 52da94d27a5cb122f6c91c68aa2969422df53d17..fb31c20f6ade9df992bd8eeb1e5f8895e73eec2e 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 the machine is running in guest mode.
+ bool IsGuestMode();
+
// Returns whether or not metrics collection is enabled.
bool AreMetricsEnabled();
@@ -75,9 +78,18 @@ class MetricsLibrary : public MetricsLibraryInterface {
FRIEND_TEST(MetricsLibraryTest, AreMetricsEnabled);
FRIEND_TEST(MetricsLibraryTest, FormatChromeMessage);
FRIEND_TEST(MetricsLibraryTest, FormatChromeMessageTooLong);
+ FRIEND_TEST(MetricsLibraryTest, IsDeviceMounted);
FRIEND_TEST(MetricsLibraryTest, SendMessageToChrome);
FRIEND_TEST(MetricsLibraryTest, SendMessageToChromeUMAEventsBadFileLocation);
+ // Sets |*result| to whether or not the |mounts_file| indicates that
+ // the |device_name| is currently mounted. Uses |buffer| of
+ // |buffer_size| to read the file. Returns false if any error.
+ bool IsDeviceMounted(const char* device_name,
+ const char* mounts_file,
+ char* buffer, int buffer_size,
petkov 2010/10/01 16:13:09 the buffer is allocated on the stack anyway. you m
+ bool* result);
+
// Sends message of size |length| to Chrome for transport to UMA and
// returns true on success.
bool SendMessageToChrome(int32_t length, const char* message);
« no previous file with comments | « metrics_daemon.cc ('k') | metrics_library.cc » ('j') | metrics_library.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698