| 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_DOWNLOADER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "google_apis/gaia/oauth2_token_service_request.h" | 10 #include "google_apis/gaia/oauth2_token_service_request.h" |
| 11 #include "sync/api/attachments/attachment.h" | 11 #include "sync/api/attachments/attachment.h" |
| 12 #include "sync/base/sync_export.h" | 12 #include "sync/base/sync_export.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 class URLRequestContextGetter; | 15 class URLRequestContextGetter; |
| 16 } // namespace net | 16 } // namespace net |
| 17 | 17 |
| 18 namespace syncer { | 18 namespace syncer { |
| 19 | 19 |
| 20 // AttachmentDownloader is responsible for downloading attachments from server. | 20 // AttachmentDownloader is responsible for downloading attachments from server. |
| 21 class SYNC_EXPORT AttachmentDownloader { | 21 class SYNC_EXPORT AttachmentDownloader { |
| 22 public: | 22 public: |
| 23 // The result of a DownloadAttachment operation. | 23 // The result of a DownloadAttachment operation. |
| 24 enum DownloadResult { | 24 enum DownloadResult { |
| 25 DOWNLOAD_SUCCESS, // No error, attachment was downloaded | 25 DOWNLOAD_SUCCESS, // No error, attachment was downloaded |
| 26 // successfully. | 26 // successfully. |
| 27 DOWNLOAD_TRANSIENT_ERROR, // A transient error occurred, try again later. |
| 27 DOWNLOAD_UNSPECIFIED_ERROR, // An unspecified error occurred. | 28 DOWNLOAD_UNSPECIFIED_ERROR, // An unspecified error occurred. |
| 28 }; | 29 }; |
| 29 | 30 |
| 30 typedef base::Callback<void(const DownloadResult&, scoped_ptr<Attachment>)> | 31 typedef base::Callback<void(const DownloadResult&, scoped_ptr<Attachment>)> |
| 31 DownloadCallback; | 32 DownloadCallback; |
| 32 | 33 |
| 33 virtual ~AttachmentDownloader(); | 34 virtual ~AttachmentDownloader(); |
| 34 | 35 |
| 35 // Download attachment referred by |attachment_id| and invoke |callback| when | 36 // Download attachment referred by |attachment_id| and invoke |callback| when |
| 36 // done. | 37 // done. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 56 url_request_context_getter, | 57 url_request_context_getter, |
| 57 const std::string& account_id, | 58 const std::string& account_id, |
| 58 const OAuth2TokenService::ScopeSet scopes, | 59 const OAuth2TokenService::ScopeSet scopes, |
| 59 const scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider>& | 60 const scoped_refptr<OAuth2TokenServiceRequest::TokenServiceProvider>& |
| 60 token_service_provider); | 61 token_service_provider); |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 } // namespace syncer | 64 } // namespace syncer |
| 64 | 65 |
| 65 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ | 66 #endif // SYNC_INTERNAL_API_PUBLIC_ATTACHMENTS_ATTACHMENT_DOWNLOADER_H_ |
| OLD | NEW |