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

Issue 2703333006: Move the notion of current Tab from TabModel to WebStateList. (Closed)

Created:
3 years, 10 months ago by sdefresne
Modified:
3 years, 9 months ago
CC:
chromium-reviews, marq+watch_chromium.org, pkl (ping after 24h if needed), noyau+watch_chromium.org, asvitkine+watch_chromium.org, sdefresne+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Move the notion of current Tab from TabModel to WebStateList. Add methods to track and set the currently active WebState in the WebStateList (referenced by index) and corresponding events when the active WebState is changed (explicitly or automatically after detaching a WebState). Add new WebStateListObserver (and WebStateListObserving when the observer need to keep a __weak pointer to an Objective-C class) that react to the event send when the active WebState changes. Add a -loadFinished property to Tab to avoid accessing the private //ios/web private API in new code. BUG=687207 Review-Url: https://codereview.chromium.org/2703333006 Cr-Commit-Position: refs/heads/master@{#454329} Committed: https://chromium.googlesource.com/chromium/src/+/2f7781ce46951904a2615fbda44d2a9f4ced23ca

Patch Set 1 #

Total comments: 7

Patch Set 2 : Address comment & restrict lifetime of NSDictionary. #

Patch Set 3 : Rebase. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+565 lines, -228 lines) Patch
M ios/chrome/browser/metrics/BUILD.gn View 1 2 1 chunk +17 lines, -0 lines 0 comments Download
A ios/chrome/browser/metrics/tab_usage_recorder_web_state_list_observer.h View 1 chunk +32 lines, -0 lines 0 comments Download
A ios/chrome/browser/metrics/tab_usage_recorder_web_state_list_observer.mm View 1 chunk +36 lines, -0 lines 0 comments Download
M ios/chrome/browser/snapshots/BUILD.gn View 1 chunk +17 lines, -0 lines 0 comments Download
A ios/chrome/browser/snapshots/snapshot_cache_web_state_list_observer.h View 1 chunk +32 lines, -0 lines 0 comments Download
A ios/chrome/browser/snapshots/snapshot_cache_web_state_list_observer.mm View 1 chunk +47 lines, -0 lines 0 comments Download
M ios/chrome/browser/tabs/BUILD.gn View 2 chunks +2 lines, -2 lines 0 comments Download
M ios/chrome/browser/tabs/tab.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M ios/chrome/browser/tabs/tab.mm View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M ios/chrome/browser/tabs/tab_model.mm View 1 2 23 chunks +49 lines, -126 lines 0 comments Download
M ios/chrome/browser/tabs/tab_model_observers_bridge.mm View 1 chunk +17 lines, -0 lines 0 comments Download
D ios/chrome/browser/tabs/tab_model_order_controller.h View 1 chunk +0 lines, -27 lines 0 comments Download
D ios/chrome/browser/tabs/tab_model_order_controller.mm View 1 chunk +0 lines, -67 lines 0 comments Download
A ios/chrome/browser/tabs/tab_model_selected_tab_observer.h View 1 chunk +24 lines, -0 lines 0 comments Download
A ios/chrome/browser/tabs/tab_model_selected_tab_observer.mm View 1 1 chunk +62 lines, -0 lines 0 comments Download
M ios/chrome/browser/ui/browser_view_controller.mm View 1 2 2 chunks +2 lines, -5 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list.h View 1 4 chunks +17 lines, -0 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list.mm View 1 2 6 chunks +53 lines, -0 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list_metrics_observer.h View 2 chunks +13 lines, -0 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list_metrics_observer.mm View 3 chunks +34 lines, -1 line 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list_observer.h View 1 chunk +10 lines, -0 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list_observer.mm View 1 chunk +6 lines, -0 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list_observer_bridge.h View 2 chunks +15 lines, -0 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list_observer_bridge.mm View 1 1 chunk +18 lines, -0 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list_order_controller.h View 1 chunk +8 lines, -0 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list_order_controller.mm View 1 chunk +47 lines, -0 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 23 (13 generated)
sdefresne
Please both take a look. I tried to split this CL in smaller parts but ...
3 years, 10 months ago (2017-02-21 16:33:48 UTC) #2
sdefresne
https://codereview.chromium.org/2703333006/diff/1/ios/chrome/browser/tabs/tab_model_selected_tab_observer.mm File ios/chrome/browser/tabs/tab_model_selected_tab_observer.mm (right): https://codereview.chromium.org/2703333006/diff/1/ios/chrome/browser/tabs/tab_model_selected_tab_observer.mm#newcode13 ios/chrome/browser/tabs/tab_model_selected_tab_observer.mm:13: __weak TabModel* _tabModel; This is an Objective-C class because ...
3 years, 10 months ago (2017-02-21 17:09:49 UTC) #3
marq (ping after 24h)
LGTM but it's very likely I missed some issues, so please wait for rohitrao@'s LGTM ...
3 years, 10 months ago (2017-02-21 17:23:11 UTC) #4
sdefresne
Thank you for the review. Yes, my plan is to wait for review by you ...
3 years, 10 months ago (2017-02-21 17:29:29 UTC) #5
rohitrao (ping after 24h)
lgtm I think this is ok. My biggest concern is that we're reordering the code ...
3 years, 10 months ago (2017-02-22 15:13:43 UTC) #6
sdefresne
I've not been able to find an issue with the re-ordering. If we want to ...
3 years, 10 months ago (2017-02-23 15:43:48 UTC) #7
sdefresne
rohitrao: ping
3 years, 9 months ago (2017-03-02 03:20:27 UTC) #12
rohitrao (ping after 24h)
LGTM I don't know of any concrete issues with reordering code either, was just pointing ...
3 years, 9 months ago (2017-03-02 18:26:40 UTC) #17
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/2703333006/40001
3 years, 9 months ago (2017-03-02 19:07:04 UTC) #20
commit-bot: I haz the power
3 years, 9 months ago (2017-03-02 19:13:34 UTC) #23
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/2f7781ce46951904a2615fbda44d...

Powered by Google App Engine
This is Rietveld 408576698