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_CORE_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ | 5 #ifndef COMPONENTS_SYNC_CORE_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ |
6 #define COMPONENTS_SYNC_CORE_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ | 6 #define COMPONENTS_SYNC_CORE_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "components/sync/api/attachments/attachment.h" | 12 #include "components/sync/api/attachments/attachment.h" |
13 #include "components/sync/base/model_type.h" | 13 #include "components/sync/base/model_type.h" |
14 #include "components/sync/base/sync_export.h" | |
15 #include "google_apis/gaia/oauth2_token_service_request.h" | 14 #include "google_apis/gaia/oauth2_token_service_request.h" |
16 | 15 |
17 namespace net { | 16 namespace net { |
18 class URLRequestContextGetter; | 17 class URLRequestContextGetter; |
19 } // namespace net | 18 } // namespace net |
20 | 19 |
21 namespace syncer { | 20 namespace syncer { |
22 | 21 |
23 // AttachmentDownloader is responsible for downloading attachments from server. | 22 // AttachmentDownloader is responsible for downloading attachments from server. |
24 class SYNC_EXPORT AttachmentDownloader { | 23 class AttachmentDownloader { |
25 public: | 24 public: |
26 // The result of a DownloadAttachment operation. | 25 // The result of a DownloadAttachment operation. |
27 enum DownloadResult { | 26 enum DownloadResult { |
28 DOWNLOAD_SUCCESS, // No error, attachment was downloaded | 27 DOWNLOAD_SUCCESS, // No error, attachment was downloaded |
29 // successfully. | 28 // successfully. |
30 DOWNLOAD_TRANSIENT_ERROR, // A transient error occurred, try again later. | 29 DOWNLOAD_TRANSIENT_ERROR, // A transient error occurred, try again later. |
31 DOWNLOAD_UNSPECIFIED_ERROR, // An unspecified error occurred. | 30 DOWNLOAD_UNSPECIFIED_ERROR, // An unspecified error occurred. |
32 }; | 31 }; |
33 | 32 |
34 typedef base::Callback<void(const DownloadResult&, | 33 typedef base::Callback<void(const DownloadResult&, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 const OAuth2TokenService::ScopeSet scopes, | 66 const OAuth2TokenService::ScopeSet scopes, |
68 const scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider>& | 67 const scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider>& |
69 token_service_provider, | 68 token_service_provider, |
70 const std::string& store_birthday, | 69 const std::string& store_birthday, |
71 ModelType model_type); | 70 ModelType model_type); |
72 }; | 71 }; |
73 | 72 |
74 } // namespace syncer | 73 } // namespace syncer |
75 | 74 |
76 #endif // COMPONENTS_SYNC_CORE_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ | 75 #endif // COMPONENTS_SYNC_CORE_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ |
OLD | NEW |