| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_IMPL_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_IMPL_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_IMPL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 public: | 34 public: |
| 35 OfflinePageMetadataStoreImpl( | 35 OfflinePageMetadataStoreImpl( |
| 36 scoped_refptr<base::SequencedTaskRunner> background_task_runner, | 36 scoped_refptr<base::SequencedTaskRunner> background_task_runner, |
| 37 const base::FilePath& database_dir); | 37 const base::FilePath& database_dir); |
| 38 ~OfflinePageMetadataStoreImpl() override; | 38 ~OfflinePageMetadataStoreImpl() override; |
| 39 | 39 |
| 40 // OfflinePageMetadataStore implementation: | 40 // OfflinePageMetadataStore implementation: |
| 41 void Load(const LoadCallback& callback) override; | 41 void Load(const LoadCallback& callback) override; |
| 42 void AddOrUpdateOfflinePage(const OfflinePageItem& offline_page_record, | 42 void AddOrUpdateOfflinePage(const OfflinePageItem& offline_page_record, |
| 43 const UpdateCallback& callback) override; | 43 const UpdateCallback& callback) override; |
| 44 void RemoveOfflinePages(const std::vector<int64_t>& bookmark_ids, | 44 void RemoveOfflinePages(const std::vector<int64_t>& offline_ids, |
| 45 const UpdateCallback& callback) override; | 45 const UpdateCallback& callback) override; |
| 46 void Reset(const ResetCallback& callback) override; | 46 void Reset(const ResetCallback& callback) override; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 void LoadContinuation(const LoadCallback& callback, bool success); | 49 void LoadContinuation(const LoadCallback& callback, bool success); |
| 50 void LoadDone(const LoadCallback& callback, | 50 void LoadDone(const LoadCallback& callback, |
| 51 bool success, | 51 bool success, |
| 52 scoped_ptr<std::vector<OfflinePageEntry>> entries); | 52 scoped_ptr<std::vector<OfflinePageEntry>> entries); |
| 53 void NotifyLoadResult(const LoadCallback& callback, | 53 void NotifyLoadResult(const LoadCallback& callback, |
| 54 LoadStatus status, | 54 LoadStatus status, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 70 scoped_ptr<leveldb_proto::ProtoDatabase<OfflinePageEntry>> database_; | 70 scoped_ptr<leveldb_proto::ProtoDatabase<OfflinePageEntry>> database_; |
| 71 | 71 |
| 72 base::WeakPtrFactory<OfflinePageMetadataStoreImpl> weak_ptr_factory_; | 72 base::WeakPtrFactory<OfflinePageMetadataStoreImpl> weak_ptr_factory_; |
| 73 | 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(OfflinePageMetadataStoreImpl); | 74 DISALLOW_COPY_AND_ASSIGN(OfflinePageMetadataStoreImpl); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 } // namespace offline_pages | 77 } // namespace offline_pages |
| 78 | 78 |
| 79 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_IMPL_H_ | 79 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_IMPL_H_ |
| OLD | NEW |