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 COMPONENTS_SYNC_ENGINE_ATTACHMENTS_ATTACHMENT_UPLOADER_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_ATTACHMENTS_ATTACHMENT_UPLOADER_H_ |
6 #define COMPONENTS_SYNC_ENGINE_ATTACHMENTS_ATTACHMENT_UPLOADER_H_ | 6 #define COMPONENTS_SYNC_ENGINE_ATTACHMENTS_ATTACHMENT_UPLOADER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 class AttachmentUploader { | 23 class AttachmentUploader { |
24 public: | 24 public: |
25 // The result of an UploadAttachment operation. | 25 // The result of an UploadAttachment operation. |
26 enum UploadResult { | 26 enum UploadResult { |
27 UPLOAD_SUCCESS, // No error, attachment was uploaded | 27 UPLOAD_SUCCESS, // No error, attachment was uploaded |
28 // successfully. | 28 // successfully. |
29 UPLOAD_TRANSIENT_ERROR, // A transient error occurred, try again later. | 29 UPLOAD_TRANSIENT_ERROR, // A transient error occurred, try again later. |
30 UPLOAD_UNSPECIFIED_ERROR, // An unspecified error occurred. | 30 UPLOAD_UNSPECIFIED_ERROR, // An unspecified error occurred. |
31 }; | 31 }; |
32 | 32 |
33 typedef base::Callback<void(const UploadResult&, const AttachmentId&)> | 33 using UploadCallback = |
34 UploadCallback; | 34 base::Callback<void(const UploadResult&, const AttachmentId&)>; |
35 | 35 |
36 virtual ~AttachmentUploader(); | 36 virtual ~AttachmentUploader(); |
37 | 37 |
38 // Upload |attachment| and invoke |callback| when done. | 38 // Upload |attachment| and invoke |callback| when done. |
39 // | 39 // |
40 // |callback| will be invoked when the operation has completed (successfully | 40 // |callback| will be invoked when the operation has completed (successfully |
41 // or otherwise). | 41 // or otherwise). |
42 // | 42 // |
43 // |callback| will receive an UploadResult code and the AttachmentId of the | 43 // |callback| will receive an UploadResult code and the AttachmentId of the |
44 // newly uploaded attachment. | 44 // newly uploaded attachment. |
(...skipping 23 matching lines...) Expand all Loading... |
68 const OAuth2TokenService::ScopeSet scopes, | 68 const OAuth2TokenService::ScopeSet scopes, |
69 const scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider>& | 69 const scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider>& |
70 token_service_provider, | 70 token_service_provider, |
71 const std::string& store_birthday, | 71 const std::string& store_birthday, |
72 ModelType model_type); | 72 ModelType model_type); |
73 }; | 73 }; |
74 | 74 |
75 } // namespace syncer | 75 } // namespace syncer |
76 | 76 |
77 #endif // COMPONENTS_SYNC_ENGINE_ATTACHMENTS_ATTACHMENT_UPLOADER_H_ | 77 #endif // COMPONENTS_SYNC_ENGINE_ATTACHMENTS_ATTACHMENT_UPLOADER_H_ |
OLD | NEW |