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

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

Issue 637223011: Redesign the copresence audio handlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: 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: 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 9edd89f49b07c7ced741e44c62d9415989c555ee..e9d0634204d7a7f3d7b9d857a6b8cb58fb9a3189 100644
--- a/components/copresence/handlers/audio/audio_directive_list.h
+++ b/components/copresence/handlers/audio/audio_directive_list.h
@@ -13,19 +13,25 @@
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
+namespace base {
+class TickClock;
+}
+
namespace media {
class AudioBusRefCounted;
}
namespace copresence {
-struct AudioDirective {
+struct AudioDirective final {
// Default ctor, required by the priority queue.
AudioDirective();
- AudioDirective(const std::string& op_id, base::Time end_time);
+ AudioDirective(const std::string& op_id, base::TimeTicks end_time);
std::string op_id;
- base::Time end_time;
+ // We're currently using TimeTicks to track time. This may not work for cases
+ // where your machine suspends. See crbug.com/426136
+ base::TimeTicks end_time;
};
// This class maintains a list of active audio directives. It fetches the audio
@@ -37,7 +43,7 @@ struct AudioDirective {
class AudioDirectiveList {
public:
AudioDirectiveList();
- virtual ~AudioDirectiveList();
+ ~AudioDirectiveList();
void AddDirective(const std::string& op_id, base::TimeDelta ttl);
void RemoveDirective(const std::string& op_id);
@@ -62,6 +68,8 @@ class AudioDirectiveList {
// element. Only currently active directives will exist in this list.
std::vector<AudioDirective> active_directives_;
+ scoped_ptr<base::TickClock> clock_;
+
DISALLOW_COPY_AND_ASSIGN(AudioDirectiveList);
};

Powered by Google App Engine
This is Rietveld 408576698