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

Issue 16421003: [Sync] Add logic to reassociate tab nodes after restart. (Closed)

Created:
7 years, 6 months ago by shashi
Modified:
7 years, 6 months ago
Reviewers:
nyquist, Yaron, Nicolas Zea
CC:
chromium-reviews, Raghu Simha, haitaol1, akalin, tim (not reviewing)
Visibility:
Public.

Description

[Sync] Add logic to reassociate tab nodes after restart. Change SessionModelAssociator and TabNodePool to reuse old tab nodes. Old tab nodes are now added to TabNodePool and if there is an existing old tab node with syncid of tab, the tab is reassociated with that node. Note: In order for tab reassociation to work, the syncid of a tab should be persisted. This CL just introduces the sync changes for reassociating tab nodes. Persisting syncid with tab will be done in a separate CL for Desktop, and in a downstream CL for Android. BUG=139670, 12549, 139666 TEST=Includes unit tests + MANUAL testing on Android. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=208024

Patch Set 1 : #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 34

Patch Set 4 : Cleanup TabNodePool API. #

Patch Set 5 : Add a limit on number of free nodes. #

Patch Set 6 : Fix win compile, rename uint -> size_t. #

Total comments: 44

Patch Set 7 : apply feedback. #

Patch Set 8 : fix renames. #

Total comments: 1

Patch Set 9 : nit. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+512 lines, -186 lines) Patch
M chrome/android/testshell/testshell_tab.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/android/testshell/testshell_tab.cc View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/android/tab_android.h View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/session_model_associator.h View 1 2 3 4 5 6 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/session_model_associator.cc View 1 2 3 4 5 6 12 chunks +90 lines, -35 lines 0 comments Download
M chrome/browser/sync/glue/session_model_associator_unittest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/synced_tab_delegate.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/synced_tab_delegate_android.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/synced_tab_delegate_android.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/tab_node_pool.h View 1 2 3 4 5 6 2 chunks +68 lines, -45 lines 0 comments Download
M chrome/browser/sync/glue/tab_node_pool.cc View 1 2 3 4 5 6 4 chunks +99 lines, -21 lines 0 comments Download
M chrome/browser/sync/glue/tab_node_pool_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +181 lines, -62 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_session_unittest.cc View 1 2 3 4 5 6 7 3 chunks +27 lines, -20 lines 0 comments Download
M chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc View 1 2 3 2 chunks +9 lines, -1 line 0 comments Download

Messages

Total messages: 17 (0 generated)
shashi
Downstream patch: https://gerrit-int.chromium.org/#/c/39177
7 years, 6 months ago (2013-06-05 22:03:29 UTC) #1
Nicolas Zea
https://codereview.chromium.org/16421003/diff/41018/chrome/browser/sync/glue/session_model_associator.cc File chrome/browser/sync/glue/session_model_associator.cc (right): https://codereview.chromium.org/16421003/diff/41018/chrome/browser/sync/glue/session_model_associator.cc#newcode213 chrome/browser/sync/glue/session_model_associator.cc:213: SyncedTabDelegate* syncedTab = (*i)->GetTabAt(j); Given your other patch, you ...
7 years, 6 months ago (2013-06-06 21:27:39 UTC) #2
shashi
I thought to address design questions first, to make sure I am in the right ...
7 years, 6 months ago (2013-06-07 01:44:08 UTC) #3
Nicolas Zea
https://codereview.chromium.org/16421003/diff/41018/chrome/browser/sync/glue/session_model_associator.cc File chrome/browser/sync/glue/session_model_associator.cc (right): https://codereview.chromium.org/16421003/diff/41018/chrome/browser/sync/glue/session_model_associator.cc#newcode218 chrome/browser/sync/glue/session_model_associator.cc:218: UpdateTabIdIfNeccessary(syncedTab->GetSyncId(), tab_id)) { On 2013/06/07 01:44:08, shashi wrote: > ...
7 years, 6 months ago (2013-06-07 14:42:28 UTC) #4
Yaron
https://codereview.chromium.org/16421003/diff/41018/chrome/browser/android/tab_android.cc File chrome/browser/android/tab_android.cc (right): https://codereview.chromium.org/16421003/diff/41018/chrome/browser/android/tab_android.cc#newcode142 chrome/browser/android/tab_android.cc:142: int64 TabAndroid::GetSyncId() const { This class is abstract anyway. ...
7 years, 6 months ago (2013-06-07 17:08:34 UTC) #5
Nicolas Zea
https://codereview.chromium.org/16421003/diff/41018/chrome/browser/sync/glue/session_model_associator.cc File chrome/browser/sync/glue/session_model_associator.cc (right): https://codereview.chromium.org/16421003/diff/41018/chrome/browser/sync/glue/session_model_associator.cc#newcode1175 chrome/browser/sync/glue/session_model_associator.cc:1175: syncer::WriteTransaction trans(FROM_HERE, sync_service_->GetUserShare()); On 2013/06/07 17:08:35, Yaron wrote: > ...
7 years, 6 months ago (2013-06-07 17:24:04 UTC) #6
shashi
https://codereview.chromium.org/16421003/diff/41018/chrome/browser/sync/glue/session_model_associator.cc File chrome/browser/sync/glue/session_model_associator.cc (right): https://codereview.chromium.org/16421003/diff/41018/chrome/browser/sync/glue/session_model_associator.cc#newcode1175 chrome/browser/sync/glue/session_model_associator.cc:1175: syncer::WriteTransaction trans(FROM_HERE, sync_service_->GetUserShare()); Thanks, I am going to try ...
7 years, 6 months ago (2013-06-07 19:08:35 UTC) #7
shashi
In order to apply feedback, I had to rewrite TabNodePool. The new TabNodePool now maintains ...
7 years, 6 months ago (2013-06-11 19:15:06 UTC) #8
shashi
I realized in our current design the size of free nodes can grow without bound, ...
7 years, 6 months ago (2013-06-11 20:38:14 UTC) #9
Yaron
android-y bits look fine. I assume Nicolas is looking at SMA and TabNodePool
7 years, 6 months ago (2013-06-12 20:02:56 UTC) #10
Yaron
err they lgtm
7 years, 6 months ago (2013-06-12 20:03:04 UTC) #11
Nicolas Zea
https://codereview.chromium.org/16421003/diff/134001/chrome/browser/sync/glue/session_model_associator.cc File chrome/browser/sync/glue/session_model_associator.cc (right): https://codereview.chromium.org/16421003/diff/134001/chrome/browser/sync/glue/session_model_associator.cc#newcode216 chrome/browser/sync/glue/session_model_associator.cc:216: // GetTabAt can return a null tab, in case ...
7 years, 6 months ago (2013-06-19 21:35:33 UTC) #12
shashi
PTAL https://codereview.chromium.org/16421003/diff/134001/chrome/browser/sync/glue/session_model_associator.cc File chrome/browser/sync/glue/session_model_associator.cc (right): https://codereview.chromium.org/16421003/diff/134001/chrome/browser/sync/glue/session_model_associator.cc#newcode216 chrome/browser/sync/glue/session_model_associator.cc:216: // GetTabAt can return a null tab, in ...
7 years, 6 months ago (2013-06-20 00:49:32 UTC) #13
shashi
Gentle reminder.
7 years, 6 months ago (2013-06-22 00:09:03 UTC) #14
Nicolas Zea
LGTM! https://chromiumcodereview.appspot.com/16421003/diff/166001/chrome/browser/sync/glue/tab_node_pool_unittest.cc File chrome/browser/sync/glue/tab_node_pool_unittest.cc (right): https://chromiumcodereview.appspot.com/16421003/diff/166001/chrome/browser/sync/glue/tab_node_pool_unittest.cc#newcode45 chrome/browser/sync/glue/tab_node_pool_unittest.cc:45: remove newline
7 years, 6 months ago (2013-06-22 00:28:05 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/shashishekhar@chromium.org/16421003/177001
7 years, 6 months ago (2013-06-22 04:40:35 UTC) #16
commit-bot: I haz the power
7 years, 6 months ago (2013-06-22 13:49:57 UTC) #17
Message was sent while issue was closed.
Change committed as 208024

Powered by Google App Engine
This is Rietveld 408576698