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

Unified Diff: components/ntp_snippets/remote/remote_suggestions_provider.h

Issue 2569663004: [NTPSnippets] Switch from TickClock to Clock for storing the last background fetched time. (Closed)
Patch Set: Add a DCHECK to check that the num or args passed to the new method is 0 Created 4 years 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/ntp_snippets/remote/remote_suggestions_provider.h
diff --git a/components/ntp_snippets/remote/remote_suggestions_provider.h b/components/ntp_snippets/remote/remote_suggestions_provider.h
index 1c76a5862a7b95d1aab0cfb49257e2b5d742cd94..a4c2b7c179c08e9e31e2c99d458895caf35d1492 100644
--- a/components/ntp_snippets/remote/remote_suggestions_provider.h
+++ b/components/ntp_snippets/remote/remote_suggestions_provider.h
@@ -16,6 +16,7 @@
#include "base/callback_forward.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
+#include "base/time/clock.h"
#include "base/time/time.h"
#include "components/image_fetcher/image_fetcher_delegate.h"
#include "components/ntp_snippets/category.h"
@@ -152,8 +153,8 @@ class RemoteSuggestionsProvider final
}
// Overrides internal clock for testing purposes.
- void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock) {
- tick_clock_ = std::move(tick_clock);
+ void SetClockForTesting(std::unique_ptr<base::Clock> clock) {
+ clock_ = std::move(clock);
}
private:
@@ -415,8 +416,8 @@ class RemoteSuggestionsProvider final
// Request throttler for limiting requests to thumbnail images.
RequestThrottler thumbnail_requests_throttler_;
- // A clock for getting the time. This allows to inject a tick clock in tests.
- std::unique_ptr<base::TickClock> tick_clock_;
+ // A clock for getting the time. This allows to inject a clock in tests.
+ std::unique_ptr<base::Clock> clock_;
DISALLOW_COPY_AND_ASSIGN(RemoteSuggestionsProvider);
};
« no previous file with comments | « chrome/browser/ui/webui/snippets_internals_ui.cc ('k') | components/ntp_snippets/remote/remote_suggestions_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698