Index: chrome/browser/sync/profile_sync_service.cc |
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc |
index 710fb757315f96d0b9ed9466ba5c5bc6e3c52388..85075287615b71fc5db47fcb431a37739cae1cae 100644 |
--- a/chrome/browser/sync/profile_sync_service.cc |
+++ b/chrome/browser/sync/profile_sync_service.cc |
@@ -26,6 +26,7 @@ |
#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/defaults.h" |
#include "chrome/browser/net/chrome_cookie_notification_details.h" |
+#include "chrome/browser/network_time/network_time_tracker.h" |
#include "chrome/browser/prefs/pref_service_syncable.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/signin/about_signin_internals.h" |
@@ -68,6 +69,8 @@ |
#include "net/url_request/url_request_context_getter.h" |
#include "sync/api/sync_error.h" |
#include "sync/internal_api/public/configure_reason.h" |
+#include "sync/internal_api/public/http_bridge.h" |
+#include "sync/internal_api/public/http_post_provider_factory.h" |
#include "sync/internal_api/public/sync_encryption_handler.h" |
#include "sync/internal_api/public/util/experiments.h" |
#include "sync/internal_api/public/util/sync_string_conversions.h" |
@@ -490,6 +493,12 @@ void ProfileSyncService::InitializeBackend(bool delete_stale_data) { |
new browser_sync::BackendUnrecoverableErrorHandler( |
MakeWeakHandle(weak_factory_.GetWeakPtr()))); |
+ // Consider overriding a function instead of doing this here. |
+ if (http_post_provider_factory_.get() == NULL) |
+ http_post_provider_factory_.reset(new syncer::HttpBridgeFactory( |
+ make_scoped_refptr(profile_->GetRequestContext()), |
+ NetworkTimeTracker::BuildNotifierUpdateCallback())); |
+ |
backend_->Initialize( |
this, |
sync_thread_.Pass(), |
@@ -500,7 +509,8 @@ void ProfileSyncService::InitializeBackend(bool delete_stale_data) { |
scoped_ptr<syncer::SyncManagerFactory>( |
new syncer::SyncManagerFactory).Pass(), |
backend_unrecoverable_error_handler.Pass(), |
- &browser_sync::ChromeReportUnrecoverableError); |
+ &browser_sync::ChromeReportUnrecoverableError, |
+ http_post_provider_factory_.Pass()); |
} |
void ProfileSyncService::CreateBackend() { |
@@ -2214,3 +2224,8 @@ ProfileSyncService::GetSyncTokenStatus() const { |
status.next_token_request_time = next_token_request_time_; |
return status; |
} |
+ |
+void ProfileSyncService::OverrideHttpPostProviderFactoryForTest( |
+ syncer::HttpPostProviderFactory* http_post_provider_factory) { |
+ http_post_provider_factory_.reset(http_post_provider_factory); |
+} |