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

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

Issue 2089413002: [Offline Pages] Create a event/activity logger (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address initial comments Created 4 years, 5 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_MODEL_IMPL_H_ 5 #ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_
6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ 6 #define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <memory> 11 #include <memory>
12 #include <set> 12 #include <set>
13 #include <string> 13 #include <string>
14 #include <utility> 14 #include <utility>
15 #include <vector> 15 #include <vector>
16 16
17 #include "base/callback.h" 17 #include "base/callback.h"
18 #include "base/files/file_path.h" 18 #include "base/files/file_path.h"
19 #include "base/gtest_prod_util.h" 19 #include "base/gtest_prod_util.h"
20 #include "base/macros.h" 20 #include "base/macros.h"
21 #include "base/memory/ref_counted.h" 21 #include "base/memory/ref_counted.h"
22 #include "base/memory/scoped_vector.h" 22 #include "base/memory/scoped_vector.h"
23 #include "base/memory/weak_ptr.h" 23 #include "base/memory/weak_ptr.h"
24 #include "base/observer_list.h" 24 #include "base/observer_list.h"
25 #include "base/optional.h" 25 #include "base/optional.h"
26 #include "components/keyed_service/core/keyed_service.h" 26 #include "components/keyed_service/core/keyed_service.h"
27 #include "components/offline_pages/offline_page_archiver.h" 27 #include "components/offline_pages/offline_page_archiver.h"
28 #include "components/offline_pages/offline_page_metadata_store.h" 28 #include "components/offline_pages/offline_page_metadata_store.h"
29 #include "components/offline_pages/offline_page_model.h" 29 #include "components/offline_pages/offline_page_model.h"
30 #include "components/offline_pages/offline_page_model_event_logger.h"
30 #include "components/offline_pages/offline_page_storage_manager.h" 31 #include "components/offline_pages/offline_page_storage_manager.h"
31 #include "components/offline_pages/offline_page_types.h" 32 #include "components/offline_pages/offline_page_types.h"
32 33
33 class GURL; 34 class GURL;
34 namespace base { 35 namespace base {
35 class SequencedTaskRunner; 36 class SequencedTaskRunner;
36 class Time; 37 class Time;
37 class TimeDelta; 38 class TimeDelta;
38 class TimeTicks; 39 class TimeTicks;
39 } // namespace base 40 } // namespace base
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 const base::Callback<void(bool)>& callback) override; 110 const base::Callback<void(bool)>& callback) override;
110 ClientPolicyController* GetPolicyController() override; 111 ClientPolicyController* GetPolicyController() override;
111 112
112 // Methods for testing only: 113 // Methods for testing only:
113 OfflinePageMetadataStore* GetStoreForTesting(); 114 OfflinePageMetadataStore* GetStoreForTesting();
114 115
115 OfflinePageStorageManager* GetStorageManager(); 116 OfflinePageStorageManager* GetStorageManager();
116 117
117 bool is_loaded() const override; 118 bool is_loaded() const override;
118 119
120 OfflineEventLogger* GetLogger() override;
121
119 protected: 122 protected:
120 // Adding a protected constructor for testing-only purposes in 123 // Adding a protected constructor for testing-only purposes in
121 // offline_page_storage_manager_unittest.cc 124 // offline_page_storage_manager_unittest.cc
122 OfflinePageModelImpl(); 125 OfflinePageModelImpl();
123 126
124 private: 127 private:
125 FRIEND_TEST_ALL_PREFIXES(OfflinePageModelImplTest, MarkPageForDeletion); 128 FRIEND_TEST_ALL_PREFIXES(OfflinePageModelImplTest, MarkPageForDeletion);
126 129
127 typedef ScopedVector<OfflinePageArchiver> PendingArchivers; 130 typedef ScopedVector<OfflinePageArchiver> PendingArchivers;
128 131
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 // Controller of the client policies. 269 // Controller of the client policies.
267 std::unique_ptr<ClientPolicyController> policy_controller_; 270 std::unique_ptr<ClientPolicyController> policy_controller_;
268 271
269 // Manager for the storage consumed by archives and responsible for 272 // Manager for the storage consumed by archives and responsible for
270 // automatic page clearing. 273 // automatic page clearing.
271 std::unique_ptr<OfflinePageStorageManager> storage_manager_; 274 std::unique_ptr<OfflinePageStorageManager> storage_manager_;
272 275
273 // Manager for the offline archive files and directory. 276 // Manager for the offline archive files and directory.
274 std::unique_ptr<ArchiveManager> archive_manager_; 277 std::unique_ptr<ArchiveManager> archive_manager_;
275 278
279 // Logger to facilitate recording of events.
280 OfflinePageModelEventLogger offline_event_logger_;
281
276 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_; 282 base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_;
277 283
278 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl); 284 DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl);
279 }; 285 };
280 286
281 } // namespace offline_pages 287 } // namespace offline_pages
282 288
283 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_ 289 #endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_MODEL_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698