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

Unified Diff: chrome/browser/sync/profile_sync_components_factory_impl.cc

Issue 356953009: Revert of Consolidate attachment URL construction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | « no previous file | sync/api/attachments/attachment_downloader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/profile_sync_components_factory_impl.cc
diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc
index 87a1c4390dda1af4f3764669a38f166a37ad17df..b1a93fc1ce818070626774a2cde555490034b9d1 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc
@@ -124,6 +124,8 @@
namespace {
+const char kAttachmentsPath[] = "/attachments/";
+
syncer::ModelTypeSet GetDisabledTypesFromCommandLine(
const CommandLine& command_line) {
syncer::ModelTypeSet disabled_types;
@@ -140,6 +142,11 @@
enabled_types.Put(syncer::SYNCED_NOTIFICATIONS);
}
return enabled_types;
+}
+
+// Returns the base URL for attachments.
+std::string GetSyncServiceAttachmentsURL(const GURL& sync_service_url) {
+ return sync_service_url.spec() + kAttachmentsPath;
}
} // namespace
@@ -624,6 +631,7 @@
scoped_ptr<syncer::AttachmentService>
ProfileSyncComponentsFactoryImpl::CreateAttachmentService(
syncer::AttachmentService::Delegate* delegate) {
+ std::string url_prefix = GetSyncServiceAttachmentsURL(sync_service_url_);
scoped_ptr<OAuth2TokenServiceRequest::TokenServiceProvider>
token_service_provider(new TokenServiceProvider(
content::BrowserThread::GetMessageLoopProxyForThread(
@@ -634,7 +642,7 @@
// AttachmentUploader and AttachmentDownloader instead of creating a new one
// per AttachmentService (bug 369536).
scoped_ptr<syncer::AttachmentUploader> attachment_uploader(
- new syncer::AttachmentUploaderImpl(sync_service_url_,
+ new syncer::AttachmentUploaderImpl(url_prefix,
url_request_context_getter_,
account_id_,
scope_set_,
« no previous file with comments | « no previous file | sync/api/attachments/attachment_downloader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698