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

Unified Diff: components/copresence/handlers/directive_handler.cc

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/directive_handler.cc
diff --git a/components/copresence/handlers/directive_handler.cc b/components/copresence/handlers/directive_handler.cc
index e76dde6fed26116274c1e57ef3403717f132d058..ae0bd306140bb3e7ba66a8200904aca353495e62 100644
--- a/components/copresence/handlers/directive_handler.cc
+++ b/components/copresence/handlers/directive_handler.cc
@@ -4,6 +4,7 @@
#include "components/copresence/handlers/directive_handler.h"
+#include "base/logging.h"
#include "base/time/time.h"
#include "components/copresence/handlers/audio/audio_directive_handler.h"
#include "components/copresence/proto/data.pb.h"
@@ -13,10 +14,10 @@ namespace copresence {
DirectiveHandler::DirectiveHandler() {}
void DirectiveHandler::Initialize(
- const AudioRecorder::DecodeSamplesCallback& decode_cb,
- const AudioDirectiveHandler::EncodeTokenCallback& encode_cb) {
- audio_handler_.reset(new AudioDirectiveHandler(decode_cb, encode_cb));
- audio_handler_->Initialize();
+ const AudioManager::DecodeSamplesCallback& decode_cb,
+ const AudioManager::EncodeTokenCallback& encode_cb) {
+ audio_handler_.reset(new AudioDirectiveHandler());
+ audio_handler_->Initialize(decode_cb, encode_cb);
}
DirectiveHandler::~DirectiveHandler() {
@@ -53,12 +54,8 @@ void DirectiveHandler::RemoveDirectives(const std::string& op_id) {
audio_handler_->RemoveInstructions(op_id);
}
-const std::string& DirectiveHandler::CurrentAudibleToken() const {
- return audio_handler_->PlayingAudibleToken();
-}
-
-const std::string& DirectiveHandler::CurrentInaudibleToken() const {
- return audio_handler_->PlayingInaudibleToken();
+const std::string DirectiveHandler::GetCurrentAudioToken(AudioType type) const {
+ return audio_handler_->PlayingToken(type);
}
} // namespace copresence
« no previous file with comments | « components/copresence/handlers/directive_handler.h ('k') | components/copresence/mediums/audio/audio_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698