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

Unified Diff: components/metrics/net/net_metrics_log_uploader.h

Issue 2735443003: Use StringPiece for CreateUploader/NetMetricsLogUploader params. (Closed)
Patch Set: Nit and Rebase Created 3 years, 9 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 | « components/metrics/metrics_service_client.h ('k') | components/metrics/net/net_metrics_log_uploader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/net/net_metrics_log_uploader.h
diff --git a/components/metrics/net/net_metrics_log_uploader.h b/components/metrics/net/net_metrics_log_uploader.h
index b81d1665dff6918067e95b96aa8c7393cb89ced7..7bb575b5d7e520b0d7d0475cd551b1638e8b3345 100644
--- a/components/metrics/net/net_metrics_log_uploader.h
+++ b/components/metrics/net/net_metrics_log_uploader.h
@@ -9,8 +9,10 @@
#include <string>
#include "base/macros.h"
+#include "base/strings/string_piece.h"
#include "components/metrics/metrics_log_uploader.h"
#include "net/url_request/url_fetcher_delegate.h"
+#include "url/gurl.h"
namespace net {
class URLFetcher;
@@ -23,13 +25,15 @@ namespace metrics {
class NetMetricsLogUploader : public MetricsLogUploader,
public net::URLFetcherDelegate {
public:
- // Constructs a NetMetricsLogUploader with the specified request context and
- // other params (see comments on MetricsLogUploader for details). The caller
- // must ensure that |request_context_getter| remains valid for the lifetime
- // of this class.
+ // Constructs a NetMetricsLogUploader which uploads data to |server_url| with
+ // the specified |mime_type|. The |service_type| marks which service the
+ // data usage should be attributed to. The |on_upload_complete| callback will
+ // be called with the HTTP response code of the upload or with -1 on an error.
+ // The caller must ensure that |request_context_getter| remains valid for the
+ // lifetime of this class.
NetMetricsLogUploader(net::URLRequestContextGetter* request_context_getter,
- const std::string& server_url,
- const std::string& mime_type,
+ base::StringPiece server_url,
+ base::StringPiece mime_type,
MetricsLogUploader::MetricServiceType service_type,
const base::Callback<void(int)>& on_upload_complete);
~NetMetricsLogUploader() override;
@@ -45,6 +49,11 @@ class NetMetricsLogUploader : public MetricsLogUploader,
// The request context for fetches done using the network stack.
net::URLRequestContextGetter* const request_context_getter_;
+ const GURL server_url_;
+ const std::string mime_type_;
+ const MetricsLogUploader::MetricServiceType service_type_;
+ const base::Callback<void(int)> on_upload_complete_;
+
// The outstanding transmission appears as a URL Fetch operation.
std::unique_ptr<net::URLFetcher> current_fetch_;
« no previous file with comments | « components/metrics/metrics_service_client.h ('k') | components/metrics/net/net_metrics_log_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698