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

Issue 2860973002: Allow PolicyLoadStatusSample to override reporting method (Closed)

Created:
3 years, 7 months ago by ljusten (tachyonic)
Modified:
3 years, 7 months ago
Reviewers:
emaxx
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow PolicyLoadStatusSample to override reporting method PolicyLoadStatusSample reports stats to base::LinearHistogram by default. However, when used from libchrome in Chrome OS, this does not work and causes memory leaks. This CL introduces PolicyLoadStatusSampler, which just gathers samples without doing anything with them, and its derived class PolicyLoadStatusAutoSubmitter, which sends them to base::LinearHistogram in its destructor and matches the old behavior. The slightly different name '*SampleR' should prevent accidental usage. Chrome OS can introduce its own submitter class or use the sampler class to dispose samples. BUG=717888 TEST=Added test and ran it Review-Url: https://codereview.chromium.org/2860973002 Cr-Commit-Position: refs/heads/master@{#469654} Committed: https://chromium.googlesource.com/chromium/src/+/6410def39290ed829e0d56b92ab03ddd985a0c04

Patch Set 1 #

Patch Set 2 : Change lambda bind to a more classical bind. #

Total comments: 2

Patch Set 3 : Changed callback implementation to class hierarchy implementation. #

Total comments: 8

Patch Set 4 : Cleanups and class rename. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+111 lines, -90 lines) Patch
M components/policy/core/common/config_dir_policy_loader.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M components/policy/core/common/policy_load_status.h View 1 2 3 2 chunks +22 lines, -13 lines 0 comments Download
M components/policy/core/common/policy_load_status.cc View 1 2 3 2 chunks +17 lines, -12 lines 0 comments Download
M components/policy/core/common/policy_loader_mac.mm View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M components/policy/core/common/policy_loader_win.h View 1 2 4 chunks +5 lines, -4 lines 0 comments Download
M components/policy/core/common/policy_loader_win.cc View 1 2 3 16 chunks +30 lines, -35 lines 0 comments Download
M components/policy/core/common/preg_parser.h View 1 2 1 chunk +5 lines, -6 lines 0 comments Download
M components/policy/core/common/preg_parser.cc View 1 2 4 chunks +8 lines, -14 lines 0 comments Download
M components/policy/core/common/preg_parser_fuzzer.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M components/policy/core/common/preg_parser_unittest.cc View 1 2 3 6 chunks +20 lines, -3 lines 0 comments Download

Messages

Total messages: 26 (15 generated)
ljusten (tachyonic)
Maxim, please take a look. Thiemo is out this and next week.
3 years, 7 months ago (2017-05-04 09:56:02 UTC) #2
emaxx
https://codereview.chromium.org/2860973002/diff/20001/components/policy/core/common/policy_load_status.h File components/policy/core/common/policy_load_status.h (right): https://codereview.chromium.org/2860973002/diff/20001/components/policy/core/common/policy_load_status.h#newcode51 components/policy/core/common/policy_load_status.h:51: // If |report_callback| is set, status is sent to ...
3 years, 7 months ago (2017-05-04 13:00:34 UTC) #3
ljusten (tachyonic)
Maksim, PTAL. https://codereview.chromium.org/2860973002/diff/20001/components/policy/core/common/policy_load_status.h File components/policy/core/common/policy_load_status.h (right): https://codereview.chromium.org/2860973002/diff/20001/components/policy/core/common/policy_load_status.h#newcode51 components/policy/core/common/policy_load_status.h:51: // If |report_callback| is set, status is ...
3 years, 7 months ago (2017-05-05 08:16:27 UTC) #7
ljusten (tachyonic)
And sorry for misspelling your name first ;-)
3 years, 7 months ago (2017-05-05 08:17:03 UTC) #8
emaxx
LGTM with nits. Thanks! On 2017/05/05 08:17:03, ljusten (instantaneous) wrote: > And sorry for misspelling ...
3 years, 7 months ago (2017-05-05 10:44:26 UTC) #11
ljusten (tachyonic)
Thanks! https://codereview.chromium.org/2860973002/diff/40001/components/policy/core/common/policy_load_status.h File components/policy/core/common/policy_load_status.h (right): https://codereview.chromium.org/2860973002/diff/40001/components/policy/core/common/policy_load_status.h#newcode10 components/policy/core/common/policy_load_status.h:10: #include "base/callback.h" On 2017/05/05 10:44:25, emaxx wrote: > ...
3 years, 7 months ago (2017-05-05 12:58:36 UTC) #14
emaxx
Still LGTM. On 2017/05/05 12:58:36, ljusten (instantaneous) wrote: > > (BTW, I would prefer compositing ...
3 years, 7 months ago (2017-05-05 14:40:29 UTC) #17
ljusten (tachyonic)
> Or, instead of exposing the sampler, simply expose Add() that will call the > ...
3 years, 7 months ago (2017-05-05 15:14:36 UTC) #20
ljusten (tachyonic)
3 years, 7 months ago (2017-05-05 15:14:46 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2860973002/60001
3 years, 7 months ago (2017-05-05 15:15:35 UTC) #23
commit-bot: I haz the power
3 years, 7 months ago (2017-05-05 15:21:04 UTC) #26
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/6410def39290ed829e0d56b92ab0...

Powered by Google App Engine
This is Rietveld 408576698