| OLD | NEW |
| 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_BACKGROUND_REQUEST_QUEUE_STORE_SQL_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_SQL_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_SQL_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_SQL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // SQLite implementation of RequestQueueStore. | 27 // SQLite implementation of RequestQueueStore. |
| 28 class RequestQueueStoreSQL : public RequestQueueStore { | 28 class RequestQueueStoreSQL : public RequestQueueStore { |
| 29 public: | 29 public: |
| 30 RequestQueueStoreSQL( | 30 RequestQueueStoreSQL( |
| 31 scoped_refptr<base::SequencedTaskRunner> background_task_runner, | 31 scoped_refptr<base::SequencedTaskRunner> background_task_runner, |
| 32 const base::FilePath& database_dir); | 32 const base::FilePath& database_dir); |
| 33 ~RequestQueueStoreSQL() override; | 33 ~RequestQueueStoreSQL() override; |
| 34 | 34 |
| 35 // RequestQueueStore implementation. | 35 // RequestQueueStore implementation. |
| 36 void GetRequests(const GetRequestsCallback& callback) override; | 36 void GetRequests(const GetRequestsCallback& callback) override; |
| 37 void AddRequest(const SavePageRequest& offline_page, |
| 38 const AddCallback& callback) override; |
| 37 void AddOrUpdateRequest(const SavePageRequest& offline_page, | 39 void AddOrUpdateRequest(const SavePageRequest& offline_page, |
| 38 const UpdateCallback& callback) override; | 40 const UpdateCallback& callback) override; |
| 39 void RemoveRequests(const std::vector<int64_t>& request_ids, | 41 void RemoveRequests(const std::vector<int64_t>& request_ids, |
| 40 const RemoveCallback& callback) override; | 42 const RemoveCallback& callback) override; |
| 41 void ChangeRequestsState( | 43 void ChangeRequestsState( |
| 42 const std::vector<int64_t>& request_ids, | 44 const std::vector<int64_t>& request_ids, |
| 43 const SavePageRequest::RequestState new_state, | 45 const SavePageRequest::RequestState new_state, |
| 44 const UpdateMultipleRequestsCallback& callback) override; | 46 const UpdateMultipleRequestsCallback& callback) override; |
| 45 void Reset(const ResetCallback& callback) override; | 47 void Reset(const ResetCallback& callback) override; |
| 46 | 48 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 64 // Database connection. | 66 // Database connection. |
| 65 std::unique_ptr<sql::Connection> db_; | 67 std::unique_ptr<sql::Connection> db_; |
| 66 | 68 |
| 67 base::WeakPtrFactory<RequestQueueStoreSQL> weak_ptr_factory_; | 69 base::WeakPtrFactory<RequestQueueStoreSQL> weak_ptr_factory_; |
| 68 DISALLOW_COPY_AND_ASSIGN(RequestQueueStoreSQL); | 70 DISALLOW_COPY_AND_ASSIGN(RequestQueueStoreSQL); |
| 69 }; | 71 }; |
| 70 | 72 |
| 71 } // namespace offline_pages | 73 } // namespace offline_pages |
| 72 | 74 |
| 73 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_SQL_H_ | 75 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_STORE_SQL_H_ |
| OLD | NEW |