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

Issue 2753753005: [sync] WebContentsObserver based sessions notifications (Closed)

Created:
3 years, 9 months ago by Patrick Noland
Modified:
3 years, 9 months ago
CC:
chromium-reviews, ios-reviews+chrome_chromium.org, ios-reviews_chromium.org, pkl (ping after 24h if needed), noyau+watch_chromium.org, mac-reviews_chromium.org, marq+watch_chromium.org, sync-reviews_chromium.org, sdefresne+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[sync] WebContentsObserver based sessions notifications Aggregate individual WebContentsObservers to notify sync of sessions changes This CL introduces the SyncSessionsWebContentsRouter and the SyncSessionsRouterTabHelper, which replace the old NotificationServiceSessionsRouter. The SyncSessionsWebContentsRouter aggregates events from the individual TabHelpers, which are scoped to individual tabs, and pushes them to SessionsSyncManager. SyncSessionsWebContentsRouters are given a source tab id property which is set when a tab is created directly from another tab, e.g. by ctrl clicking. Some changes are made to SessionsHelper so that it can continue to correctly wait for tabs to load without using Notifications. R=zea@chromium.org BUG=695241 Review-Url: https://codereview.chromium.org/2753753005 Cr-Commit-Position: refs/heads/master@{#459225} Committed: https://chromium.googlesource.com/chromium/src/+/1901afa5e03bad9ce8a72691f746a685038241b0

Patch Set 1 : [sync] WebContentsObserver based sessions notifications #

Total comments: 46

Patch Set 2 : [sync] WebContentsObserver based sessions notifications #

Patch Set 3 : Separate non-android class #

Total comments: 16

Patch Set 4 : Use composition #

Total comments: 4

Patch Set 5 : use base:MakeUnique, alphabetize #

Unified diffs Side-by-side diffs Delta from patch set Stats (+724 lines, -434 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 2 chunks +10 lines, -2 lines 0 comments Download
M chrome/browser/sync/chrome_sync_client.cc View 1 2 3 3 chunks +10 lines, -5 lines 0 comments Download
M chrome/browser/sync/glue/synced_tab_delegate_android.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/glue/synced_tab_delegate_android.cc View 1 chunk +4 lines, -0 lines 0 comments Download
A chrome/browser/sync/sessions/browser_list_router_helper.h View 1 2 3 1 chunk +42 lines, -0 lines 0 comments Download
A chrome/browser/sync/sessions/browser_list_router_helper.cc View 1 2 3 1 chunk +45 lines, -0 lines 0 comments Download
D chrome/browser/sync/sessions/notification_service_sessions_router.h View 1 chunk +0 lines, -84 lines 0 comments Download
D chrome/browser/sync/sessions/notification_service_sessions_router.cc View 1 chunk +0 lines, -214 lines 0 comments Download
A chrome/browser/sync/sessions/sync_sessions_router_tab_helper.h View 1 2 3 1 chunk +80 lines, -0 lines 0 comments Download
A chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc View 1 2 1 chunk +82 lines, -0 lines 0 comments Download
A chrome/browser/sync/sessions/sync_sessions_web_contents_router.h View 1 2 3 1 chunk +72 lines, -0 lines 0 comments Download
A chrome/browser/sync/sessions/sync_sessions_web_contents_router.cc View 1 2 3 1 chunk +80 lines, -0 lines 0 comments Download
A chrome/browser/sync/sessions/sync_sessions_web_contents_router_factory.h View 1 2 1 chunk +52 lines, -0 lines 0 comments Download
A chrome/browser/sync/sessions/sync_sessions_web_contents_router_factory.cc View 1 2 3 1 chunk +40 lines, -0 lines 0 comments Download
M chrome/browser/sync/test/integration/sessions_helper.h View 1 2 3 4 chunks +24 lines, -10 lines 0 comments Download
M chrome/browser/sync/test/integration/sessions_helper.cc View 1 2 3 8 chunks +62 lines, -63 lines 0 comments Download
M chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc View 1 2 3 4 4 chunks +35 lines, -2 lines 0 comments Download
M chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/app_menu/app_menu_controller_unittest.mm View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc View 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/ui/tab_helpers.cc View 1 2 3 4 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc View 1 2 3 4 2 chunks +13 lines, -9 lines 0 comments Download
M components/browser_sync/profile_sync_service.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M components/sync_sessions/fake_sync_sessions_client.h View 1 chunk +1 line, -2 lines 0 comments Download
M components/sync_sessions/fake_sync_sessions_client.cc View 1 chunk +1 line, -2 lines 0 comments Download
M components/sync_sessions/sessions_sync_manager.h View 2 chunks +2 lines, -2 lines 0 comments Download
M components/sync_sessions/sessions_sync_manager.cc View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M components/sync_sessions/sessions_sync_manager_unittest.cc View 1 2 6 chunks +8 lines, -9 lines 0 comments Download
M components/sync_sessions/sync_sessions_client.h View 1 chunk +1 line, -2 lines 0 comments Download
M components/sync_sessions/synced_session_tracker.cc View 1 2 6 chunks +7 lines, -8 lines 0 comments Download
M components/sync_sessions/synced_session_tracker_unittest.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M components/sync_sessions/synced_tab_delegate.h View 1 2 2 chunks +6 lines, -0 lines 0 comments Download
M components/sync_sessions/tab_node_pool.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M components/sync_sessions/tab_node_pool.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M ios/chrome/browser/sync/ios_chrome_sync_client.mm View 1 2 3 4 2 chunks +12 lines, -8 lines 0 comments Download
M ios/chrome/browser/sync/ios_chrome_synced_tab_delegate.h View 1 chunk +1 line, -0 lines 0 comments Download
M ios/chrome/browser/sync/ios_chrome_synced_tab_delegate.mm View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 58 (46 generated)
Nicolas Zea
https://codereview.chromium.org/2753753005/diff/20001/chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc File chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc (right): https://codereview.chromium.org/2753753005/diff/20001/chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc#newcode68 chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc:68: DLOG(WARNING) << source_tab_id; forget to remove? https://codereview.chromium.org/2753753005/diff/20001/chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc#newcode71 chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc:71: new_contents ...
3 years, 9 months ago (2017-03-16 19:57:44 UTC) #12
Patrick Noland
https://codereview.chromium.org/2753753005/diff/20001/chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc File chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc (right): https://codereview.chromium.org/2753753005/diff/20001/chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc#newcode71 chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc:71: new_contents != web_contents() && source_tab_id != kUnknownTabID) { On ...
3 years, 9 months ago (2017-03-16 20:23:27 UTC) #13
Patrick Noland
Nicolas, PTAL https://codereview.chromium.org/2753753005/diff/20001/chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc File chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc (right): https://codereview.chromium.org/2753753005/diff/20001/chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc#newcode68 chrome/browser/sync/sessions/sync_sessions_router_tab_helper.cc:68: DLOG(WARNING) << source_tab_id; On 2017/03/16 19:57:43, Nicolas ...
3 years, 9 months ago (2017-03-17 00:20:11 UTC) #23
Nicolas Zea
Mostly LG! Mainly some style issues https://codereview.chromium.org/2753753005/diff/80001/chrome/browser/sync/sessions/sync_sessions_multi_windowed_web_contents_router.h File chrome/browser/sync/sessions/sync_sessions_multi_windowed_web_contents_router.h (right): https://codereview.chromium.org/2753753005/diff/80001/chrome/browser/sync/sessions/sync_sessions_multi_windowed_web_contents_router.h#newcode20 chrome/browser/sync/sessions/sync_sessions_multi_windowed_web_contents_router.h:20: class SyncSessionsMultiWindowedWebContentsRouter Multi-windowed ...
3 years, 9 months ago (2017-03-20 18:14:50 UTC) #26
Patrick Noland
Nicolas, PTAL I think the trybot failure is an unrelated flake: http://crbug/703830 https://codereview.chromium.org/2753753005/diff/80001/chrome/browser/sync/sessions/sync_sessions_multi_windowed_web_contents_router.h File chrome/browser/sync/sessions/sync_sessions_multi_windowed_web_contents_router.h ...
3 years, 9 months ago (2017-03-21 22:54:31 UTC) #41
Nicolas Zea
LGTM!
3 years, 9 months ago (2017-03-22 20:47:56 UTC) #42
Patrick Noland
+Avi for tab_helpers and app_menu_controller_unittest +pkasting for recent_tabs_sub_menu_model_unittest Avi & Peter, PTAL
3 years, 9 months ago (2017-03-22 21:39:22 UTC) #45
Peter Kasting
LGTM https://codereview.chromium.org/2753753005/diff/140001/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc File chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc (right): https://codereview.chromium.org/2753753005/diff/140001/chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc#newcode133 chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc:133: dummy_router_.reset(new DummyRouter()); Nit: Prefer MakeUnique over bare new: ...
3 years, 9 months ago (2017-03-22 21:52:15 UTC) #46
Avi (use Gerrit)
lgtm with fix https://codereview.chromium.org/2753753005/diff/140001/chrome/browser/ui/tab_helpers.cc File chrome/browser/ui/tab_helpers.cc (right): https://codereview.chromium.org/2753753005/diff/140001/chrome/browser/ui/tab_helpers.cc#newcode215 chrome/browser/ui/tab_helpers.cc:215: Profile::FromBrowserContext(web_contents->GetBrowserContext()))); Be alphabetical. I'll alphabetize the ...
3 years, 9 months ago (2017-03-23 02:27:08 UTC) #47
Patrick Noland
https://codereview.chromium.org/2753753005/diff/140001/chrome/browser/ui/tab_helpers.cc File chrome/browser/ui/tab_helpers.cc (right): https://codereview.chromium.org/2753753005/diff/140001/chrome/browser/ui/tab_helpers.cc#newcode215 chrome/browser/ui/tab_helpers.cc:215: Profile::FromBrowserContext(web_contents->GetBrowserContext()))); On 2017/03/23 02:27:07, Avi wrote: > Be alphabetical. ...
3 years, 9 months ago (2017-03-23 20:15:03 UTC) #52
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/2753753005/160001
3 years, 9 months ago (2017-03-23 20:15:40 UTC) #55
commit-bot: I haz the power
3 years, 9 months ago (2017-03-23 21:24:59 UTC) #58
Message was sent while issue was closed.
Committed patchset #5 (id:160001) as
https://chromium.googlesource.com/chromium/src/+/1901afa5e03bad9ce8a72691f746...

Powered by Google App Engine
This is Rietveld 408576698