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

Unified Diff: components/offline_pages/offline_page_model_impl.h

Issue 2340133005: Merge M54: Support serving offline page by offline ID (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: components/offline_pages/offline_page_model_impl.h
diff --git a/components/offline_pages/offline_page_model_impl.h b/components/offline_pages/offline_page_model_impl.h
index 566eb3df9df123104fff83025c9c00929dd8051e..2e8729c920056d859fc793d1f4241d5e7139abc3 100644
--- a/components/offline_pages/offline_page_model_impl.h
+++ b/components/offline_pages/offline_page_model_impl.h
@@ -24,6 +24,7 @@
#include "base/observer_list.h"
#include "base/optional.h"
#include "base/strings/string16.h"
+#include "base/time/time.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/offline_pages/offline_page_archiver.h"
#include "components/offline_pages/offline_page_metadata_store.h"
@@ -34,8 +35,8 @@
class GURL;
namespace base {
+class Clock;
class SequencedTaskRunner;
-class Time;
class TimeDelta;
class TimeTicks;
} // namespace base
@@ -114,6 +115,7 @@ class OfflinePageModelImpl : public OfflinePageModel, public KeyedService {
// Methods for testing only:
OfflinePageMetadataStore* GetStoreForTesting();
+ void set_testing_clock(base::Clock* clock) { testing_clock_ = clock; }
OfflinePageStorageManager* GetStorageManager();
@@ -267,6 +269,8 @@ class OfflinePageModelImpl : public OfflinePageModel, public KeyedService {
void RunWhenLoaded(const base::Closure& job);
+ base::Time GetCurrentTime() const;
+
// Persistent store for offline page metadata.
std::unique_ptr<OfflinePageMetadataStore> store_;
@@ -300,6 +304,10 @@ class OfflinePageModelImpl : public OfflinePageModel, public KeyedService {
// Logger to facilitate recording of events.
OfflinePageModelEventLogger offline_event_logger_;
+ // Clock for getting time in testing code. The setter is responsible to reset
+ // it once it is not longer needed.
+ base::Clock* testing_clock_;
+
base::WeakPtrFactory<OfflinePageModelImpl> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(OfflinePageModelImpl);
« no previous file with comments | « components/offline_pages/downloads/download_ui_adapter.cc ('k') | components/offline_pages/offline_page_model_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698