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

Issue 2775623002: [ios] WebStateList owns all WebState it manages. (Closed)

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

Description

[ios] WebStateList owns all WebState it manages. Flip the Tab and WebState ownership relationship so that WebState owns (indirectly via the LegacyTabHelper tab helper) the Tab. This required: - Changing Contextual Seach and pre-renderer to own WebStates. - Adding observers and delegates for WebStateList events to create and cleanup the Tab when a WebState is added or detached from the WebStateList. Change the WebStateList API to take WebState via std::unique_ptr<> to enforce correct use of the API. BUG=546222 Review-Url: https://codereview.chromium.org/2775623002 Cr-Commit-Position: refs/heads/master@{#461750} Committed: https://chromium.googlesource.com/chromium/src/+/2c600c5850d71dc0afca1cd196698eddc2ab598d

Patch Set 1 #

Patch Set 2 : Rebase on origin/master. #

Patch Set 3 : Fix ios_chrome_unittests. #

Total comments: 17

Patch Set 4 : Address comments, add documentation, fix CRWWebController delegate. #

Patch Set 5 : Clean DEPS. #

Patch Set 6 : Fix ios_chrome_unittests. #

Patch Set 7 : Rebase on origin/master. #

Patch Set 8 : Remove Tab -willClose method (Tab implements CRWWebControllerObserver protocol). #

Total comments: 14

Patch Set 9 : Rebase #

Patch Set 10 : Address comment (except WebStateList ownership revert). #

Patch Set 11 : Fix gn check #

Unified diffs Side-by-side diffs Delta from patch set Stats (+761 lines, -887 lines) Patch
M ios/chrome/browser/sessions/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.mm View 1 2 3 3 chunks +9 lines, -9 lines 0 comments Download
M ios/chrome/browser/tabs/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 5 chunks +6 lines, -1 line 0 comments Download
M ios/chrome/browser/tabs/legacy_tab_helper.h View 1 2 3 1 chunk +8 lines, -13 lines 0 comments Download
M ios/chrome/browser/tabs/legacy_tab_helper.mm View 1 2 3 3 chunks +7 lines, -6 lines 0 comments Download
M ios/chrome/browser/tabs/tab.h View 1 2 3 4 5 6 7 8 4 chunks +2 lines, -44 lines 0 comments Download
M ios/chrome/browser/tabs/tab.mm View 1 2 3 4 5 6 7 8 11 chunks +63 lines, -187 lines 0 comments Download
M ios/chrome/browser/tabs/tab_helper_util.mm View 1 3 chunks +7 lines, -0 lines 0 comments Download
A ios/chrome/browser/tabs/tab_lifecycle.md View 1 2 3 4 5 6 7 1 chunk +41 lines, -0 lines 0 comments Download
M ios/chrome/browser/tabs/tab_model.h View 2 chunks +0 lines, -17 lines 0 comments Download
M ios/chrome/browser/tabs/tab_model.mm View 1 2 3 4 5 6 7 8 9 20 chunks +108 lines, -224 lines 0 comments Download
A ios/chrome/browser/tabs/tab_model_closing_web_state_observer.h View 1 chunk +28 lines, -0 lines 0 comments Download
A ios/chrome/browser/tabs/tab_model_closing_web_state_observer.mm View 1 2 3 4 5 6 7 1 chunk +89 lines, -0 lines 0 comments Download
M ios/chrome/browser/tabs/tab_model_observers_bridge.mm View 1 chunk +8 lines, -0 lines 0 comments Download
M ios/chrome/browser/tabs/tab_model_unittest.mm View 1 2 3 4 5 6 7 8 9 3 chunks +24 lines, -16 lines 0 comments Download
M ios/chrome/browser/tabs/tab_model_web_state_list_delegate.mm View 2 chunks +18 lines, -2 lines 0 comments Download
M ios/chrome/browser/tabs/tab_private.h View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -1 line 0 comments Download
M ios/chrome/browser/tabs/tab_unittest.mm View 1 2 3 4 5 6 7 8 7 chunks +16 lines, -17 lines 0 comments Download
M ios/chrome/browser/ui/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M ios/chrome/browser/ui/browser_view_controller.mm View 1 2 3 4 5 6 7 8 5 chunks +27 lines, -12 lines 0 comments Download
M ios/chrome/browser/ui/browser_view_controller_unittest.mm View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -2 lines 0 comments Download
M ios/chrome/browser/ui/contextual_search/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M ios/chrome/browser/ui/contextual_search/contextual_search_controller.h View 2 chunks +5 lines, -2 lines 0 comments Download
M ios/chrome/browser/ui/contextual_search/contextual_search_results_view.mm View 1 2 3 4 5 6 7 8 chunks +61 lines, -35 lines 0 comments Download
M ios/chrome/browser/ui/fullscreen_controller.mm View 1 chunk +0 lines, -4 lines 0 comments Download
M ios/chrome/browser/ui/omnibox_perftest.mm View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -4 lines 0 comments Download
M ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.mm View 1 chunk +0 lines, -1 line 0 comments Download
M ios/chrome/browser/ui/preload_controller.h View 4 chunks +10 lines, -64 lines 0 comments Download
M ios/chrome/browser/ui/preload_controller.mm View 1 2 3 4 5 6 7 8 9 6 chunks +98 lines, -27 lines 0 comments Download
D ios/chrome/browser/ui/tab_switcher/DEPS View 1 2 3 4 1 chunk +0 lines, -7 lines 0 comments Download
M ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm View 1 2 3 4 5 6 7 8 9 3 chunks +18 lines, -44 lines 0 comments Download
M ios/chrome/browser/ui/tabs/tab_strip_controller_unittest.mm View 1 chunk +0 lines, -2 lines 0 comments Download
M ios/chrome/browser/ui/toolbar/toolbar_model_impl_ios_unittest.mm View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -3 lines 0 comments Download
M ios/clean/chrome/browser/ui/tab_grid/tab_grid_coordinator.mm View 1 2 3 4 5 6 7 8 3 chunks +3 lines, -4 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list.h View 4 chunks +14 lines, -18 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list.mm View 1 6 chunks +56 lines, -43 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list_fast_enumeration_helper_unittest.mm View 2 chunks +2 lines, -3 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list_order_controller_unittest.mm View 1 3 chunks +6 lines, -6 lines 0 comments Download
M ios/shared/chrome/browser/tabs/web_state_list_unittest.mm View 1 7 chunks +7 lines, -67 lines 0 comments Download
M ios/shared/chrome/browser/ui/browser_list/browser.mm View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 36 (25 generated)
sdefresne
Please take a look.
3 years, 9 months ago (2017-03-23 16:31:28 UTC) #2
sdefresne
ping
3 years, 9 months ago (2017-03-24 15:15:08 UTC) #12
rohitrao (ping after 24h)
Initial set of comments. I need to take a closer look at some of these ...
3 years, 9 months ago (2017-03-26 23:21:22 UTC) #15
sdefresne
rohitrao: please take another look. https://codereview.chromium.org/2775623002/diff/60001/ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.mm File ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.mm (right): https://codereview.chromium.org/2775623002/diff/60001/ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.mm#newcode116 ios/chrome/browser/sessions/tab_restore_service_delegate_impl_ios.mm:116: [model closeTab:model.currentTab]; On 2017/03/26 ...
3 years, 8 months ago (2017-03-28 15:15:05 UTC) #17
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2775623002/diff/60001/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm File ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm (right): https://codereview.chromium.org/2775623002/diff/60001/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm#newcode53 ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm:53: #import "ios/web/web_state/ui/crw_web_controller.h" Could you please remove this import and ...
3 years, 8 months ago (2017-03-28 15:27:18 UTC) #19
sdefresne
On 2017/03/28 15:27:18, Eugene But wrote: > https://codereview.chromium.org/2775623002/diff/60001/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm > File ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm (right): > > https://codereview.chromium.org/2775623002/diff/60001/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm#newcode53 ...
3 years, 8 months ago (2017-03-28 15:33:04 UTC) #20
rohitrao (ping after 24h)
https://codereview.chromium.org/2775623002/diff/180001/ios/chrome/browser/tabs/tab.mm File ios/chrome/browser/tabs/tab.mm (right): https://codereview.chromium.org/2775623002/diff/180001/ios/chrome/browser/tabs/tab.mm#newcode1058 ios/chrome/browser/tabs/tab.mm:1058: [self.webController removeObserver:fullScreenController_]; Over IM, you mentioned that Tab is ...
3 years, 8 months ago (2017-04-03 17:49:35 UTC) #21
sdefresne
Please take another look. https://codereview.chromium.org/2775623002/diff/180001/ios/chrome/browser/tabs/tab.mm File ios/chrome/browser/tabs/tab.mm (right): https://codereview.chromium.org/2775623002/diff/180001/ios/chrome/browser/tabs/tab.mm#newcode1058 ios/chrome/browser/tabs/tab.mm:1058: [self.webController removeObserver:fullScreenController_]; On 2017/04/03 17:49:34, ...
3 years, 8 months ago (2017-04-04 13:47:57 UTC) #22
rohitrao (ping after 24h)
lgtm
3 years, 8 months ago (2017-04-04 14:07:36 UTC) #23
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/2775623002/240001
3 years, 8 months ago (2017-04-04 16:25:44 UTC) #33
commit-bot: I haz the power
3 years, 8 months ago (2017-04-04 16:51:40 UTC) #36
Message was sent while issue was closed.
Committed patchset #11 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/2c600c5850d71dc0afca1cd19669...

Powered by Google App Engine
This is Rietveld 408576698