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

Unified Diff: sync/internal_api/public/attachments/attachment_uploader_impl.h

Issue 355093002: Consolidate attachment URL construction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use rbegin instead of back for portability. 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 | « sync/internal_api/public/attachments/attachment_downloader_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/public/attachments/attachment_uploader_impl.h
diff --git a/sync/internal_api/public/attachments/attachment_uploader_impl.h b/sync/internal_api/public/attachments/attachment_uploader_impl.h
index 8604415e03e8990d15b644beeac9812c3b1fd2c9..558c6ed0b99514be1a8980a762d9a5a7397b94a8 100644
--- a/sync/internal_api/public/attachments/attachment_uploader_impl.h
+++ b/sync/internal_api/public/attachments/attachment_uploader_impl.h
@@ -23,8 +23,11 @@ namespace syncer {
class SYNC_EXPORT AttachmentUploaderImpl : public AttachmentUploader,
public base::NonThreadSafe {
public:
- // |url_prefix| is the URL prefix (including trailing slash) to be used when
- // uploading attachments.
+ // Return the URL for the given |sync_service_url| and |attachment_id|.
+ static GURL GetURLForAttachmentId(const GURL& sync_service_url,
pavely 2014/06/26 21:09:03 nit: In chromium code I saw static methods declare
maniscalco 2014/06/26 21:31:33 Good catch. Done.
+ const AttachmentId& attachment_id);
+
+ // |sync_service_url| is the URL of the sync service.
//
// |url_request_context_getter| provides a URLRequestContext.
//
@@ -34,7 +37,7 @@ class SYNC_EXPORT AttachmentUploaderImpl : public AttachmentUploader,
//
// |token_service_provider| provides an OAuth2 token service.
AttachmentUploaderImpl(
- const std::string& url_prefix,
+ const GURL& sync_service_url,
const scoped_refptr<net::URLRequestContextGetter>&
url_request_context_getter,
const std::string& account_id,
@@ -55,7 +58,7 @@ class SYNC_EXPORT AttachmentUploaderImpl : public AttachmentUploader,
GURL GetUploadURLForAttachmentId(const AttachmentId& attachment_id) const;
void DeleteUploadStateFor(const UniqueId& unique_id);
- std::string url_prefix_;
+ GURL sync_service_url_;
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
std::string account_id_;
OAuth2TokenService::ScopeSet scopes_;
« no previous file with comments | « sync/internal_api/public/attachments/attachment_downloader_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698