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

Issue 15055003: Do not submit: high level overview patch. (Closed)

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

Description

Do not submit: high level overview patch. Uploaded for high level guidance. My plan is to split the patch into multiple patches and land each with some test coverage. This patch only shows part of changes to the existing test coverage. Details of changes: 1. Persist sync id with tab. 2. Store sync id in SessionTabHelper. 3. On Android side, make tab id for Java and native tabs same.(part of this is in a separate downstream patch, I might move the code to tab_android so it is reviewable upstream). 4. Change tab node pool and session association logic. BUG=139666, 139670, 125549

Patch Set 1 : #

Patch Set 2 : fix build. #

Total comments: 9
Unified diffs Side-by-side diffs Delta from patch set Stats (+653 lines, -180 lines) Patch
M chrome/android/testshell/testshell_tab.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/android/testshell/testshell_tab.cc View 1 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/android/tab_android.h View 3 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/android/tab_android.cc View 4 chunks +1 line, -10 lines 0 comments Download
M chrome/browser/sessions/base_session_service.h View 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/sessions/base_session_service.cc View 2 chunks +25 lines, -0 lines 0 comments Download
M chrome/browser/sessions/persistent_tab_restore_service.cc View 4 chunks +22 lines, -0 lines 0 comments Download
M chrome/browser/sessions/session_restore.cc View 2 chunks +16 lines, -13 lines 0 comments Download
M chrome/browser/sessions/session_service.h View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/sessions/session_service.cc View 8 chunks +35 lines, -0 lines 0 comments Download
M chrome/browser/sessions/session_tab_helper.h View 3 chunks +7 lines, -1 line 0 comments Download
M chrome/browser/sessions/session_tab_helper.cc View 1 chunk +7 lines, -2 lines 0 comments Download
M chrome/browser/sessions/session_types.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/sessions/session_types.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sessions/tab_restore_service.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/sessions/tab_restore_service.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sessions/tab_restore_service_delegate.h View 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/sessions/tab_restore_service_helper.cc View 4 chunks +25 lines, -20 lines 0 comments Download
M chrome/browser/sync/glue/session_change_processor.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/glue/session_model_associator.h View 4 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/session_model_associator.cc View 17 chunks +67 lines, -20 lines 7 comments Download
M chrome/browser/sync/glue/session_model_associator_unittest.cc View 6 chunks +15 lines, -5 lines 0 comments Download
M chrome/browser/sync/glue/synced_tab_delegate.h View 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/synced_window_delegate_android.cc View 2 chunks +4 lines, -6 lines 0 comments Download
M chrome/browser/sync/glue/tab_node_pool.h View 3 chunks +20 lines, -3 lines 0 comments Download
M chrome/browser/sync/glue/tab_node_pool.cc View 4 chunks +60 lines, -17 lines 2 comments Download
M chrome/browser/sync/glue/tab_node_pool_unittest.cc View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_session_unittest.cc View 1 5 chunks +54 lines, -2 lines 0 comments Download
M chrome/browser/ui/android/tab_model/tab_model.h View 3 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/ui/android/tab_model/tab_model.cc View 3 chunks +24 lines, -0 lines 0 comments Download
M chrome/browser/ui/android/tab_model/tab_model_unittest.cc View 1 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/ui/browser_tab_restore_service_delegate.h View 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/ui/browser_tab_restore_service_delegate.cc View 1 chunk +36 lines, -22 lines 0 comments Download
M chrome/browser/ui/browser_tabrestore.h View 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/ui/browser_tabrestore.cc View 5 chunks +17 lines, -9 lines 0 comments Download
M chrome/browser/ui/sync/browser_synced_window_delegate.cc View 1 chunk +1 line, -1 line 0 comments Download
A + chrome/browser/ui/sync/synced_tab_delegate_android.h View 2 chunks +17 lines, -16 lines 0 comments Download
A chrome/browser/ui/sync/synced_tab_delegate_android.cc View 1 chunk +106 lines, -0 lines 0 comments Download
M chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h View 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc View 2 chunks +15 lines, -5 lines 0 comments Download
M chrome/chrome_browser_ui.gypi View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/common/chrome_notification_types.h View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
shashi
Corresponding downstream patch: https://gerrit-int.chromium.org/#/c/37832/
7 years, 7 months ago (2013-05-13 23:47:29 UTC) #1
Nicolas Zea
https://codereview.chromium.org/15055003/diff/16001/chrome/browser/sync/glue/session_model_associator.cc File chrome/browser/sync/glue/session_model_associator.cc (right): https://codereview.chromium.org/15055003/diff/16001/chrome/browser/sync/glue/session_model_associator.cc#newcode253 chrome/browser/sync/glue/session_model_associator.cc:253: UpdateTabIdForOldTab(tab_delegate->GetSyncSessionId(), tab_id); I don't think you should ever update ...
7 years, 7 months ago (2013-05-16 22:59:02 UTC) #2
shashi
7 years, 7 months ago (2013-05-17 00:29:15 UTC) #3
Nicolas, thanks a lot for comments, I will incorporate some of the feedback when
I start uploading patches.

https://codereview.chromium.org/15055003/diff/16001/chrome/browser/sync/glue/...
File chrome/browser/sync/glue/session_model_associator.cc (right):

https://codereview.chromium.org/15055003/diff/16001/chrome/browser/sync/glue/...
chrome/browser/sync/glue/session_model_associator.cc:253:
UpdateTabIdForOldTab(tab_delegate->GetSyncSessionId(), tab_id);
When restore happens, the tab ids (different from tab_node_id) are
reinitialized.
I discovered this during prototyping, easiest way to explain this is by an
example:
Lets say before restore I had 3 tabs (A,B,C) with tab ids (1, 2, 3) after
restore the tab ids may be (20, 30, 10).
Suppose only tab A is in memory.
After tab association, the window_s will have tabs:
(2, 30, 10). We will rewrite the session node for A. 
So A will have tab_id=20 but since B and C are not in memory the session nodes
for them will be unchanged and will have 2 and 3 tab ids.

Remote client will see a window with tab ids: (20, 30, 10) but will not able to
make out the tab nodes corresponding to these tab ids.


On 2013/05/16 22:59:03, Nicolas Zea wrote:
> I don't think you should ever update the tab id. That's just sync's id for the
> current tab node count at the time it was created. Multiple tabs, over the
life
> of a sync session, can use the tab sync node, but the tab id for that sync
node
> should never change. Perhaps I'm misunderstanding something?

https://codereview.chromium.org/15055003/diff/16001/chrome/browser/sync/glue/...
chrome/browser/sync/glue/session_model_associator.cc:389:
NotifySyncIdGenerated(tab);
On 2013/05/16 22:59:03, Nicolas Zea wrote:
> would it be better to have the equivalency check and the notify call part of
the
> SetSyncSessionId method?

https://codereview.chromium.org/15055003/diff/16001/chrome/browser/sync/glue/...
chrome/browser/sync/glue/session_model_associator.cc:389:
NotifySyncIdGenerated(tab);
Yes, I can replace it with an equivalency check, any maybe generate notification
directly from SetSyncSessionId.

On 2013/05/16 22:59:03, Nicolas Zea wrote:
> would it be better to have the equivalency check and the notify call part of
the
> SetSyncSessionId method?

https://codereview.chromium.org/15055003/diff/16001/chrome/browser/sync/glue/...
chrome/browser/sync/glue/session_model_associator.cc:807:
tab_pool_.AddTabNode(id, specifics.tab_node_id());
Good point, I should  handle the case for multiple header nodes/corrupted nodes.
Will fix this.
On 2013/05/16 22:59:03, Nicolas Zea wrote:
> else tombstone? (it would be the above error case where more than one session
> header was found or the node was just corrupted somehow)

https://codereview.chromium.org/15055003/diff/16001/chrome/browser/sync/glue/...
File chrome/browser/sync/glue/tab_node_pool.cc (right):

https://codereview.chromium.org/15055003/diff/16001/chrome/browser/sync/glue/...
chrome/browser/sync/glue/tab_node_pool.cc:73: tab_node.Tombstone();
Yes, they should be returned to the free tab pool., this is a remnant from my
prototype. I was debugging and found it easier to just delete the sync node.
Btw should we limit the number of free nodes. 
Can there be scenarios like crashes, when we lose tabs and keep adding back to
the free tab pool. Should we limit adding to free tab pool, if we have say 25
free tab nodes?

On 2013/05/16 22:59:03, Nicolas Zea wrote:
> shouldn't these nodes be added to the tab_syncid_pool? Otherwise you'll
> constantly be creating new nodes with ever increasing ids, and losing the ids
of
> old nodes right?

Powered by Google App Engine
This is Rietveld 408576698