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

Issue 8588030: Refactor the Get*Hardware* routines a bit. (Closed)

Created:
9 years, 1 month ago by tommi (sloooow) - chröme
Modified:
9 years, 1 month ago
CC:
chromium-reviews, hclam+watch_chromium.org, ddorwin+watch_chromium.org, fischman+watch_chromium.org, acolwell+watch_chromium.org, jam, annacc+watch_chromium.org, dpranke-watch+content_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr., vrk (LEFT CHROMIUM), scherkus (not reviewing), ihf+watch_chromium.org
Visibility:
Public.

Description

Refactor the Get*Hardware* routines a bit. These methods currently all have a static variable that caches the queried value. This causes a problem in unit tests where values can change between tests. I moved them outside of the AudioDevice class and grouped in their own namespace which owns the globally cached state and allows the cache to be invalidated. R=henrika TEST=Run *WebRTC* tests in content. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=110695

Patch Set 1 #

Total comments: 1

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 2

Patch Set 5 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+132 lines, -54 lines) Patch
M content/content_renderer.gypi View 1 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/media/audio_device.h View 1 1 chunk +0 lines, -3 lines 0 comments Download
M content/renderer/media/audio_device.cc View 1 1 chunk +0 lines, -22 lines 0 comments Download
A content/renderer/media/audio_hardware.h View 1 2 3 4 1 chunk +34 lines, -0 lines 0 comments Download
A content/renderer/media/audio_hardware.cc View 1 1 chunk +58 lines, -0 lines 0 comments Download
M content/renderer/media/webrtc_audio_device_impl.cc View 1 2 chunks +4 lines, -12 lines 0 comments Download
M content/renderer/media/webrtc_audio_device_unittest.cc View 1 2 3 4 8 chunks +15 lines, -7 lines 0 comments Download
M content/renderer/renderer_webkitplatformsupport_impl.cc View 1 2 chunks +3 lines, -2 lines 0 comments Download
M content/test/webrtc_audio_device_test.h View 1 chunk +1 line, -3 lines 0 comments Download
M content/test/webrtc_audio_device_test.cc View 1 2 3 6 chunks +15 lines, -5 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
tommi (sloooow) - chröme
9 years, 1 month ago (2011-11-17 12:03:15 UTC) #1
tommi (sloooow) - chröme
Adding crogers for AudioDevice changes, acolwell (media owner) and jamesr (content/renderer owner).
9 years, 1 month ago (2011-11-17 12:12:36 UTC) #2
henrika (OOO until Aug 14)
Refactor based on namespace and I'll review it again. audio_properties audio_hardware hardware_properties device_properties
9 years, 1 month ago (2011-11-17 12:27:33 UTC) #3
henrika (OOO until Aug 14)
http://codereview.chromium.org/8588030/diff/1/content/renderer/media/audio_device.h File content/renderer/media/audio_device.h (right): http://codereview.chromium.org/8588030/diff/1/content/renderer/media/audio_device.h#newcode175 content/renderer/media/audio_device.h:175: // Contains static methods to query hardware properties from ...
9 years, 1 month ago (2011-11-17 12:27:44 UTC) #4
tommi (sloooow) - chröme
Done. I moved the code to new files and into a namespace, audio_hardware.
9 years, 1 month ago (2011-11-17 13:06:52 UTC) #5
henrika (OOO until Aug 14)
LGTM. Check with Chris as well.
9 years, 1 month ago (2011-11-17 15:43:41 UTC) #6
acolwell GONE FROM CHROMIUM
LGTM w/ trybot compile fixes obviously.
9 years, 1 month ago (2011-11-17 16:38:47 UTC) #7
scherkus (not reviewing)
driveby nit on namespace nice change though! LGTM http://codereview.chromium.org/8588030/diff/2019/content/renderer/media/audio_hardware.h File content/renderer/media/audio_hardware.h (right): http://codereview.chromium.org/8588030/diff/2019/content/renderer/media/audio_hardware.h#newcode32 content/renderer/media/audio_hardware.h:32: }; ...
9 years, 1 month ago (2011-11-17 19:24:29 UTC) #8
jamesr
owners LGTM for content/renderer/renderer_webkitplatformsupport_impl.cc, did not look at the rest of the patch
9 years, 1 month ago (2011-11-17 19:29:39 UTC) #9
Chris Rogers
LGTM
9 years, 1 month ago (2011-11-17 20:50:14 UTC) #10
tommi (sloooow) - chröme
9 years, 1 month ago (2011-11-18 13:51:33 UTC) #11
Thanks everyone

http://codereview.chromium.org/8588030/diff/2019/content/renderer/media/audio...
File content/renderer/media/audio_hardware.h (right):

http://codereview.chromium.org/8588030/diff/2019/content/renderer/media/audio...
content/renderer/media/audio_hardware.h:32: };
On 2011/11/17 19:24:34, scherkus wrote:
> nit: namespaces should end w/o semicolon as well as comment denoting which
> namespace is ending
> 
> 
> }  // namespace audio_hardware

done.  (copy/paste oversight since this started out as a class)

Powered by Google App Engine
This is Rietveld 408576698