Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: components/offline_pages/offline_page_metadata_store_sql.h

Issue 2339693002: [Offline pages] Splitting Add and Update methods in OPMStore (Closed)
Patch Set: Addressing feedback Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_SQL_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_SQL_H_
6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_SQL_H_ 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_SQL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // move data from old table (prefixed by temp_) to the new one. 52 // move data from old table (prefixed by temp_) to the new one.
53 class OfflinePageMetadataStoreSQL : public OfflinePageMetadataStore { 53 class OfflinePageMetadataStoreSQL : public OfflinePageMetadataStore {
54 public: 54 public:
55 OfflinePageMetadataStoreSQL( 55 OfflinePageMetadataStoreSQL(
56 scoped_refptr<base::SequencedTaskRunner> background_task_runner, 56 scoped_refptr<base::SequencedTaskRunner> background_task_runner,
57 const base::FilePath& database_dir); 57 const base::FilePath& database_dir);
58 ~OfflinePageMetadataStoreSQL() override; 58 ~OfflinePageMetadataStoreSQL() override;
59 59
60 // Implementation methods. 60 // Implementation methods.
61 void GetOfflinePages(const LoadCallback& callback) override; 61 void GetOfflinePages(const LoadCallback& callback) override;
62 void AddOrUpdateOfflinePage(const OfflinePageItem& offline_page, 62 void AddOfflinePage(const OfflinePageItem& offline_page,
63 const UpdateCallback& callback) override; 63 const AddCallback& callback) override;
64 void UpdateOfflinePages(const std::vector<OfflinePageItem>& pages,
65 const UpdateCallback& callback) override;
64 void RemoveOfflinePages(const std::vector<int64_t>& offline_ids, 66 void RemoveOfflinePages(const std::vector<int64_t>& offline_ids,
65 const UpdateCallback& callback) override; 67 const UpdateCallback& callback) override;
66 void Reset(const ResetCallback& callback) override; 68 void Reset(const ResetCallback& callback) override;
67 StoreState state() const override; 69 StoreState state() const override;
68 70
69 private: 71 private:
70 // Used to initialize DB connection. 72 // Used to initialize DB connection.
71 void OpenConnection(); 73 void OpenConnection();
72 void OnOpenConnectionDone(StoreState state); 74 void OnOpenConnectionDone(StoreState state);
73 75
(...skipping 18 matching lines...) Expand all
92 StoreState state_; 94 StoreState state_;
93 95
94 base::WeakPtrFactory<OfflinePageMetadataStoreSQL> weak_ptr_factory_; 96 base::WeakPtrFactory<OfflinePageMetadataStoreSQL> weak_ptr_factory_;
95 97
96 DISALLOW_COPY_AND_ASSIGN(OfflinePageMetadataStoreSQL); 98 DISALLOW_COPY_AND_ASSIGN(OfflinePageMetadataStoreSQL);
97 }; 99 };
98 100
99 } // namespace offline_pages 101 } // namespace offline_pages
100 102
101 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_SQL_H_ 103 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_SQL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698