Index: chrome/browser/metrics/metrics_service.h |
=================================================================== |
--- chrome/browser/metrics/metrics_service.h (revision 49302) |
+++ chrome/browser/metrics/metrics_service.h (working copy) |
@@ -21,6 +21,7 @@ |
#include "base/values.h" |
#include "chrome/browser/metrics/metrics_log.h" |
#include "chrome/common/child_process_info.h" |
+#include "chrome/common/metrics_helpers.h" |
#include "chrome/common/net/url_fetcher.h" |
#include "chrome/common/notification_registrar.h" |
#include "webkit/glue/plugins/webplugininfo.h" |
@@ -70,7 +71,8 @@ |
}; |
class MetricsService : public NotificationObserver, |
- public URLFetcher::Delegate { |
+ public URLFetcher::Delegate, |
+ public MetricsServiceBase { |
public: |
MetricsService(); |
virtual ~MetricsService(); |
@@ -150,9 +152,6 @@ |
SENDING_CURRENT_LOGS, // Sending standard current logs as they acrue. |
}; |
- // Maintain a map of histogram names to the sample stats we've sent. |
- typedef std::map<std::string, Histogram::SampleSet> LoggedSampleMap; |
- |
class InitTask; |
class InitTaskComplete; |
@@ -218,7 +217,7 @@ |
// Called to stop recording user experience metrics. The caller takes |
// ownership of the resulting MetricsLog object via the log parameter, |
// or passes in NULL to indicate that the log should simply be deleted. |
- void StopRecording(MetricsLog** log); |
+ void StopRecording(MetricsLogBase** log); |
// Deletes pending_log_ and current_log_, and pushes their text into the |
// appropriate unsent_log vectors. Called when Chrome shuts down. |
@@ -250,10 +249,6 @@ |
// TryToStartTransmission. |
bool TransmissionPermitted() const; |
- // Check to see if there is a log that needs to be, or is being, transmitted. |
- bool pending_log() const { |
- return pending_log_ || !pending_log_text_.empty(); |
- } |
// Check to see if there are any unsent logs from previous sessions. |
bool unsent_logs() const { |
return !unsent_initial_logs_.empty() || !unsent_ongoing_logs_.empty(); |
@@ -270,11 +265,6 @@ |
// a compressed copy of the pending log. |
void PrepareFetchWithPendingLog(); |
- // Discard pending_log_, and clear pending_log_text_. Called after processing |
- // of this log is complete. |
- void DiscardPendingLog(); |
- // Compress the report log in input using bzip2, store the result in output. |
- bool Bzip2Compress(const std::string& input, std::string* output); |
// Implementation of URLFetcher::Delegate. Called after transmission |
// completes (either successfully or with failure). |
virtual void OnURLFetchComplete(const URLFetcher* source, |
@@ -387,13 +377,6 @@ |
// collecting stats from renderers. |
void CollectRendererHistograms(); |
- // Record complete list of histograms into the current log. |
- // Called when we close a log. |
- void RecordCurrentHistograms(); |
- |
- // Record a specific histogram . |
- void RecordHistogram(const Histogram& histogram); |
- |
// Logs the initiation of a page load |
void LogLoadStarted(); |
@@ -441,20 +424,9 @@ |
// The list of plugins which was retrieved on the file thread. |
std::vector<WebPluginInfo> plugins_; |
- // A log that we are currently transmiting, or about to try to transmit. |
- MetricsLog* pending_log_; |
- |
- // An alternate form of pending_log_. We persistently save this text version |
- // into prefs if we can't transmit it. As a result, sometimes all we have is |
- // the text version (recalled from a previous session). |
- std::string pending_log_text_; |
- |
// The outstanding transmission appears as a URL Fetch operation. |
scoped_ptr<URLFetcher> current_fetch_; |
- // The log that we are still appending to. |
- MetricsLog* current_log_; |
- |
// The URL for the metrics server. |
std::wstring server_url_; |
@@ -496,10 +468,6 @@ |
// at creation time from the prefs. |
scoped_ptr<DictionaryValue> profile_dictionary_; |
- // For histograms, record what we've already logged (as a sample for each |
- // histogram) so that we can send only the delta with the next log. |
- MetricsService::LoggedSampleMap logged_samples_; |
- |
// The interval between consecutive log transmissions (to avoid hogging the |
// outbound network link). This is usually also the duration for which we |
// build up a log, but if other unsent-logs from previous sessions exist, we |