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

Issue 2499083004: Reland of [Sync] Put session tracker in charge of maintaining local state. (Closed)

Created:
4 years, 1 month ago by Nicolas Zea
Modified:
4 years ago
Reviewers:
skym
CC:
chromium-reviews, sync-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Reland of [Sync] Put session tracker in charge of maintaining local state. Previously, the session tracker was only updated when local tabs were available in the TabModel. It was not updated with sync data from a previous session (and as a result, we had to pass around the restored_data list at association time in order to handle restoring placeholder tabs). The session tracker now gets updated at startup of previous local state, which is then used when reassociating restored tabs. This is a purely refactoring change that should not introduce user visible changes (although internally the data is managed in a different way). To make this happen, InitFromSyncModel now treats local tabs and remote tabs the same. In addition, the SyncedSessionTracker now has a ReassociateTab method that can be called to update the tab id of a SessionTab. To make this work, the TabNodePool has been moved into the SyncedSessionTracker, and in general data ownership has been simplified (with quite a few new tests added). This is all necessary in order to enable preserving tabs from a previous session when they're not present in the TabModel (which can happen on Android when a custom tab is opened, but the main tabbed activity is not loaded). BUG=639009 Committed: https://crrev.com/159246f269b561bf931fa56a35b2704fab7dcc96 Cr-Commit-Position: refs/heads/master@{#436786}

Patch Set 1 #

Patch Set 2 : Compiling and passing tests #

Patch Set 3 : More working #

Patch Set 4 : Self review #

Total comments: 57

Patch Set 5 : Address comments #

Total comments: 8

Patch Set 6 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1165 lines, -1020 lines) Patch
M chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc View 1 2 3 4 5 36 chunks +299 lines, -211 lines 0 comments Download
M components/sync_sessions/sessions_sync_manager.h View 1 2 3 4 5 7 chunks +6 lines, -61 lines 0 comments Download
M components/sync_sessions/sessions_sync_manager.cc View 1 2 3 4 5 29 chunks +185 lines, -199 lines 0 comments Download
M components/sync_sessions/synced_session_tracker.h View 1 2 3 4 5 7 chunks +74 lines, -35 lines 0 comments Download
M components/sync_sessions/synced_session_tracker.cc View 1 2 3 4 5 10 chunks +102 lines, -40 lines 0 comments Download
M components/sync_sessions/synced_session_tracker_unittest.cc View 1 2 3 4 5 11 chunks +271 lines, -143 lines 0 comments Download
M components/sync_sessions/tab_node_pool.h View 1 2 3 4 4 chunks +34 lines, -78 lines 0 comments Download
M components/sync_sessions/tab_node_pool.cc View 1 2 3 4 4 chunks +77 lines, -100 lines 0 comments Download
M components/sync_sessions/tab_node_pool_unittest.cc View 1 2 3 4 4 chunks +117 lines, -153 lines 0 comments Download

Messages

Total messages: 26 (15 generated)
Nicolas Zea
Sky, PTAL. This is pretty significantly different from the original patch I landed, as it ...
4 years ago (2016-12-02 22:57:12 UTC) #7
skym
I'm still trying to grok everything here, but here's some minor nits so far. At ...
4 years ago (2016-12-03 01:20:46 UTC) #8
skym
Some more questions as I try to understand things. Thinking about this today, I'm not ...
4 years ago (2016-12-05 19:16:57 UTC) #9
Nicolas Zea
Thanks for the comments, PTAL! https://codereview.chromium.org/2499083004/diff/60001/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc File chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc (right): https://codereview.chromium.org/2499083004/diff/60001/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc#newcode14 chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc:14: #include "chrome/browser/sessions/session_tab_helper.h" On 2016/12/03 ...
4 years ago (2016-12-06 01:32:56 UTC) #10
skym
lgtm https://codereview.chromium.org/2499083004/diff/60001/components/sync_sessions/sessions_sync_manager.cc File components/sync_sessions/sessions_sync_manager.cc (right): https://codereview.chromium.org/2499083004/diff/60001/components/sync_sessions/sessions_sync_manager.cc#newcode736 components/sync_sessions/sessions_sync_manager.cc:736: session_tracker_.AddTabNode(session_tag, specifics.tab_node_id()); On 2016/12/06 01:32:55, Nicolas Zea wrote: ...
4 years ago (2016-12-06 19:37:21 UTC) #15
Nicolas Zea
Comments addressed, thanks! https://codereview.chromium.org/2499083004/diff/60001/components/sync_sessions/sessions_sync_manager.cc File components/sync_sessions/sessions_sync_manager.cc (right): https://codereview.chromium.org/2499083004/diff/60001/components/sync_sessions/sessions_sync_manager.cc#newcode736 components/sync_sessions/sessions_sync_manager.cc:736: session_tracker_.AddTabNode(session_tag, specifics.tab_node_id()); On 2016/12/06 19:37:21, skym ...
4 years ago (2016-12-06 22:31:38 UTC) #16
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/2499083004/100001
4 years ago (2016-12-06 22:34:40 UTC) #19
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years ago (2016-12-07 00:41:05 UTC) #22
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/159246f269b561bf931fa56a35b2704fab7dcc96 Cr-Commit-Position: refs/heads/master@{#436786}
4 years ago (2016-12-07 00:43:20 UTC) #24
chanli
On 2016/12/07 00:43:20, commit-bot: I haz the power wrote: > Patchset 6 (id:??) landed as ...
4 years ago (2016-12-10 20:26:37 UTC) #25
skym
4 years ago (2016-12-12 16:57:31 UTC) #26
Message was sent while issue was closed.
On 2016/12/10 20:26:37, chanli wrote:
> On 2016/12/07 00:43:20, commit-bot: I haz the power wrote:
> > Patchset 6 (id:??) landed as
> > https://crrev.com/159246f269b561bf931fa56a35b2704fab7dcc96
> > Cr-Commit-Position: refs/heads/master@{#436786}
> 
> Hello,
> 
> This is Chan Li from Findit team and I'm looking for possible cause for flaky
> test RecentTabsSubMenuModelTest.MaxWidth. Could you help me and check if this
> change could cause this flakiness? Thank you so much!

Yes, this did cause RecentTabsSubMenuModelTest.MaxWidth to flake, and it has
been fixed in https://codereview.chromium.org/2562853002/ already.

Powered by Google App Engine
This is Rietveld 408576698