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

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

Issue 764673003: Adding CopresenceState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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_handler_impl.h
diff --git a/components/copresence/handlers/audio/audio_directive_handler_impl.h b/components/copresence/handlers/audio/audio_directive_handler_impl.h
index c9a91499da950d8094b3020c04ad9570d327912c..f9ddc0d7c9c5c8455fbf47af46376439d7dd488f 100644
--- a/components/copresence/handlers/audio/audio_directive_handler_impl.h
+++ b/components/copresence/handlers/audio/audio_directive_handler_impl.h
@@ -12,6 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "components/copresence/handlers/audio/audio_directive_handler.h"
+#include "components/copresence/public/copresence_constants.h"
namespace base {
class TimeTicks;
@@ -36,19 +37,21 @@ class TickClockRefCounted;
// of this class.
class AudioDirectiveHandlerImpl final : public AudioDirectiveHandler {
public:
- AudioDirectiveHandlerImpl();
- AudioDirectiveHandlerImpl(scoped_ptr<AudioManager> audio_manager,
- scoped_ptr<base::Timer> timer,
- const scoped_refptr<TickClockRefCounted>& clock);
+ explicit AudioDirectiveHandlerImpl(
+ const DirectivesCallback& update_directives_callback);
+ AudioDirectiveHandlerImpl(
+ const DirectivesCallback& update_directives_callback,
+ scoped_ptr<AudioManager> audio_manager,
+ scoped_ptr<base::Timer> timer,
+ const scoped_refptr<TickClockRefCounted>& clock);
- ~AudioDirectiveHandlerImpl();
+ ~AudioDirectiveHandlerImpl() override;
// AudioDirectiveHandler overrides:
void Initialize(WhispernetClient* whispernet_client,
const TokensCallback& tokens_cb) override;
- void AddInstruction(const copresence::TokenInstruction& instruction,
- const std::string& op_id,
- base::TimeDelta ttl) override;
+ void AddInstruction(const Directive& directive,
+ const std::string& op_id) override;
void RemoveInstructions(const std::string& op_id) override;
const std::string PlayingToken(AudioType type) const override;
bool IsPlayingTokenHeard(AudioType type) const override;
@@ -63,8 +66,8 @@ class AudioDirectiveHandlerImpl final : public AudioDirectiveHandler {
// instructions. If we don't have any active instructions, returns false.
bool GetNextInstructionExpiry(base::TimeTicks* next_event);
+ DirectivesCallback update_directives_callback_;
scoped_ptr<AudioManager> audio_manager_;
-
scoped_ptr<base::Timer> audio_event_timer_;
scoped_refptr<TickClockRefCounted> clock_;
@@ -73,7 +76,6 @@ class AudioDirectiveHandlerImpl final : public AudioDirectiveHandler {
ScopedVector<AudioDirectiveList> transmits_lists_;
ScopedVector<AudioDirectiveList> receives_lists_;
-
DISALLOW_COPY_AND_ASSIGN(AudioDirectiveHandlerImpl);
};

Powered by Google App Engine
This is Rietveld 408576698