OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ |
7 | 7 |
8 #include "base/containers/scoped_ptr_hash_map.h" | 8 #include "base/containers/scoped_ptr_hash_map.h" |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/threading/non_thread_safe.h" | 10 #include "base/threading/non_thread_safe.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // | 34 // |
35 // |token_service_provider| provides an OAuth2 token service. | 35 // |token_service_provider| provides an OAuth2 token service. |
36 AttachmentUploaderImpl( | 36 AttachmentUploaderImpl( |
37 const GURL& sync_service_url, | 37 const GURL& sync_service_url, |
38 const scoped_refptr<net::URLRequestContextGetter>& | 38 const scoped_refptr<net::URLRequestContextGetter>& |
39 url_request_context_getter, | 39 url_request_context_getter, |
40 const std::string& account_id, | 40 const std::string& account_id, |
41 const OAuth2TokenService::ScopeSet& scopes, | 41 const OAuth2TokenService::ScopeSet& scopes, |
42 const scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider>& | 42 const scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider>& |
43 token_service_provider); | 43 token_service_provider); |
44 virtual ~AttachmentUploaderImpl(); | 44 ~AttachmentUploaderImpl() override; |
45 | 45 |
46 // AttachmentUploader implementation. | 46 // AttachmentUploader implementation. |
47 virtual void UploadAttachment(const Attachment& attachment, | 47 void UploadAttachment(const Attachment& attachment, |
48 const UploadCallback& callback) override; | 48 const UploadCallback& callback) override; |
49 | 49 |
50 // Return the URL for the given |sync_service_url| and |attachment_id|. | 50 // Return the URL for the given |sync_service_url| and |attachment_id|. |
51 static GURL GetURLForAttachmentId(const GURL& sync_service_url, | 51 static GURL GetURLForAttachmentId(const GURL& sync_service_url, |
52 const AttachmentId& attachment_id); | 52 const AttachmentId& attachment_id); |
53 | 53 |
54 // Return the crc32c of the memory described by |data| and |size|. | 54 // Return the crc32c of the memory described by |data| and |size|. |
55 // | 55 // |
56 // The value is base64 encoded, big-endian format. Suitable for use in the | 56 // The value is base64 encoded, big-endian format. Suitable for use in the |
57 // X-Goog-Hash header | 57 // X-Goog-Hash header |
58 // (https://cloud.google.com/storage/docs/reference-headers#xgooghash). | 58 // (https://cloud.google.com/storage/docs/reference-headers#xgooghash). |
(...skipping 18 matching lines...) Expand all Loading... |
77 | 77 |
78 // Must be last data member. | 78 // Must be last data member. |
79 base::WeakPtrFactory<AttachmentUploaderImpl> weak_ptr_factory_; | 79 base::WeakPtrFactory<AttachmentUploaderImpl> weak_ptr_factory_; |
80 | 80 |
81 DISALLOW_COPY_AND_ASSIGN(AttachmentUploaderImpl); | 81 DISALLOW_COPY_AND_ASSIGN(AttachmentUploaderImpl); |
82 }; | 82 }; |
83 | 83 |
84 } // namespace syncer | 84 } // namespace syncer |
85 | 85 |
86 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ | 86 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_UPLOADER_IMPL_H_ |
OLD | NEW |