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

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

Issue 703433003: Checking that AudioDirectiveHandler::Initialize() gets called. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/copresence/handlers/audio/audio_directive_handler_impl.cc
diff --git a/components/copresence/handlers/audio/audio_directive_handler_impl.cc b/components/copresence/handlers/audio/audio_directive_handler_impl.cc
index e11e1035cb05bf714f46ebf4f67d4f85bfbf38e1..32c0970e839985ec8a0f1eff376dd2ec9b2f6fa3 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698