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

Unified Diff: components/copresence/handlers/audio/audio_directive_list.h

Issue 690213004: Refactoring AudioDirectiveHandler to support testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/copresence/handlers/audio/audio_directive_list.h
diff --git a/components/copresence/handlers/audio/audio_directive_list.h b/components/copresence/handlers/audio/audio_directive_list.h
index aa71a994e30f697dbcc661c6d5340cbb556bbf70..c0b170b60dae07eda85a785af9feabf9a7253368 100644
--- a/components/copresence/handlers/audio/audio_directive_list.h
+++ b/components/copresence/handlers/audio/audio_directive_list.h
@@ -8,11 +8,12 @@
#include <string>
#include <vector>
-#include "base/callback.h"
-#include "base/macros.h"
+#include "base/callback_forward.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "base/time/default_tick_clock.h"
#include "base/time/time.h"
+#include "components/copresence/handlers/audio/tick_clock_ref_counted.h"
namespace media {
class AudioBusRefCounted;
@@ -41,7 +42,8 @@ struct AudioDirective final {
// classes from it.
class AudioDirectiveList {
public:
- AudioDirectiveList();
+ explicit AudioDirectiveList(const scoped_refptr<TickClockRefCounted>& clock =
+ make_scoped_refptr(new TickClockRefCounted(new base::DefaultTickClock)));
~AudioDirectiveList();
void AddDirective(const std::string& op_id, base::TimeDelta ttl);
@@ -49,8 +51,6 @@ class AudioDirectiveList {
scoped_ptr<AudioDirective> GetActiveDirective();
- void set_clock_for_testing(const scoped_refptr<TickClockRefCounted>& clock);
-
private:
// Comparator for comparing end_times on audio tokens.
class LatestFirstComparator {

Powered by Google App Engine
This is Rietveld 408576698