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

Issue 148553003: Clean up histogram'd media enum max values. (Closed)

Created:
6 years, 11 months ago by rileya (GONE FROM CHROMIUM)
Modified:
6 years, 9 months ago
CC:
chromium-reviews, fischman+watch_chromium.org, jam, mcasas+watch_chromium.org, joi+watch-content_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, piman+watch_chromium.org, wjia+watch_chromium.org, miu+watch_chromium.org, Ami GONE FROM CHROMIUM
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Clean up histogram'd media enum max values. This adds a PRESUBMIT test to src/media/ which enforces the following when using UMA_HISTOGRAM_ENUMERATION: - The max enum value should be suffixed with 'MAX' or 'Max' (and it should be equal to the largest valid entry ever logged). - One should be added to that max value when used in the UMA_HISTOGRAM_ENUMERATION macro. To handle past misuses of UMA_HISTOGRAM_ENUMERATION for non-enums a comment of '// IGNORE_PRESUBMIT_UMA_MAX' was added to silence the presubmit check. BUG=165553 TBR=danakj Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=254209

Patch Set 1 #

Total comments: 2

Patch Set 2 : adjust comment #

Total comments: 3

Patch Set 3 : FOO_MAX = LAST_VALID_FOO #

Total comments: 13

Patch Set 4 : Add presubmit check #

Patch Set 5 : #

Patch Set 6 : #

Total comments: 1

Patch Set 7 : More enum cleanup. #

Total comments: 2

Patch Set 8 : adjust comments on max entries #

Patch Set 9 : expand non-enum UMA_HISTOGRAM_ENUMERATION calls #

Patch Set 10 : Add unit test for PRESUBMIT.py #

Patch Set 11 : #

Patch Set 12 : Add comment to ignore violations of PRESUBMIT. #

Total comments: 6

Patch Set 13 : address comments #

Total comments: 6

Patch Set 14 : fix nits #

Patch Set 15 : Rebase and remove shebang from PRESUBMIT_test.py #

Patch Set 16 : fix typo #

Patch Set 17 : Fix VideoFrame::Format use which was introduced after the revision this patch was originally based … #

Total comments: 2

Patch Set 18 : Fix VS compile issue (I think/hope?) #

Patch Set 19 : rebase once more #

Patch Set 20 : fix naming collision #

Unified diffs Side-by-side diffs Delta from patch set Stats (+342 lines, -94 lines) Patch
M cc/resources/video_resource_updater.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +0 lines, -2 lines 0 comments Download
M content/common/gpu/gpu_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/rtc_video_encoder.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/media/webmediaplayer_util.cc View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
M content/renderer/media/webrtc_audio_capturer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +4 lines, -5 lines 0 comments Download
M content/renderer/media/webrtc_audio_renderer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +3 lines, -3 lines 0 comments Download
M media/PRESUBMIT.py View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +73 lines, -0 lines 0 comments Download
A media/PRESUBMIT_test.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +150 lines, -0 lines 0 comments Download
M media/audio/audio_output_resampler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +22 lines, -14 lines 0 comments Download
M media/audio/audio_parameters.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M media/audio/linux/audio_manager_linux.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -4 lines 0 comments Download
M media/audio/pulse/pulse_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +1 line, -3 lines 0 comments Download
M media/audio/sample_rates.h View 1 2 3 4 5 6 1 chunk +4 lines, -3 lines 0 comments Download
M media/audio/sample_rates.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +38 lines, -13 lines 0 comments Download
M media/base/audio_decoder_config.h View 1 2 3 4 5 6 2 chunks +4 lines, -3 lines 0 comments Download
M media/base/audio_decoder_config.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +6 lines, -6 lines 0 comments Download
M media/base/channel_layout.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +3 lines, -3 lines 0 comments Download
M media/base/channel_layout.cc View 1 2 2 chunks +1 line, -3 lines 0 comments Download
M media/base/channel_mixer.cc View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
M media/base/channel_mixer_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M media/base/media_log.cc View 1 2 1 chunk +0 lines, -2 lines 0 comments Download
M media/base/pipeline_status.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -1 line 0 comments Download
M media/base/sample_format.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +4 lines, -3 lines 0 comments Download
M media/base/sample_format.cc View 1 2 2 chunks +0 lines, -4 lines 0 comments Download
M media/base/video_decoder_config.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M media/base/video_frame.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M media/base/video_frame.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +0 lines, -4 lines 0 comments Download
M media/ffmpeg/ffmpeg_common.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +4 lines, -1 line 0 comments Download
M media/filters/audio_renderer_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +3 lines, -2 lines 0 comments Download
M media/filters/gpu_video_decoder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +1 line, -1 line 0 comments Download
M media/filters/stream_parser_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +7 lines, -5 lines 0 comments Download

Messages

Total messages: 58 (0 generated)
rileya (GONE FROM CHROMIUM)
An initial stab at some cleanup of the media/ enums. This focuses mainly on several ...
6 years, 11 months ago (2014-01-27 20:59:38 UTC) #1
scherkus (not reviewing)
+fischman for his $0.02 since he was kind enough to provide his $0.02 on the ...
6 years, 11 months ago (2014-01-27 22:37:30 UTC) #2
Ami GONE FROM CHROMIUM
Throwing my two pennies out the window while driving by at a high rate of ...
6 years, 11 months ago (2014-01-27 22:45:04 UTC) #3
scherkus (not reviewing)
On 2014/01/27 22:45:04, Ami Fischman wrote: > Throwing my two pennies out the window while ...
6 years, 10 months ago (2014-01-28 19:29:22 UTC) #4
rileya (GONE FROM CHROMIUM)
Framed with the C++ notion of max/end, 'FOO_MAX = last valid foo' sounds good. > ...
6 years, 10 months ago (2014-01-28 20:39:44 UTC) #5
scherkus (not reviewing)
On 2014/01/28 20:39:44, rileya wrote: > Framed with the C++ notion of max/end, 'FOO_MAX = ...
6 years, 10 months ago (2014-01-28 20:57:51 UTC) #6
rileya (GONE FROM CHROMIUM)
Okay, take 2. I changed every UMA'd enum in src/media/ that codesearch turned up (I ...
6 years, 10 months ago (2014-01-29 19:24:10 UTC) #7
rileya (GONE FROM CHROMIUM)
https://codereview.chromium.org/148553003/diff/30001/media/audio/audio_output_resampler.cc File media/audio/audio_output_resampler.cc (right): https://codereview.chromium.org/148553003/diff/30001/media/audio/audio_output_resampler.cc#newcode75 media/audio/audio_output_resampler.cc:75: UMA_HISTOGRAM_ENUMERATION( This isn't actually an enumeration, is there a ...
6 years, 10 months ago (2014-01-29 21:12:19 UTC) #8
Ami GONE FROM CHROMIUM
I like this a lot! https://codereview.chromium.org/148553003/diff/30001/media/audio/audio_output_resampler.cc File media/audio/audio_output_resampler.cc (right): https://codereview.chromium.org/148553003/diff/30001/media/audio/audio_output_resampler.cc#newcode75 media/audio/audio_output_resampler.cc:75: UMA_HISTOGRAM_ENUMERATION( On 2014/01/29 21:12:20, ...
6 years, 10 months ago (2014-01-29 21:29:02 UTC) #9
rileya (GONE FROM CHROMIUM)
I'll respond to the comments in a bit, but I want a quick opinion or ...
6 years, 10 months ago (2014-01-29 23:52:58 UTC) #10
scherkus (not reviewing)
On 2014/01/29 23:52:58, rileya wrote: > I'll respond to the comments in a bit, but ...
6 years, 10 months ago (2014-01-30 01:05:20 UTC) #11
Ami GONE FROM CHROMIUM
On Wed, Jan 29, 2014 at 5:05 PM, <scherkus@chromium.org> wrote: > My $0.02 -- I'd ...
6 years, 10 months ago (2014-01-30 03:51:58 UTC) #12
rileya (GONE FROM CHROMIUM)
I added a check to the src/media/PRESUBMIT.py, it ended up a bit long/convoluted since the ...
6 years, 10 months ago (2014-02-04 02:47:10 UTC) #13
Ami GONE FROM CHROMIUM
https://codereview.chromium.org/148553003/diff/120002/media/PRESUBMIT.py File media/PRESUBMIT.py (right): https://codereview.chromium.org/148553003/diff/120002/media/PRESUBMIT.py#newcode109 media/PRESUBMIT.py:109: r'\bUMA_HISTOGRAM_ENUMERATION\(' + whitespace + histogram_name + r',' + Sadly ...
6 years, 10 months ago (2014-02-04 02:56:46 UTC) #14
scherkus (not reviewing)
nifty! might I suggest some python unit tests? we don't have one for media yet, ...
6 years, 10 months ago (2014-02-05 01:02:28 UTC) #15
rileya (GONE FROM CHROMIUM)
Okay, I did more thorough cleanup, and found and adjusted all the instances of affected ...
6 years, 10 months ago (2014-02-05 22:30:04 UTC) #16
Ami GONE FROM CHROMIUM
https://codereview.chromium.org/148553003/diff/30001/media/audio/audio_output_resampler.cc File media/audio/audio_output_resampler.cc (right): https://codereview.chromium.org/148553003/diff/30001/media/audio/audio_output_resampler.cc#newcode75 media/audio/audio_output_resampler.cc:75: UMA_HISTOGRAM_ENUMERATION( On 2014/02/05 22:30:05, rileya wrote: > On 2014/01/29 ...
6 years, 10 months ago (2014-02-05 22:42:54 UTC) #17
rileya (GONE FROM CHROMIUM)
Alright, I added a simple set of unit tests for the presubmit check. I don't ...
6 years, 10 months ago (2014-02-06 21:12:39 UTC) #18
Ami GONE FROM CHROMIUM
On Thu, Feb 6, 2014 at 1:12 PM, <rileya@chromium.org> wrote: > Fair enough, so does ...
6 years, 10 months ago (2014-02-06 21:20:08 UTC) #19
rileya (GONE FROM CHROMIUM)
On 2014/02/06 21:20:08, Ami Fischman wrote: > On Thu, Feb 6, 2014 at 1:12 PM, ...
6 years, 10 months ago (2014-02-06 21:21:46 UTC) #20
rileya (GONE FROM CHROMIUM)
Giving this a bump. Would leaving those instances in media/audio/audio_output_resampler.cc alone and letting the PRESUBMIT ...
6 years, 10 months ago (2014-02-12 02:46:35 UTC) #21
Ami GONE FROM CHROMIUM
You could add a // IGNORE_MAX_VIOLATION trailing comment to the instances that can't/won't be changed ...
6 years, 10 months ago (2014-02-12 06:21:37 UTC) #22
rileya (GONE FROM CHROMIUM)
On 2014/02/12 06:21:37, Ami Fischman wrote: > You could add a // IGNORE_MAX_VIOLATION trailing comment ...
6 years, 10 months ago (2014-02-12 19:26:27 UTC) #23
Ami GONE FROM CHROMIUM
LGTM % nits and scherkus' actual review (I only skimmed the PRESUBMIT test, for example) ...
6 years, 10 months ago (2014-02-12 20:26:47 UTC) #24
rileya (GONE FROM CHROMIUM)
6 years, 10 months ago (2014-02-13 02:39:32 UTC) #25
rileya (GONE FROM CHROMIUM)
Alrighty, addressed the nits.
6 years, 10 months ago (2014-02-13 02:40:35 UTC) #26
rileya (GONE FROM CHROMIUM)
ping: scherkus@ mind having a look?
6 years, 10 months ago (2014-02-24 21:12:54 UTC) #27
scherkus (not reviewing)
https://codereview.chromium.org/148553003/diff/730001/media/audio/audio_output_resampler.cc File media/audio/audio_output_resampler.cc (right): https://codereview.chromium.org/148553003/diff/730001/media/audio/audio_output_resampler.cc#newcode90 media/audio/audio_output_resampler.cc:90: if (media::ToAudioSampleRate(output_params.sample_rate(), &asr)) { remove media:: https://codereview.chromium.org/148553003/diff/730001/media/audio/audio_output_resampler.cc#newcode118 media/audio/audio_output_resampler.cc:118: if ...
6 years, 10 months ago (2014-02-25 03:44:48 UTC) #28
rileya (GONE FROM CHROMIUM)
Alright, think I fixed everything.
6 years, 10 months ago (2014-02-25 19:39:43 UTC) #29
scherkus (not reviewing)
lgtm! thanks for tackling this!
6 years, 10 months ago (2014-02-25 19:41:35 UTC) #30
rileya (GONE FROM CHROMIUM)
+danakj for TBR of the tiny cc/resources/video_resource_updater.cc change.
6 years, 10 months ago (2014-02-25 21:06:10 UTC) #31
rileya (GONE FROM CHROMIUM)
The CQ bit was checked by rileya@chromium.org
6 years, 10 months ago (2014-02-25 21:06:32 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rileya@chromium.org/148553003/1040001
6 years, 10 months ago (2014-02-25 21:08:17 UTC) #33
rileya (GONE FROM CHROMIUM)
The CQ bit was unchecked by rileya@chromium.org
6 years, 10 months ago (2014-02-25 21:28:36 UTC) #34
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-25 21:30:28 UTC) #35
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) app_list_unittests, ash_unittests, aura_unittests, cacheinvalidation_unittests, cc_unittests, check_deps, ...
6 years, 10 months ago (2014-02-25 21:30:29 UTC) #36
danakj
cc LGTM
6 years, 10 months ago (2014-02-25 21:46:40 UTC) #37
rileya (GONE FROM CHROMIUM)
+tsepez: Mind having a look at content/common/gpu/gpu_messages.h ? https://codereview.chromium.org/148553003/diff/1060001/content/common/gpu/gpu_messages.h File content/common/gpu/gpu_messages.h (right): https://codereview.chromium.org/148553003/diff/1060001/content/common/gpu/gpu_messages.h#newcode57 content/common/gpu/gpu_messages.h:57: media::VideoFrame::FORMAT_MAX) ...
6 years, 10 months ago (2014-02-25 22:26:25 UTC) #38
Tom Sepez
lgtm https://codereview.chromium.org/148553003/diff/1060001/content/common/gpu/gpu_messages.h File content/common/gpu/gpu_messages.h (right): https://codereview.chromium.org/148553003/diff/1060001/content/common/gpu/gpu_messages.h#newcode57 content/common/gpu/gpu_messages.h:57: media::VideoFrame::FORMAT_MAX) On 2014/02/25 22:26:26, rileya wrote: > Note ...
6 years, 10 months ago (2014-02-25 23:22:54 UTC) #39
rileya (GONE FROM CHROMIUM)
The CQ bit was checked by rileya@chromium.org
6 years, 10 months ago (2014-02-25 23:30:41 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rileya@chromium.org/148553003/1060001
6 years, 10 months ago (2014-02-25 23:40:49 UTC) #41
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-26 05:34:08 UTC) #42
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) app_list_unittests, ash_unittests, aura_unittests, base_unittests, browser_tests, cacheinvalidation_unittests, ...
6 years, 10 months ago (2014-02-26 05:34:09 UTC) #43
rileya (GONE FROM CHROMIUM)
The CQ bit was checked by rileya@chromium.org
6 years, 10 months ago (2014-02-26 22:39:57 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rileya@chromium.org/148553003/1060002
6 years, 10 months ago (2014-02-26 22:42:04 UTC) #45
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-26 22:42:12 UTC) #46
commit-bot: I haz the power
Failed to apply patch for content/renderer/media/webrtc_audio_renderer.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 10 months ago (2014-02-26 22:42:13 UTC) #47
rileya (GONE FROM CHROMIUM)
The CQ bit was checked by rileya@chromium.org
6 years, 10 months ago (2014-02-26 22:53:10 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rileya@chromium.org/148553003/1080001
6 years, 10 months ago (2014-02-26 22:58:02 UTC) #49
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-27 00:28:30 UTC) #50
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) app_list_unittests, ash_unittests, aura_unittests, base_unittests, browser_tests, cacheinvalidation_unittests, ...
6 years, 10 months ago (2014-02-27 00:28:31 UTC) #51
rileya (GONE FROM CHROMIUM)
The CQ bit was checked by rileya@chromium.org
6 years, 9 months ago (2014-02-27 18:12:30 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rileya@chromium.org/148553003/1100001
6 years, 9 months ago (2014-02-27 18:14:26 UTC) #53
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-02-27 18:34:22 UTC) #54
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=52476
6 years, 9 months ago (2014-02-27 18:34:23 UTC) #55
rileya (GONE FROM CHROMIUM)
The CQ bit was checked by rileya@chromium.org
6 years, 9 months ago (2014-02-28 18:30:42 UTC) #56
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rileya@chromium.org/148553003/1100001
6 years, 9 months ago (2014-02-28 18:31:53 UTC) #57
commit-bot: I haz the power
6 years, 9 months ago (2014-02-28 20:30:46 UTC) #58
Message was sent while issue was closed.
Change committed as 254209

Powered by Google App Engine
This is Rietveld 408576698