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

Issue 370813003: Move kInstallDate from chrome/common/pref_names.h to components/metrics/metrics_pref_names.h (Closed)

Created:
6 years, 5 months ago by gab
Modified:
6 years, 5 months ago
CC:
chromium-reviews, asvitkine+watch_chromium.org, benquan, tfarina, Dane Wallinga, dyu1, estade+watch_chromium.org, Ilya Sherman, rouslan+autofillwatch_chromium.org, Alexei Svitkine (slow)
Project:
chromium
Visibility:
Public.

Description

Move kInstallDate from chrome/common/pref_names.h to components/metrics/metrics_pref_names.h This is a precursor CL to having MetricsStateManager be able to recover missing client_ids and restore old installation dates. BUG=391338 TBR=sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=281960

Patch Set 1 #

Total comments: 6

Patch Set 2 : merge up to r281743 #

Patch Set 3 : review:isherman #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -44 lines) Patch
M chrome/browser/chrome_browser_field_trials.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chrome_browser_main.cc View 1 2 chunks +6 lines, -3 lines 6 comments Download
M chrome/browser/metrics/chrome_metrics_service_client.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/metrics/chrome_metrics_service_client.cc View 1 2 2 chunks +0 lines, -5 lines 0 comments Download
M chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc View 1 2 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/common/pref_names.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/common/pref_names.cc View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M components/metrics/metrics_log.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M components/metrics/metrics_log.cc View 1 2 2 chunks +2 lines, -3 lines 0 comments Download
M components/metrics/metrics_log_unittest.cc View 1 2 7 chunks +10 lines, -7 lines 0 comments Download
M components/metrics/metrics_pref_names.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/metrics/metrics_pref_names.cc View 1 chunk +4 lines, -0 lines 0 comments Download
M components/metrics/metrics_service.h View 1 chunk +3 lines, -0 lines 0 comments Download
M components/metrics/metrics_service.cc View 1 2 4 chunks +10 lines, -2 lines 0 comments Download
M components/metrics/metrics_service_client.h View 1 2 1 chunk +0 lines, -3 lines 0 comments Download
M components/metrics/metrics_service_unittest.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download
M components/metrics/test_metrics_service_client.h View 1 2 2 chunks +0 lines, -3 lines 0 comments Download
M components/metrics/test_metrics_service_client.cc View 1 2 2 chunks +1 line, -6 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
gab
Ilya PTAL at this in the context of https://codereview.chromium.org/372473004/ Thanks! Gab
6 years, 5 months ago (2014-07-07 22:27:04 UTC) #1
Ilya Sherman
https://codereview.chromium.org/370813003/diff/1/chrome/browser/metrics/chrome_metrics_service_client.cc File chrome/browser/metrics/chrome_metrics_service_client.cc (right): https://codereview.chromium.org/370813003/diff/1/chrome/browser/metrics/chrome_metrics_service_client.cc#newcode147 chrome/browser/metrics/chrome_metrics_service_client.cc:147: registry->RegisterInt64Pref(metrics::prefs::kInstallDate, 0); It would probably be more appropriate to ...
6 years, 5 months ago (2014-07-08 03:26:33 UTC) #2
Ilya Sherman
By the way, thanks for splitting off these precursor CLs from the main one -- ...
6 years, 5 months ago (2014-07-08 03:26:59 UTC) #3
gab
Thanks, PTAL. https://codereview.chromium.org/370813003/diff/1/chrome/browser/metrics/chrome_metrics_service_client.cc File chrome/browser/metrics/chrome_metrics_service_client.cc (right): https://codereview.chromium.org/370813003/diff/1/chrome/browser/metrics/chrome_metrics_service_client.cc#newcode147 chrome/browser/metrics/chrome_metrics_service_client.cc:147: registry->RegisterInt64Pref(metrics::prefs::kInstallDate, 0); On 2014/07/08 03:26:33, Ilya Sherman ...
6 years, 5 months ago (2014-07-08 17:41:02 UTC) #4
gab
On 2014/07/08 03:26:59, Ilya Sherman wrote: > By the way, thanks for splitting off these ...
6 years, 5 months ago (2014-07-08 17:41:37 UTC) #5
Ilya Sherman
LGTM, thanks.
6 years, 5 months ago (2014-07-08 23:35:30 UTC) #6
gab
Thanks, TBR sky for refactoring side-effects on: chrome/browser/chrome_browser_field_trials.cc chrome/browser/chrome_browser_main.cc chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
6 years, 5 months ago (2014-07-08 23:51:06 UTC) #7
gab
The CQ bit was checked by gab@chromium.org
6 years, 5 months ago (2014-07-08 23:51:15 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/gab@chromium.org/370813003/40001
6 years, 5 months ago (2014-07-08 23:52:10 UTC) #9
commit-bot: I haz the power
Change committed as 281960
6 years, 5 months ago (2014-07-09 05:42:44 UTC) #10
Alexei Svitkine (slow)
https://codereview.chromium.org/370813003/diff/40001/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/370813003/diff/40001/chrome/browser/chrome_browser_main.cc#newcode946 chrome/browser/chrome_browser_main.cc:946: base::Time::Now().ToTimeT()); I don't like the fact that we're recording ...
6 years, 5 months ago (2014-07-14 17:00:53 UTC) #11
gab
https://codereview.chromium.org/370813003/diff/40001/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/370813003/diff/40001/chrome/browser/chrome_browser_main.cc#newcode946 chrome/browser/chrome_browser_main.cc:946: base::Time::Now().ToTimeT()); On 2014/07/14 17:00:53, Alexei Svitkine wrote: > I ...
6 years, 5 months ago (2014-07-14 19:38:13 UTC) #12
Alexei Svitkine (slow)
https://codereview.chromium.org/370813003/diff/40001/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/370813003/diff/40001/chrome/browser/chrome_browser_main.cc#newcode946 chrome/browser/chrome_browser_main.cc:946: base::Time::Now().ToTimeT()); On 2014/07/14 19:38:13, gab wrote: > On 2014/07/14 ...
6 years, 5 months ago (2014-07-14 19:40:38 UTC) #13
gab
https://codereview.chromium.org/370813003/diff/40001/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/370813003/diff/40001/chrome/browser/chrome_browser_main.cc#newcode946 chrome/browser/chrome_browser_main.cc:946: base::Time::Now().ToTimeT()); On 2014/07/14 19:40:38, Alexei Svitkine wrote: > On ...
6 years, 5 months ago (2014-07-14 19:52:37 UTC) #14
Alexei Svitkine (slow)
https://codereview.chromium.org/370813003/diff/40001/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): https://codereview.chromium.org/370813003/diff/40001/chrome/browser/chrome_browser_main.cc#newcode946 chrome/browser/chrome_browser_main.cc:946: base::Time::Now().ToTimeT()); On 2014/07/14 19:52:37, gab wrote: > On 2014/07/14 ...
6 years, 5 months ago (2014-07-15 15:49:33 UTC) #15
gab
6 years, 5 months ago (2014-07-15 22:13:15 UTC) #16
Message was sent while issue was closed.
https://codereview.chromium.org/370813003/diff/40001/chrome/browser/chrome_br...
File chrome/browser/chrome_browser_main.cc (right):

https://codereview.chromium.org/370813003/diff/40001/chrome/browser/chrome_br...
chrome/browser/chrome_browser_main.cc:946: base::Time::Now().ToTimeT());
On 2014/07/15 15:49:33, Alexei Svitkine wrote:
> On 2014/07/14 19:52:37, gab wrote:
> > On 2014/07/14 19:40:38, Alexei Svitkine wrote:
> > > On 2014/07/14 19:38:13, gab wrote:
> > > > On 2014/07/14 17:00:53, Alexei Svitkine wrote:
> > > > > I don't like the fact that we're recording install date directly here
> and
> > > then
> > > > > accessing it from MetricsService.
> > > > > 
> > > > > I think it would be better to move the two together. Can you create a
> > > > follow-up
> > > > > CL that adds a static MetricsService::InitInstallDate() method with
this
> > > code
> > > > > and call it from here? This way, the setting and querying install date
> can
> > > be
> > > > > done entirely in the metrics component.
> > > > 
> > > > SGTM, in fact how about we just do this automatically when
MetricsService
> > > > initializes? (i.e. no need to tell it from outside that it's time to
init
> > the
> > > > install date... it should just do it as soon as it sees it's missing on
> > > startup)
> > > 
> > > That sounds even better assuming it's safe to do (i.e. nothing else uses
> that
> > > value between this point and when MetricsService is initialized.)
> > 
> > Well that's the same (slightly earlier in fact) as calling
> > MetricsService::InitInstallDate() as you originally suggested (unless you
> meant
> > to make that a static method that can be called without actually having a
> > service which sounds weird to me...).
> > 
> > The only potential early getter of this pref is
> >
>
https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/chr...
> > is g_browser_process->metrics_service() up then? Can we use GetInstallDate()
> > there?
> 
> I was originally suggesting it to be a static method called from here. While
> weird, it would still be a strict improvement over the current code.
> 
> But looking at the code you linked, I think it should be fine to put it into
the
> ctor of MetricsService and to expose a getter from it to retrieve. The linked
> code runs after MetricsService has been created, so it should be fine to pass
as
> a param to the SetupFieldTrials method from:
> 
>
https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/chr...

Follow-up CL posted @ https://codereview.chromium.org/396753005/

Powered by Google App Engine
This is Rietveld 408576698