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

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

Issue 2484223005: Store original request URL in offline page metadata table (Closed)
Patch Set: Address feedback Created 4 years, 1 month 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_STUB_OFFLINE_PAGE_MODEL_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_
6 #define COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_ 6 #define COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "components/keyed_service/core/keyed_service.h" 12 #include "components/keyed_service/core/keyed_service.h"
13 #include "components/offline_pages/offline_page_model.h" 13 #include "components/offline_pages/offline_page_model.h"
14 14
15 namespace offline_pages { 15 namespace offline_pages {
16 16
17 // Stub implementation of OfflinePageModel interface for testing. Besides using 17 // Stub implementation of OfflinePageModel interface for testing. Besides using
18 // as a stub for tests, it may also be subclassed to mock specific methods 18 // as a stub for tests, it may also be subclassed to mock specific methods
19 // needed for a set of tests. 19 // needed for a set of tests.
20 class StubOfflinePageModel : public OfflinePageModel, public KeyedService { 20 class StubOfflinePageModel : public OfflinePageModel, public KeyedService {
21 public: 21 public:
22 StubOfflinePageModel(); 22 StubOfflinePageModel();
23 ~StubOfflinePageModel() override; 23 ~StubOfflinePageModel() override;
24 24
25 void AddObserver(Observer* observer) override; 25 void AddObserver(Observer* observer) override;
26 void RemoveObserver(Observer* observer) override; 26 void RemoveObserver(Observer* observer) override;
27 void SavePage(const GURL& url, 27 void SavePage(const SavePageParams& save_page_params,
28 const ClientId& client_id,
29 int64_t proposed_offline_id,
30 std::unique_ptr<OfflinePageArchiver> archiver, 28 std::unique_ptr<OfflinePageArchiver> archiver,
31 const SavePageCallback& callback) override; 29 const SavePageCallback& callback) override;
32 void MarkPageAccessed(int64_t offline_id) override; 30 void MarkPageAccessed(int64_t offline_id) override;
33 void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids, 31 void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids,
34 const DeletePageCallback& callback) override; 32 const DeletePageCallback& callback) override;
35 void DeletePagesByClientIds(const std::vector<ClientId>& client_ids, 33 void DeletePagesByClientIds(const std::vector<ClientId>& client_ids,
36 const DeletePageCallback& callback) override; 34 const DeletePageCallback& callback) override;
37 void GetPagesByClientIds( 35 void GetPagesByClientIds(
38 const std::vector<ClientId>& client_ids, 36 const std::vector<ClientId>& client_ids,
39 const MultipleOfflinePageItemCallback& callback) override; 37 const MultipleOfflinePageItemCallback& callback) override;
(...skipping 22 matching lines...) Expand all
62 bool is_loaded() const override; 60 bool is_loaded() const override;
63 OfflineEventLogger* GetLogger() override; 61 OfflineEventLogger* GetLogger() override;
64 62
65 private: 63 private:
66 std::vector<int64_t> offline_ids_; 64 std::vector<int64_t> offline_ids_;
67 }; 65 };
68 66
69 } // namespace offline_pages 67 } // namespace offline_pages
70 68
71 #endif // COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_ 69 #endif // COMPONENTS_OFFLINE_PAGES_STUB_OFFLINE_PAGE_MODEL_H_
OLDNEW
« no previous file with comments | « components/offline_pages/offline_page_model_impl_unittest.cc ('k') | components/offline_pages/stub_offline_page_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698