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

Issue 141393002: Return a NULL histogram pointer on construction error (Closed)

Created:
6 years, 11 months ago by elijahtaylor1
Modified:
6 years, 9 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, jar (doing other things), asvitkine+watch_chromium.org, chromium-apps-reviews_chromium.org, erikwright+watch_chromium.org, Ilya Sherman
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Return a NULL histogram pointer on construction error Check the pointer returned for the metricsPrivate API to keep from crashing Chrome with bad data. BUG=334135 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256822

Patch Set 1 #

Patch Set 2 : move some impl to cc #

Total comments: 4

Patch Set 3 : add unit test, move impl out of .h #

Total comments: 3

Patch Set 4 : moved functions inline #

Total comments: 4

Patch Set 5 : Add construction param to restore old CHECK for non-API calls #

Total comments: 2

Patch Set 6 : rework, return NULL instead #

Total comments: 2

Patch Set 7 : add checks to Pepper API #

Patch Set 8 : rebase, git cl format #

Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -16 lines) Patch
M base/metrics/histogram.cc View 1 2 3 4 5 2 chunks +20 lines, -2 lines 0 comments Download
M base/metrics/histogram_unittest.cc View 1 2 3 4 5 6 7 1 chunk +26 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/metrics_private/metrics_apitest.cc View 1 2 3 4 5 6 7 2 chunks +16 lines, -10 lines 0 comments Download
M chrome/browser/extensions/api/metrics_private/metrics_private_api.cc View 1 2 3 4 5 6 1 chunk +4 lines, -1 line 0 comments Download
M chrome/renderer/pepper/pepper_uma_host.cc View 1 2 3 4 5 6 7 3 chunks +12 lines, -3 lines 0 comments Download
M chrome/test/data/extensions/api_test/metrics/test.js View 1 chunk +45 lines, -0 lines 0 comments Download
M ppapi/tests/test_uma.cc View 1 2 3 4 5 6 3 chunks +13 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (0 generated)
elijahtaylor1
PTAL. It's not exactly what we discussed, this just discards both Log and Linear histogram ...
6 years, 11 months ago (2014-01-17 01:27:15 UTC) #1
Alexei Svitkine (slow)
This approach makes sense to me. Some comments below. https://codereview.chromium.org/141393002/diff/190001/base/metrics/histogram.h File base/metrics/histogram.h (right): https://codereview.chromium.org/141393002/diff/190001/base/metrics/histogram.h#newcode683 base/metrics/histogram.h:683: ...
6 years, 11 months ago (2014-01-17 15:40:13 UTC) #2
elijahtaylor1
PTAL https://codereview.chromium.org/141393002/diff/190001/base/metrics/histogram.h File base/metrics/histogram.h (right): https://codereview.chromium.org/141393002/diff/190001/base/metrics/histogram.h#newcode683 base/metrics/histogram.h:683: class BASE_EXPORT DummyHistogram : public Histogram { On ...
6 years, 11 months ago (2014-01-17 20:04:15 UTC) #3
Alexei Svitkine (slow)
Thanks, LGTM. +jar for base owners https://codereview.chromium.org/141393002/diff/430001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/141393002/diff/430001/base/metrics/histogram.cc#newcode94 base/metrics/histogram.cc:94: bool DummyHistogram::AddSamplesFromPickle(PickleIterator* iter) ...
6 years, 11 months ago (2014-01-17 20:06:30 UTC) #4
elijahtaylor1
https://codereview.chromium.org/141393002/diff/430001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/141393002/diff/430001/base/metrics/histogram.cc#newcode94 base/metrics/histogram.cc:94: bool DummyHistogram::AddSamplesFromPickle(PickleIterator* iter) { On 2014/01/17 20:06:31, Alexei Svitkine ...
6 years, 11 months ago (2014-01-17 20:25:34 UTC) #5
Alexei Svitkine (slow)
https://codereview.chromium.org/141393002/diff/430001/base/metrics/histogram.cc File base/metrics/histogram.cc (right): https://codereview.chromium.org/141393002/diff/430001/base/metrics/histogram.cc#newcode94 base/metrics/histogram.cc:94: bool DummyHistogram::AddSamplesFromPickle(PickleIterator* iter) { On 2014/01/17 20:25:34, elijahtaylor1 wrote: ...
6 years, 11 months ago (2014-01-17 22:14:27 UTC) #6
elijahtaylor1
On 2014/01/17 22:14:27, Alexei Svitkine wrote: > https://codereview.chromium.org/141393002/diff/430001/base/metrics/histogram.cc > File base/metrics/histogram.cc (right): > > https://codereview.chromium.org/141393002/diff/430001/base/metrics/histogram.cc#newcode94 ...
6 years, 11 months ago (2014-01-17 22:18:52 UTC) #7
elijahtaylor1
On 2014/01/17 22:18:52, elijahtaylor1 wrote: > On 2014/01/17 22:14:27, Alexei Svitkine wrote: > > > ...
6 years, 11 months ago (2014-01-23 01:57:38 UTC) #8
jar (doing other things)
https://codereview.chromium.org/141393002/diff/510001/base/metrics/histogram.cc File base/metrics/histogram.cc (left): https://codereview.chromium.org/141393002/diff/510001/base/metrics/histogram.cc#oldcode570 base/metrics/histogram.cc:570: CHECK(histogram->HasConstructionArguments(minimum, maximum, bucket_count)); Same issue... I really wish we ...
6 years, 11 months ago (2014-01-23 02:16:17 UTC) #9
Alexei Svitkine (slow)
https://codereview.chromium.org/141393002/diff/510001/base/metrics/histogram.cc File base/metrics/histogram.cc (left): https://codereview.chromium.org/141393002/diff/510001/base/metrics/histogram.cc#oldcode570 base/metrics/histogram.cc:570: CHECK(histogram->HasConstructionArguments(minimum, maximum, bucket_count)); On 2014/01/23 02:16:18, jar wrote: > ...
6 years, 11 months ago (2014-01-23 15:28:22 UTC) #10
elijahtaylor1
PTAL https://codereview.chromium.org/141393002/diff/510001/base/metrics/histogram.cc File base/metrics/histogram.cc (left): https://codereview.chromium.org/141393002/diff/510001/base/metrics/histogram.cc#oldcode570 base/metrics/histogram.cc:570: CHECK(histogram->HasConstructionArguments(minimum, maximum, bucket_count)); On 2014/01/23 15:28:22, Alexei Svitkine ...
6 years, 11 months ago (2014-01-24 01:27:26 UTC) #11
jar (doing other things)
https://codereview.chromium.org/141393002/diff/810001/base/metrics/histogram.h File base/metrics/histogram.h (right): https://codereview.chromium.org/141393002/diff/810001/base/metrics/histogram.h#newcode394 base/metrics/histogram.h:394: int32 construction_behavior = kDoNotAllowBadConstruction); Sadly, this is a violation ...
6 years, 11 months ago (2014-01-24 16:15:07 UTC) #12
elijahtaylor1
https://codereview.chromium.org/141393002/diff/810001/base/metrics/histogram.h File base/metrics/histogram.h (right): https://codereview.chromium.org/141393002/diff/810001/base/metrics/histogram.h#newcode394 base/metrics/histogram.h:394: int32 construction_behavior = kDoNotAllowBadConstruction); On 2014/01/24 16:15:09, jar wrote: ...
6 years, 11 months ago (2014-01-24 20:37:19 UTC) #13
Alexei Svitkine (slow)
I'm fine with this approach too. Can you update the NaCL callsites as well with ...
6 years, 11 months ago (2014-01-24 20:39:39 UTC) #14
elijahtaylor1
Added checks to the Pepper API portion of this since that change just landed. +bbudge ...
6 years, 11 months ago (2014-01-24 23:10:36 UTC) #15
bbudge
Pepper code LGTM
6 years, 11 months ago (2014-01-24 23:20:04 UTC) #16
Alexei Svitkine (slow)
Ping, what's the status of this?
6 years, 9 months ago (2014-03-03 18:22:00 UTC) #17
Alexei Svitkine (slow)
Latest version LGTM, fwiw.
6 years, 9 months ago (2014-03-03 18:23:46 UTC) #18
elijahtaylor1
I think I still need an LGTM from jar@ for base/metrics OWNER. I will also ...
6 years, 9 months ago (2014-03-03 18:34:18 UTC) #19
jar (doing other things)
Patch set 7 LGTM
6 years, 9 months ago (2014-03-06 02:36:34 UTC) #20
elijahtaylor1
The CQ bit was checked by elijahtaylor@chromium.org
6 years, 9 months ago (2014-03-13 01:19:56 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/elijahtaylor@chromium.org/141393002/1590001
6 years, 9 months ago (2014-03-13 01:20:13 UTC) #22
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-13 03:59:47 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_clang_dbg
6 years, 9 months ago (2014-03-13 03:59:48 UTC) #24
Alexei Svitkine (slow)
The CQ bit was checked by asvitkine@chromium.org
6 years, 9 months ago (2014-03-13 13:43:54 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/elijahtaylor@chromium.org/141393002/1590001
6 years, 9 months ago (2014-03-13 13:44:01 UTC) #26
commit-bot: I haz the power
6 years, 9 months ago (2014-03-13 14:08:24 UTC) #27
Message was sent while issue was closed.
Change committed as 256822

Powered by Google App Engine
This is Rietveld 408576698