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

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

Issue 453793002: Add audible support to the copresence API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 01658528ff41e3c8bede15ab9f721510fd92ec81..a7ca573ed4c13e901e1e535eb172d4a26fc0cda4 100644
--- a/components/copresence/handlers/directive_handler.cc
+++ b/components/copresence/handlers/directive_handler.cc
@@ -27,12 +27,14 @@ void DirectiveHandler::AddDirective(const Directive& directive) {
DCHECK_EQ(directive.instruction_type(), TOKEN);
const TokenInstruction& ti = directive.token_instruction();
- // We currently only support audio.
- DCHECK_EQ(ti.medium(), AUDIO_ULTRASOUND_PASSBAND);
DCHECK(audio_handler_.get()) << "Clients must call Initialize() before "
<< "any other DirectiveHandler methods.";
- audio_handler_->AddInstruction(
- ti, base::TimeDelta::FromMilliseconds(directive.ttl_millis()));
+ // We currently only support audio.
+ if (ti.medium() == AUDIO_ULTRASOUND_PASSBAND ||
+ ti.medium() == AUDIO_AUDIBLE_DTMF) {
+ audio_handler_->AddInstruction(
+ ti, base::TimeDelta::FromMilliseconds(directive.ttl_millis()));
+ }
}
void DirectiveHandler::RemoveDirectives(const std::string& /* op_id */) {

Powered by Google App Engine
This is Rietveld 408576698