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

Unified Diff: components/doodle/doodle_service.h

Issue 2760253003: [Doodle] Record UMA for DoodleConfig download outcome and time (Closed)
Patch Set: Created 3 years, 9 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/doodle/doodle_service.h
diff --git a/components/doodle/doodle_service.h b/components/doodle/doodle_service.h
index 3b519f8d06ede7eadd328a4e6fcdd6b6427ab955..db8487052065f853addcfbee5f3601f640073636 100644
--- a/components/doodle/doodle_service.h
+++ b/components/doodle/doodle_service.h
@@ -11,6 +11,7 @@
#include "base/observer_list.h"
#include "base/optional.h"
#include "base/time/clock.h"
+#include "base/time/tick_clock.h"
#include "base/timer/timer.h"
#include "components/doodle/doodle_fetcher.h"
#include "components/doodle/doodle_types.h"
@@ -38,7 +39,8 @@ class DoodleService : public KeyedService {
DoodleService(PrefService* pref_service,
std::unique_ptr<DoodleFetcher> fetcher,
std::unique_ptr<base::OneShotTimer> expiry_timer,
- std::unique_ptr<base::Clock> clock);
+ std::unique_ptr<base::Clock> clock,
+ std::unique_ptr<base::TickClock> tick_clock);
~DoodleService() override;
// KeyedService implementation.
@@ -62,11 +64,14 @@ class DoodleService : public KeyedService {
private:
// Callback for the fetcher.
- void DoodleFetched(DoodleState state,
+ void DoodleFetched(base::TimeTicks start_time,
+ DoodleState state,
base::TimeDelta time_to_live,
const base::Optional<DoodleConfig>& doodle_config);
- void UpdateCachedConfig(base::TimeDelta time_to_live,
+ void UpdateCachedConfig(base::Optional<base::TimeDelta> download_time,
+ DoodleState state,
+ base::TimeDelta time_to_live,
const base::Optional<DoodleConfig>& doodle_config);
// Callback for the expiry timer.
@@ -79,6 +84,7 @@ class DoodleService : public KeyedService {
std::unique_ptr<base::OneShotTimer> expiry_timer_;
std::unique_ptr<base::Clock> clock_;
+ std::unique_ptr<base::TickClock> tick_clock_;
// The result of the last network fetch.
base::Optional<DoodleConfig> cached_config_;

Powered by Google App Engine
This is Rietveld 408576698