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

Unified Diff: chrome/browser/metrics/metrics_service.h

Issue 291153013: Make MetricsService upload logs through an interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 7 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
Index: chrome/browser/metrics/metrics_service.h
===================================================================
--- chrome/browser/metrics/metrics_service.h (revision 272759)
+++ chrome/browser/metrics/metrics_service.h (working copy)
@@ -32,7 +32,6 @@
#include "components/metrics/metrics_provider.h"
#include "components/metrics/metrics_service_observer.h"
#include "components/variations/active_field_trials.h"
-#include "net/url_request/url_fetcher_delegate.h"
class GoogleUpdateMetricsProviderWin;
class MetricsReportingScheduler;
@@ -54,6 +53,7 @@
}
namespace metrics {
+class MetricsLogUploader;
class MetricsServiceClient;
class MetricsStateManager;
}
@@ -88,8 +88,7 @@
class MetricsService
: public base::HistogramFlattener,
- public chrome_browser_metrics::TrackingSynchronizerObserver,
- public net::URLFetcherDelegate {
+ public chrome_browser_metrics::TrackingSynchronizerObserver {
public:
// The execution phase of the browser.
enum ExecutionPhase {
@@ -357,15 +356,9 @@
// Uploads the currently staged log (which must be non-null).
void SendStagedLog();
- // Prepared the staged log to be passed to the server. Upon return,
- // current_fetch_ should be reset with its upload data set to a compressed
- // copy of the staged log.
- void PrepareFetchWithStagedLog();
+ // Called after transmission completes (either successfully or with failure).
+ void OnLogUploadComplete(int response_code);
- // Implementation of net::URLFetcherDelegate. Called after transmission
- // completes (either successfully or with failure).
- virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE;
-
// Reads, increments and then sets the specified integer preference.
void IncrementPrefValue(const char* path);
@@ -457,9 +450,12 @@
// initial stability log may be sent before this.
scoped_ptr<MetricsLog> initial_metrics_log_;
- // The outstanding transmission appears as a URL Fetch operation.
- scoped_ptr<net::URLFetcher> current_fetch_;
+ // Instance of the helper class for uploading logs.
+ scoped_ptr<metrics::MetricsLogUploader> log_uploader_;
+ // Whether there is a current log upload in progress.
+ bool log_upload_in_progress_;
+
// Whether the MetricsService object has received any notifications since
// the last time a transmission was sent.
bool idle_since_last_transmission_;

Powered by Google App Engine
This is Rietveld 408576698