| 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_API_ATTACHMENTS_ATTACHMENT_SERVICE_IMPL_H_ | 5 #ifndef SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_IMPL_H_ |
| 6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_IMPL_H_ | 6 #define SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "base/threading/non_thread_safe.h" | 9 #include "base/threading/non_thread_safe.h" |
| 10 #include "sync/api/attachments/attachment_service.h" | 10 #include "sync/api/attachments/attachment_service.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 const DropCallback& callback) OVERRIDE; | 38 const DropCallback& callback) OVERRIDE; |
| 39 virtual void StoreAttachments(const AttachmentList& attachments, | 39 virtual void StoreAttachments(const AttachmentList& attachments, |
| 40 const StoreCallback& callback) OVERRIDE; | 40 const StoreCallback& callback) OVERRIDE; |
| 41 virtual void OnSyncDataDelete(const SyncData& sync_data) OVERRIDE; | 41 virtual void OnSyncDataDelete(const SyncData& sync_data) OVERRIDE; |
| 42 virtual void OnSyncDataUpdate(const AttachmentIdList& old_attachment_ids, | 42 virtual void OnSyncDataUpdate(const AttachmentIdList& old_attachment_ids, |
| 43 const SyncData& updated_sync_data) OVERRIDE; | 43 const SyncData& updated_sync_data) OVERRIDE; |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 void ReadDone(const GetOrDownloadCallback& callback, | 46 void ReadDone(const GetOrDownloadCallback& callback, |
| 47 const AttachmentStore::Result& result, | 47 const AttachmentStore::Result& result, |
| 48 scoped_ptr<AttachmentMap> attachments); | 48 scoped_ptr<AttachmentMap> attachments, |
| 49 scoped_ptr<AttachmentIdList> unavailable_attachment_ids); |
| 49 void DropDone(const DropCallback& callback, | 50 void DropDone(const DropCallback& callback, |
| 50 const AttachmentStore::Result& result); | 51 const AttachmentStore::Result& result); |
| 51 void WriteDone(const StoreCallback& callback, | 52 void WriteDone(const StoreCallback& callback, |
| 52 const AttachmentStore::Result& result); | 53 const AttachmentStore::Result& result); |
| 53 void UploadDone(const AttachmentUploader::UploadResult& result, | 54 void UploadDone(const AttachmentUploader::UploadResult& result, |
| 54 const AttachmentId& attachment_id); | 55 const AttachmentId& attachment_id); |
| 55 | 56 |
| 56 const scoped_ptr<AttachmentStore> attachment_store_; | 57 const scoped_ptr<AttachmentStore> attachment_store_; |
| 57 const scoped_ptr<AttachmentUploader> attachment_uploader_; | 58 const scoped_ptr<AttachmentUploader> attachment_uploader_; |
| 58 Delegate* delegate_; | 59 Delegate* delegate_; |
| 59 // Must be last data member. | 60 // Must be last data member. |
| 60 base::WeakPtrFactory<AttachmentServiceImpl> weak_ptr_factory_; | 61 base::WeakPtrFactory<AttachmentServiceImpl> weak_ptr_factory_; |
| 61 | 62 |
| 62 DISALLOW_COPY_AND_ASSIGN(AttachmentServiceImpl); | 63 DISALLOW_COPY_AND_ASSIGN(AttachmentServiceImpl); |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 } // namespace syncer | 66 } // namespace syncer |
| 66 | 67 |
| 67 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_IMPL_H_ | 68 #endif // SYNC_API_ATTACHMENTS_ATTACHMENT_SERVICE_IMPL_H_ |
| OLD | NEW |