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

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

Issue 304253010: Add authentication support to AttachmentUploaderImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/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 0720bcb0594334e7da082471f5e90334030e58e4..627535c4fd66d49b533866d750f68bce3d877e8d 100644
--- a/sync/internal_api/public/attachments/attachment_uploader_impl.h
+++ b/sync/internal_api/public/attachments/attachment_uploader_impl.h
@@ -7,6 +7,7 @@
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/threading/non_thread_safe.h"
+#include "google_apis/gaia/oauth2_token_service_request.h"
#include "net/url_request/url_request_context_getter.h"
#include "sync/api/attachments/attachment_uploader.h"
@@ -23,10 +24,20 @@ 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.
- AttachmentUploaderImpl(const std::string& url_prefix,
- const scoped_refptr<net::URLRequestContextGetter>&
- url_request_context_getter);
+ // uploading attachments.
+ //
+ // |url_request_context_getter| provides a URLRequestContext.
+ //
+ // |account_id| is the account id to use for uploads.
+ //
+ // |token_service_provider| provides an OAuth2 token service.
+ AttachmentUploaderImpl(
+ const std::string& url_prefix,
+ const scoped_refptr<net::URLRequestContextGetter>&
+ url_request_context_getter,
+ const std::string& account_id,
+ scoped_ptr<OAuth2TokenServiceRequest::TokenServiceProvider>
+ token_service_provider);
virtual ~AttachmentUploaderImpl();
// AttachmentUploader implementation.
@@ -43,6 +54,9 @@ class SYNC_EXPORT AttachmentUploaderImpl : public AttachmentUploader,
std::string url_prefix_;
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
+ std::string account_id_;
+ scoped_ptr<OAuth2TokenServiceRequest::TokenServiceProvider>
+ token_service_provider_;
StateMap state_map_;
DISALLOW_COPY_AND_ASSIGN(AttachmentUploaderImpl);
};

Powered by Google App Engine
This is Rietveld 408576698