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

Unified Diff: components/metrics/metrics_service_client.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: components/metrics/metrics_service_client.h
===================================================================
--- components/metrics/metrics_service_client.h (revision 272759)
+++ components/metrics/metrics_service_client.h (working copy)
@@ -9,6 +9,8 @@
#include "base/basictypes.h"
#include "base/callback_forward.h"
+#include "base/memory/scoped_ptr.h"
+#include "components/metrics/metrics_log_uploader.h"
#include "components/metrics/proto/system_profile.pb.h"
namespace metrics {
@@ -50,6 +52,15 @@
// extra histograms that will go in that log. Asynchronous API - the client
// implementation should call |done_callback| when complete.
virtual void CollectFinalMetrics(const base::Closure& done_callback) = 0;
+
+ // Creates a MetricsLogUploader for uploading to the specified |server_url|
+ // with the given |mime_type|. When a log upload is finished, the uploader
+ // will call |on_upload_complete| with the response code or with -1 on an
+ // error.
+ virtual scoped_ptr<MetricsLogUploader> CreateUploader(
+ const std::string& server_url,
+ const std::string& mime_type,
+ const base::Callback<void(int)> on_upload_complete) = 0;
blundell 2014/05/26 07:56:56 It seems like all these parameters belong as const
Alexei Svitkine (slow) 2014/05/26 20:04:10 Just to clarify, do you mean changing MetricsLogUp
blundell 2014/05/26 20:22:15 I was actually just suggesting adding them as para
Alexei Svitkine (slow) 2014/05/27 14:36:40 Done. I've now added those params/ivars to the bas
};
} // namespace metrics

Powered by Google App Engine
This is Rietveld 408576698