summaryrefslogtreecommitdiffstats
path: root/components/copresence
diff options
context:
space:
mode:
authorckehoe <ckehoe@chromium.org>2014-11-03 18:40:52 -0800
committerCommit bot <commit-bot@chromium.org>2014-11-04 02:41:12 +0000
commit05dfaea411f15d8a23d3e2203d0cb9943a7041a4 (patch)
treee041a89a0836a29f9d1c69df6a90c8bce86acf02 /components/copresence
parent960939ae20f289d38da08b3f943c16e725deb339 (diff)
downloadchromium_src-05dfaea411f15d8a23d3e2203d0cb9943a7041a4.zip
chromium_src-05dfaea411f15d8a23d3e2203d0cb9943a7041a4.tar.gz
chromium_src-05dfaea411f15d8a23d3e2203d0cb9943a7041a4.tar.bz2
Checking that AudioDirectiveHandler::Initialize() gets called.
Review URL: https://codereview.chromium.org/703433003 Cr-Commit-Position: refs/heads/master@{#302555}
Diffstat (limited to 'components/copresence')
-rw-r--r--components/copresence/handlers/audio/audio_directive_handler_impl.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/copresence/handlers/audio/audio_directive_handler_impl.cc b/components/copresence/handlers/audio/audio_directive_handler_impl.cc
index e11e103..32c0970 100644
--- a/components/copresence/handlers/audio/audio_directive_handler_impl.cc
+++ b/components/copresence/handlers/audio/audio_directive_handler_impl.cc
@@ -75,6 +75,9 @@ void AudioDirectiveHandlerImpl::AddInstruction(
const TokenInstruction& instruction,
const std::string& op_id,
base::TimeDelta ttl) {
+ DCHECK(transmits_lists_.size() == 2u && receives_lists_.size() == 2u)
+ << "Call Initialize() before other AudioDirectiveHandler methods";
+
switch (instruction.token_instruction_type()) {
case TRANSMIT:
DVLOG(2) << "Audio Transmit Directive received. Token: "
@@ -118,6 +121,9 @@ void AudioDirectiveHandlerImpl::AddInstruction(
}
void AudioDirectiveHandlerImpl::RemoveInstructions(const std::string& op_id) {
+ DCHECK(transmits_lists_.size() == 2u && receives_lists_.size() == 2u)
+ << "Call Initialize() before other AudioDirectiveHandler methods";
+
transmits_lists_[AUDIBLE]->RemoveDirective(op_id);
transmits_lists_[INAUDIBLE]->RemoveDirective(op_id);
receives_lists_[AUDIBLE]->RemoveDirective(op_id);