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

Unified Diff: content/browser/media/audio_stream_monitor.h

Issue 670623002: Change base::TickClock to a ref counted class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@audio_redesign
Patch Set: y Created 6 years, 2 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/media/audio_stream_monitor.h
diff --git a/content/browser/media/audio_stream_monitor.h b/content/browser/media/audio_stream_monitor.h
index d1a32d5f857b05925f884ef64d834e673c8c5f29..149dd3e2371a8942b01685e5c15fa970ef9b18d6 100644
--- a/content/browser/media/audio_stream_monitor.h
+++ b/content/browser/media/audio_stream_monitor.h
@@ -11,6 +11,7 @@
#include "base/callback_forward.h"
#include "base/threading/thread_checker.h"
#include "base/time/default_tick_clock.h"
+#include "base/time/tick_clock.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "build/build_config.h"
@@ -112,15 +113,17 @@ class CONTENT_EXPORT AudioStreamMonitor {
// on, |off_timer_| is started to re-invoke this method in the future.
void MaybeToggle();
+ void set_clock_for_testing(const scoped_refptr<base::TickClock>& clock) {
+ clock_ = clock;
+ }
+
// The WebContents instance instance to receive indicator toggle
// notifications. This pointer should be valid for the lifetime of
// AudioStreamMonitor.
WebContents* const web_contents_;
- // Note: |clock_| is always |&default_tick_clock_|, except during unit
- // testing.
- base::DefaultTickClock default_tick_clock_;
- base::TickClock* const clock_;
+ // Note: |clock_| is always a DefaultTickClock(), except during unit testing.
+ scoped_refptr<base::TickClock> clock_;
// Confirms single-threaded access in debug builds.
base::ThreadChecker thread_checker_;
« no previous file with comments | « components/network_time/network_time_tracker_unittest.cc ('k') | content/browser/media/audio_stream_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698