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

Unified Diff: sync/internal_api/http_bridge.cc

Issue 73723006: Allow customization of HttpPostProviderFactory via ProfileSyncService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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/http_bridge.cc
diff --git a/sync/internal_api/http_bridge.cc b/sync/internal_api/http_bridge.cc
index 5827c9d77b50c0dbc9ba61a92152241c6b44cd21..0a0c4c2d07cccd2d8feac1ca32e399933ddffbbf 100644
--- a/sync/internal_api/http_bridge.cc
+++ b/sync/internal_api/http_bridge.cc
@@ -59,20 +59,15 @@ HttpBridge::RequestContextGetter::GetNetworkTaskRunner() const {
HttpBridgeFactory::HttpBridgeFactory(
net::URLRequestContextGetter* baseline_context_getter,
- const NetworkTimeUpdateCallback& network_time_update_callback,
- CancelationSignal* cancelation_signal)
+ const NetworkTimeUpdateCallback& network_time_update_callback)
: baseline_request_context_getter_(baseline_context_getter),
network_time_update_callback_(network_time_update_callback),
- cancelation_signal_(cancelation_signal) {
- // Registration should never fail. This should happen on the UI thread during
- // init. It would be impossible for a shutdown to have been requested at this
- // point.
- bool result = cancelation_signal_->TryRegisterHandler(this);
- DCHECK(result);
+ cancelation_signal_(NULL) {
}
HttpBridgeFactory::~HttpBridgeFactory() {
- cancelation_signal_->UnregisterHandler(this);
+ if (cancelation_signal_ != NULL)
+ cancelation_signal_->UnregisterHandler(this);
}
void HttpBridgeFactory::Init(const std::string& user_agent) {
@@ -89,6 +84,17 @@ void HttpBridgeFactory::Init(const std::string& user_agent) {
baseline_request_context_getter_, user_agent);
}
+void HttpBridgeFactory::RegisterCancelationSignal(
+ CancelationSignal* cancelation_signal) {
+ cancelation_signal_ = cancelation_signal;
+
+ // Registration should never fail. This should happen on the UI thread during
+ // init. It would be impossible for a shutdown to have been requested at this
+ // point.
+ bool result = cancelation_signal_->TryRegisterHandler(this);
+ DCHECK(result);
+}
+
HttpPostProviderInterface* HttpBridgeFactory::Create() {
base::AutoLock lock(context_getter_lock_);

Powered by Google App Engine
This is Rietveld 408576698