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

Unified Diff: sync/internal_api/public/http_bridge.h

Issue 1330443002: Report data usage UMA for Chrome services (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@NewArchServices
Patch Set: Do the necessary plumbing for sync service. Created 5 years, 3 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: sync/internal_api/public/http_bridge.h
diff --git a/sync/internal_api/public/http_bridge.h b/sync/internal_api/public/http_bridge.h
index 36704e2a1bd5040db54b1f3a9f551d717c671758..d67b84c9f25e7e78345d172097ade499b508991b 100644
--- a/sync/internal_api/public/http_bridge.h
+++ b/sync/internal_api/public/http_bridge.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "base/memory/ref_counted.h"
@@ -54,7 +55,8 @@ class SYNC_EXPORT_PRIVATE HttpBridge
public:
HttpBridge(const std::string& user_agent,
const scoped_refptr<net::URLRequestContextGetter>& context,
- const NetworkTimeUpdateCallback& network_time_update_callback);
+ const NetworkTimeUpdateCallback& network_time_update_callback,
+ base::Callback<void(net::URLFetcher*)> bind_to_tracker_callback);
Nicolas Zea 2015/09/09 19:56:51 nit: pass the callback by const ref here and elsew
amohammadkhan 2015/09/09 22:21:56 Done. I put the typedef of my callback in http_pos
// HttpPostProvider implementation.
void SetExtraRequestHeaders(const char* headers) override;
@@ -180,6 +182,10 @@ class SYNC_EXPORT_PRIVATE HttpBridge
// Callback for updating network time.
NetworkTimeUpdateCallback network_time_update_callback_;
+ // A callback to tag Sync request to be able to record data use of this
+ // service by data_use_measurement component.
+ base::Callback<void(net::URLFetcher*)> bind_to_tracker_callback_;
+
DISALLOW_COPY_AND_ASSIGN(HttpBridge);
};
@@ -194,7 +200,9 @@ class SYNC_EXPORT HttpBridgeFactory : public HttpPostProviderFactory,
~HttpBridgeFactory() override;
// HttpPostProviderFactory:
- void Init(const std::string& user_agent) override;
+ void Init(
+ const std::string& user_agent,
+ base::Callback<void(net::URLFetcher*)> bind_to_tracker_callback) override;
HttpPostProviderInterface* Create() override;
void Destroy(HttpPostProviderInterface* http) override;
@@ -216,6 +224,10 @@ class SYNC_EXPORT HttpBridgeFactory : public HttpPostProviderFactory,
CancelationSignal* const cancelation_signal_;
+ // A callback to tag Sync request to be able to record data use of this
+ // service by data_use_measurement component.
+ base::Callback<void(net::URLFetcher*)> bind_to_tracker_callback_;
+
DISALLOW_COPY_AND_ASSIGN(HttpBridgeFactory);
};

Powered by Google App Engine
This is Rietveld 408576698