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

Unified Diff: content/browser/service_worker/service_worker_version.h

Issue 2555333006: Deflake origin trial token validator tests (Closed)
Patch Set: Switch WrapUnique to MakeUnique Created 3 years, 4 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: content/browser/service_worker/service_worker_version.h
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h
index 57be8c26baa3a4637d4b6e3d23f507521212a44a..4c455a9b705cb6114bcc68909afd74c295e6851e 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -25,6 +25,7 @@
#include "base/observer_list.h"
#include "base/optional.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/time/clock.h"
#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
@@ -392,6 +393,9 @@ class CONTENT_EXPORT ServiceWorkerVersion
// Used to allow tests to change time for testing.
void SetTickClockForTesting(std::unique_ptr<base::TickClock> tick_clock);
+ // Used to allow tests to change wall clock for testing.
+ void SetClockForTesting(std::unique_ptr<base::Clock> clock);
+
// Returns true if the service worker has work to do: it has pending
// requests, in-progress streaming URLRequestJobs, or pending start callbacks.
bool HasWork() const;
@@ -794,6 +798,9 @@ class CONTENT_EXPORT ServiceWorkerVersion
// The clock used to vend tick time.
std::unique_ptr<base::TickClock> tick_clock_;
+ // The clock used for actual (wall clock) time
+ std::unique_ptr<base::Clock> clock_;
+
std::unique_ptr<PingController> ping_controller_;
// Used for recording worker activities (e.g., a ratio of handled events)
« no previous file with comments | « content/browser/service_worker/link_header_support.cc ('k') | content/browser/service_worker/service_worker_version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698