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

Side by Side Diff: chrome/browser/metrics/metrics_service.h

Issue 6077013: Add support for collecting non-Chrome crash stats in Chrome OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium 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 // This file defines a service that collects information about the user 5 // This file defines a service that collects information about the user
6 // experience in order to help improve future versions of the app. 6 // experience in order to help improve future versions of the app.
7 7
8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ 8 #ifndef CHROME_BROWSER_METRICS_METRICS_SERVICE_H_
9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ 9 #define CHROME_BROWSER_METRICS_METRICS_SERVICE_H_
10 #pragma once 10 #pragma once
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 // at shutdown, but we can do it as we reduce the list as well. 119 // at shutdown, but we can do it as we reduce the list as well.
120 void StoreUnsentLogs(); 120 void StoreUnsentLogs();
121 121
122 #if defined(OS_CHROMEOS) 122 #if defined(OS_CHROMEOS)
123 // Returns the hardware class of the Chrome OS device (e.g., 123 // Returns the hardware class of the Chrome OS device (e.g.,
124 // hardware qualification ID), or "unknown" if the hardware class is 124 // hardware qualification ID), or "unknown" if the hardware class is
125 // not available. The hardware class identifies the configured 125 // not available. The hardware class identifies the configured
126 // system components such us CPU, WiFi adapter, etc. Note that this 126 // system components such us CPU, WiFi adapter, etc. Note that this
127 // routine invokes an external utility to determine the hardware 127 // routine invokes an external utility to determine the hardware
128 // class. 128 // class.
129 static std::string GetHardwareClass(); 129 static std::string GetHardwareClass();
petkov 2011/01/06 18:50:36 I think this method declaration needs to be remove
kmixter1 2011/01/14 00:07:02 Done.
130 130
131 // Start the external metrics service, which collects metrics from Chrome OS 131 // Start the external metrics service, which collects metrics from Chrome OS
132 // and passes them to UMA. 132 // and passes them to UMA.
133 void StartExternalMetrics(); 133 void StartExternalMetrics();
134 #endif 134 #endif
135 135
136 bool recording_active() const; 136 bool recording_active() const;
137 bool reporting_active() const; 137 bool reporting_active() const;
138 138
139 #if defined(OS_CHROMEOS)
petkov 2011/01/06 18:50:36 why don't you fold this into the ifdef above rathe
kmixter1 2011/01/14 00:07:02 Done.
140 // Records a Chrome OS crash.
141 void LogChromeOSCrash(const std::string &crash_type);
142 #endif
143
139 private: 144 private:
140 // The MetricsService has a lifecycle that is stored as a state. 145 // The MetricsService has a lifecycle that is stored as a state.
141 // See metrics_service.cc for description of this lifecycle. 146 // See metrics_service.cc for description of this lifecycle.
142 enum State { 147 enum State {
143 INITIALIZED, // Constructor was called. 148 INITIALIZED, // Constructor was called.
144 INIT_TASK_SCHEDULED, // Waiting for deferred init tasks to complete. 149 INIT_TASK_SCHEDULED, // Waiting for deferred init tasks to complete.
145 INIT_TASK_DONE, // Waiting for timer to send initial log. 150 INIT_TASK_DONE, // Waiting for timer to send initial log.
146 INITIAL_LOG_READY, // Initial log generated, and waiting for reply. 151 INITIAL_LOG_READY, // Initial log generated, and waiting for reply.
147 SEND_OLD_INITIAL_LOGS, // Sending unsent logs from previous session. 152 SEND_OLD_INITIAL_LOGS, // Sending unsent logs from previous session.
148 SENDING_OLD_LOGS, // Sending unsent logs from previous session. 153 SENDING_OLD_LOGS, // Sending unsent logs from previous session.
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptSizeOfLogList); 497 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptSizeOfLogList);
493 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptChecksumOfLogList); 498 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, CorruptChecksumOfLogList);
494 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesAllZeroes); 499 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesAllZeroes);
495 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesCorrectly); 500 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdGeneratesCorrectly);
496 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdCorrectlyFormatted); 501 FRIEND_TEST_ALL_PREFIXES(MetricsServiceTest, ClientIdCorrectlyFormatted);
497 502
498 DISALLOW_COPY_AND_ASSIGN(MetricsService); 503 DISALLOW_COPY_AND_ASSIGN(MetricsService);
499 }; 504 };
500 505
501 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_ 506 #endif // CHROME_BROWSER_METRICS_METRICS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698