| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 public: | 31 public: |
| 32 OfflinePageMetadataStoreImpl( | 32 OfflinePageMetadataStoreImpl( |
| 33 scoped_refptr<base::SequencedTaskRunner> background_task_runner, | 33 scoped_refptr<base::SequencedTaskRunner> background_task_runner, |
| 34 const base::FilePath& database_dir); | 34 const base::FilePath& database_dir); |
| 35 ~OfflinePageMetadataStoreImpl() override; | 35 ~OfflinePageMetadataStoreImpl() override; |
| 36 | 36 |
| 37 // OfflinePageMetadataStore implementation: | 37 // OfflinePageMetadataStore implementation: |
| 38 void Load(const LoadCallback& callback) override; | 38 void Load(const LoadCallback& callback) override; |
| 39 void AddOrUpdateOfflinePage(const OfflinePageItem& offline_page_record, | 39 void AddOrUpdateOfflinePage(const OfflinePageItem& offline_page_record, |
| 40 const UpdateCallback& callback) override; | 40 const UpdateCallback& callback) override; |
| 41 void RemoveOfflinePages(const std::vector<int64>& bookmark_ids, | 41 void RemoveOfflinePages(const std::vector<int64_t>& bookmark_ids, |
| 42 const UpdateCallback& callback) override; | 42 const UpdateCallback& callback) override; |
| 43 void Reset(const ResetCallback& callback) override; | 43 void Reset(const ResetCallback& callback) override; |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 void LoadContinuation(const LoadCallback& callback, bool success); | 46 void LoadContinuation(const LoadCallback& callback, bool success); |
| 47 void LoadDone(const LoadCallback& callback, | 47 void LoadDone(const LoadCallback& callback, |
| 48 bool success, | 48 bool success, |
| 49 scoped_ptr<std::vector<OfflinePageEntry>> entries); | 49 scoped_ptr<std::vector<OfflinePageEntry>> entries); |
| 50 void NotifyLoadResult(const LoadCallback& callback, | 50 void NotifyLoadResult(const LoadCallback& callback, |
| 51 LoadStatus status, | 51 LoadStatus status, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 67 scoped_ptr<leveldb_proto::ProtoDatabase<OfflinePageEntry>> database_; | 67 scoped_ptr<leveldb_proto::ProtoDatabase<OfflinePageEntry>> database_; |
| 68 | 68 |
| 69 base::WeakPtrFactory<OfflinePageMetadataStoreImpl> weak_ptr_factory_; | 69 base::WeakPtrFactory<OfflinePageMetadataStoreImpl> weak_ptr_factory_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(OfflinePageMetadataStoreImpl); | 71 DISALLOW_COPY_AND_ASSIGN(OfflinePageMetadataStoreImpl); |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace offline_pages | 74 } // namespace offline_pages |
| 75 | 75 |
| 76 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_IMPL_H_ | 76 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_IMPL_H_ |
| OLD | NEW |