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

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

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

Description

[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 external behavioral 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. 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/7453d79b8ab314577881145ed341e8603bfdbe4f Cr-Commit-Position: refs/heads/master@{#432006}

Patch Set 1 #

Patch Set 2 : Self review #

Patch Set 3 : Rebase #

Total comments: 15

Patch Set 4 : Address feedback #

Total comments: 2

Patch Set 5 : Rebase and update comment #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+345 lines, -263 lines) Patch
M chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc View 1 8 chunks +22 lines, -16 lines 0 comments Download
M components/sync_sessions/sessions_sync_manager.h View 1 2 3 4 5 chunks +10 lines, -33 lines 0 comments Download
M components/sync_sessions/sessions_sync_manager.cc View 1 2 3 15 chunks +83 lines, -82 lines 2 comments Download
M components/sync_sessions/synced_session_tracker.h View 1 2 3 2 chunks +11 lines, -2 lines 0 comments Download
M components/sync_sessions/synced_session_tracker.cc View 1 1 chunk +42 lines, -0 lines 0 comments Download
M components/sync_sessions/synced_session_tracker_unittest.cc View 10 chunks +177 lines, -130 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 34 (21 generated)
Nicolas Zea
PTAL
4 years, 1 month ago (2016-11-10 00:23:53 UTC) #6
maxbogue
Mostly LG with nits and a question, but I want to do another review pass ...
4 years, 1 month ago (2016-11-10 06:43:26 UTC) #8
Nicolas Zea
PTAL https://codereview.chromium.org/2494533002/diff/40001/components/sync_sessions/sessions_sync_manager.cc File components/sync_sessions/sessions_sync_manager.cc (right): https://codereview.chromium.org/2494533002/diff/40001/components/sync_sessions/sessions_sync_manager.cc#newcode357 components/sync_sessions/sessions_sync_manager.cc:357: // Note: on some platforms the tab object ...
4 years, 1 month ago (2016-11-10 18:25:36 UTC) #9
maxbogue
https://codereview.chromium.org/2494533002/diff/40001/components/sync_sessions/synced_session_tracker.cc File components/sync_sessions/synced_session_tracker.cc (right): https://codereview.chromium.org/2494533002/diff/40001/components/sync_sessions/synced_session_tracker.cc#newcode342 components/sync_sessions/synced_session_tracker.cc:342: bool SyncedSessionTracker::ReassociateTab(const std::string& session_tag, On 2016/11/10 18:25:36, Nicolas Zea ...
4 years, 1 month ago (2016-11-10 22:27:14 UTC) #10
Nicolas Zea
PTAL
4 years, 1 month ago (2016-11-11 00:07:28 UTC) #17
Nicolas Zea
https://codereview.chromium.org/2494533002/diff/60001/components/sync_sessions/sessions_sync_manager.h File components/sync_sessions/sessions_sync_manager.h (right): https://codereview.chromium.org/2494533002/diff/60001/components/sync_sessions/sessions_sync_manager.h#newcode122 components/sync_sessions/sessions_sync_manager.h:122: // Keep all the links to local tab data ...
4 years, 1 month ago (2016-11-11 00:07:45 UTC) #18
maxbogue
lgtm, but please wait for Sky to review (sorry about yesterday; he missed that I ...
4 years, 1 month ago (2016-11-11 17:05:31 UTC) #22
Nicolas Zea
Done. https://codereview.chromium.org/2494533002/diff/120001/components/sync_sessions/sessions_sync_manager.cc File components/sync_sessions/sessions_sync_manager.cc (right): https://codereview.chromium.org/2494533002/diff/120001/components/sync_sessions/sessions_sync_manager.cc#newcode666 components/sync_sessions/sessions_sync_manager.cc:666: make_linked_ptr<TabLink>(new TabLink(specifics.tab_node_id())); On 2016/11/11 17:05:31, maxbogue wrote: > ...
4 years, 1 month ago (2016-11-11 18:25:03 UTC) #26
maxbogue
Ahhh that description is very helpful, thank you! I'm much more comfortable with the change ...
4 years, 1 month ago (2016-11-11 18:35:32 UTC) #27
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/2494533002/120001
4 years, 1 month ago (2016-11-14 18:00:32 UTC) #29
commit-bot: I haz the power
Committed patchset #5 (id:120001)
4 years, 1 month ago (2016-11-15 00:14:13 UTC) #31
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/7453d79b8ab314577881145ed341e8603bfdbe4f Cr-Commit-Position: refs/heads/master@{#432006}
4 years, 1 month ago (2016-11-15 00:23:38 UTC) #33
Nicolas Zea
4 years, 1 month ago (2016-11-15 19:05:28 UTC) #34
Message was sent while issue was closed.
A revert of this CL (patchset #5 id:120001) has been created in
https://codereview.chromium.org/2507543002/ by zea@chromium.org.

The reason for reverting is: crbug.com/665314
crbug.com/665524.

Powered by Google App Engine
This is Rietveld 408576698