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

Issue 690213004: Refactoring AudioDirectiveHandler to support testing (Closed)

Created:
6 years, 1 month ago by Charlie
Modified:
6 years, 1 month ago
Reviewers:
rkc
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Refactoring AudioDirectiveHandler to support testing Committed: https://crrev.com/63d3aa3c66b77df08c0143e18f983bb6747967e0 Cr-Commit-Position: refs/heads/master@{#302531}

Patch Set 1 #

Patch Set 2 : Fixing crash #

Total comments: 14

Patch Set 3 : Review fixes #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : Merging to head #

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+171 lines, -416 lines) Patch
M components/copresence.gypi View 1 chunk +2 lines, -1 line 0 comments Download
M components/copresence/BUILD.gn View 1 chunk +2 lines, -1 line 0 comments Download
M components/copresence/handlers/audio/audio_directive_handler.h View 1 chunk +13 lines, -61 lines 0 comments Download
D components/copresence/handlers/audio/audio_directive_handler.cc View 1 chunk +0 lines, -179 lines 0 comments Download
A + components/copresence/handlers/audio/audio_directive_handler_impl.h View 3 chunks +28 lines, -34 lines 0 comments Download
A + components/copresence/handlers/audio/audio_directive_handler_impl.cc View 1 2 7 chunks +61 lines, -53 lines 0 comments Download
M components/copresence/handlers/audio/audio_directive_handler_unittest.cc View 1 2 6 chunks +28 lines, -35 lines 0 comments Download
M components/copresence/handlers/audio/audio_directive_list.h View 1 2 3 chunks +5 lines, -5 lines 0 comments Download
M components/copresence/handlers/audio/audio_directive_list.cc View 3 chunks +17 lines, -35 lines 0 comments Download
M components/copresence/handlers/audio/audio_directive_list_unittest.cc View 1 2 3 4 1 chunk +1 line, -3 lines 0 comments Download
M components/copresence/handlers/audio/tick_clock_ref_counted.h View 2 chunks +6 lines, -2 lines 0 comments Download
M components/copresence/handlers/audio/tick_clock_ref_counted.cc View 1 chunk +6 lines, -5 lines 0 comments Download
M components/copresence/handlers/directive_handler.cc View 1 2 3 4 5 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 13 (2 generated)
Charlie
I had already started this, so might as well keep the refactoring in a separate ...
6 years, 1 month ago (2014-10-31 20:38:52 UTC) #2
Charlie
https://codereview.chromium.org/690213004/diff/20001/components/copresence/handlers/audio/audio_directive_list.h File components/copresence/handlers/audio/audio_directive_list.h (right): https://codereview.chromium.org/690213004/diff/20001/components/copresence/handlers/audio/audio_directive_list.h#newcode46 components/copresence/handlers/audio/audio_directive_list.h:46: explicit AudioDirectiveList(const scoped_refptr<TickClockRefCounted>& clock = I think we're always ...
6 years, 1 month ago (2014-10-31 20:55:17 UTC) #3
rkc
https://codereview.chromium.org/690213004/diff/20001/components/copresence/handlers/audio/audio_directive_handler_impl.cc File components/copresence/handlers/audio/audio_directive_handler_impl.cc (right): https://codereview.chromium.org/690213004/diff/20001/components/copresence/handlers/audio/audio_directive_handler_impl.cc#newcode58 components/copresence/handlers/audio/audio_directive_handler_impl.cc:58: transmits_lists_.push_back(new AudioDirectiveList(clock)); Why aren't these in the Initialize function? ...
6 years, 1 month ago (2014-11-03 20:14:43 UTC) #4
Charlie
https://codereview.chromium.org/690213004/diff/20001/components/copresence/handlers/audio/audio_directive_handler_impl.cc File components/copresence/handlers/audio/audio_directive_handler_impl.cc (right): https://codereview.chromium.org/690213004/diff/20001/components/copresence/handlers/audio/audio_directive_handler_impl.cc#newcode58 components/copresence/handlers/audio/audio_directive_handler_impl.cc:58: transmits_lists_.push_back(new AudioDirectiveList(clock)); On 2014/11/03 20:14:43, Rahul Chaturvedi wrote: > ...
6 years, 1 month ago (2014-11-03 22:45:13 UTC) #5
rkc
lgtm https://codereview.chromium.org/690213004/diff/20001/components/copresence/handlers/audio/audio_directive_handler_impl.cc File components/copresence/handlers/audio/audio_directive_handler_impl.cc (right): https://codereview.chromium.org/690213004/diff/20001/components/copresence/handlers/audio/audio_directive_handler_impl.cc#newcode85 components/copresence/handlers/audio/audio_directive_handler_impl.cc:85: case AUDIO_ULTRASOUND_PASSBAND: On 2014/11/03 22:45:13, Charlie wrote: > ...
6 years, 1 month ago (2014-11-03 22:52:15 UTC) #6
Charlie
https://codereview.chromium.org/690213004/diff/20001/components/copresence/handlers/audio/audio_directive_handler_impl.cc File components/copresence/handlers/audio/audio_directive_handler_impl.cc (right): https://codereview.chromium.org/690213004/diff/20001/components/copresence/handlers/audio/audio_directive_handler_impl.cc#newcode85 components/copresence/handlers/audio/audio_directive_handler_impl.cc:85: case AUDIO_ULTRASOUND_PASSBAND: On 2014/11/03 22:52:15, Rahul Chaturvedi wrote: > ...
6 years, 1 month ago (2014-11-03 23:08:59 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/690213004/120001
6 years, 1 month ago (2014-11-03 23:53:17 UTC) #9
rkc
https://codereview.chromium.org/690213004/diff/20001/components/copresence/handlers/audio/audio_directive_handler_impl.cc File components/copresence/handlers/audio/audio_directive_handler_impl.cc (right): https://codereview.chromium.org/690213004/diff/20001/components/copresence/handlers/audio/audio_directive_handler_impl.cc#newcode85 components/copresence/handlers/audio/audio_directive_handler_impl.cc:85: case AUDIO_ULTRASOUND_PASSBAND: On 2014/11/03 23:08:58, Charlie wrote: > On ...
6 years, 1 month ago (2014-11-04 00:37:22 UTC) #10
commit-bot: I haz the power
Committed patchset #7 (id:120001)
6 years, 1 month ago (2014-11-04 00:45:51 UTC) #11
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/63d3aa3c66b77df08c0143e18f983bb6747967e0 Cr-Commit-Position: refs/heads/master@{#302531}
6 years, 1 month ago (2014-11-04 00:47:08 UTC) #12
Charlie
6 years, 1 month ago (2014-11-04 01:07:47 UTC) #13
Message was sent while issue was closed.
https://codereview.chromium.org/690213004/diff/20001/components/copresence/ha...
File components/copresence/handlers/audio/audio_directive_handler_impl.cc
(right):

https://codereview.chromium.org/690213004/diff/20001/components/copresence/ha...
components/copresence/handlers/audio/audio_directive_handler_impl.cc:85: case
AUDIO_ULTRASOUND_PASSBAND:
On 2014/11/04 00:37:22, Rahul Chaturvedi wrote:
> On 2014/11/03 23:08:58, Charlie wrote:
> > On 2014/11/03 22:52:15, Rahul Chaturvedi wrote:
> > > On 2014/11/03 22:45:13, Charlie wrote:
> > > > On 2014/11/03 20:14:43, Rahul Chaturvedi wrote:
> > > > > DCHECK(transmits_lists_[INAUDIBLE]);
> > > > > Then audible and receive lists below.
> > > > 
> > > > I'm not sure this checks for the thing you want. It only verifies that
the
> > > > AudioDirectiveList pointer, as long as it's already in the vector, is
not
> > > null.
> > > > If the vector index is out of range, std::vector will throw an error:
> > > > 
> > > >
> > >
> >
>
https://code.google.com/p/chromium/codesearch#chromium/usr/include/c%2B%2B/4....
> > > > 
> > > 
> > > This is true. So lets DCHECK the vector size then. I want us to ensure
that
> if
> > > we get here without running initialize, we have a DCHECK to catch it.
> > 
> > The check inside of std::vector already does what you want. It stack traces
> with
> > a clear out-of-bounds error message. Presumably, like DCHECK, it is only
> enabled
> > in debug mode.
> 
> I dislike depending on platform specific implementations of a language,
> particularly in multi-platform code.
> Do get this DCHECK in another CL, or if you upload another rev to this CL.

In principle I agree, although since this is only a debug check, we would have
to be running a debug build on a non-glibc platform for it to matter. Which
seems like it will not be happening anytime soon. I hope to have moved the
DirectiveList initialization to a delegated constructor before then.

However this is a simple fix in the meantime. CL forthcoming.

Powered by Google App Engine
This is Rietveld 408576698