New issue
Advanced search Search tips

Issue 853755 link

Starred by 2 users

Issue metadata

Status: Assigned
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task
Proj-Servicification



Sign in to add a comment

Migrate use cases to SetDeltaTime/GetDeltaTime

Project Member Reported by s...@chromium.org, Jun 18 2018

Issue description

Once https://chromium-review.googlesource.com/c/chromium/src/+/1103147 lands and PrefService::SetDeltaTime and PrefService::GetDeltaTime exist, we should replace any code that saves DeltaTime into prefs with these new convinience method, and ideally remove the time serialization code they were using.

Not that this really only works if they were previously using microseconds resolution (which is also the internal resolution of DeltaTime).

Currently known candidate for migration is
* https://cs.chromium.org/chromium/src/components/ntp_snippets/remote/remote_suggestions_scheduler_impl.cc?l=484
 

Comment 1 by gab@chromium.org, Jun 18 2018

For those that didn't previously use microseconds, we'd need a new pref and a step in browser_prefs.cc::Migrate*Prefs() to migrate.

Not mandatory though.

Comment 2 by s...@chromium.org, Jun 18 2018

Ooh interesting. Okay, doesn't look like anyone is actively migrating anything, but looking through history, I'm starting to get an idea. We basically check to see if the old pref is set, and new pref is not set, and then convert/migrate the value, and clear the old pref regardless of other logic. And then ~1 year later we remove the whole section.

The pref that can be migrated is https://cs.chromium.org/chromium/src/components/sync/base/sync_prefs.cc?l=53 , as we'll want to convert from seconds resolution to microseconds resolution.
Project Member

Comment 3 by bugdroid1@chromium.org, Jun 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0ef461ea242fc7b073d9c8acba75738ccffa0066

commit 0ef461ea242fc7b073d9c8acba75738ccffa0066
Author: Sky Malice <skym@google.com>
Date: Tue Jun 19 01:28:21 2018

[NTP Snippets] Switch RemoteSuggestionsSchedulerImpl to Time and TimeDelta pref methods.

Because time_serialization.cc stored Time and DeltaTime in
microseconds, and Time since the windows epoch, which is the exact
same way that PrefService is storing these time fields, this change
should be fully backwards compatible.

Bug: 853755
Change-Id: I22d734d030ca550a654319e37abf6653890c1bdb
Reviewed-on: https://chromium-review.googlesource.com/1104581
Reviewed-by: Filip Gorski <fgorski@chromium.org>
Commit-Queue: Sky Malice <skym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568282}
[modify] https://crrev.com/0ef461ea242fc7b073d9c8acba75738ccffa0066/components/ntp_snippets/remote/remote_suggestions_scheduler_impl.cc
[modify] https://crrev.com/0ef461ea242fc7b073d9c8acba75738ccffa0066/components/ntp_snippets/time_serialization.cc
[modify] https://crrev.com/0ef461ea242fc7b073d9c8acba75738ccffa0066/components/ntp_snippets/time_serialization.h
[modify] https://crrev.com/0ef461ea242fc7b073d9c8acba75738ccffa0066/components/ntp_snippets/time_serialization_unittest.cc

Comment 4 by dxie@google.com, Jun 19 2018

Labels: Hotlist-KnownIssue

Sign in to add a comment