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

Issue 2741413007: Refactoring Reload in NavigationManager and CRWWebController. (Closed)

Created:
3 years, 9 months ago by liaoyuke
Modified:
3 years, 9 months ago
CC:
chromium-reviews, Eugene But (OOO till 7-30), ios-reviews+web_chromium.org, ios-reviews_chromium.org, sdefresne
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactoring Reload in NavigationManager and CRWWebController. Previously, the |Reload| function in NavigationManager goes all the way up to BrowserViewController to call web state's |openURLWithParams|, which is completely unnecessary. Additionally, CRWWebController doesn't use the transition type to call |-reload| when appropriate. This CL first eliminates the excessive indirections by changing the implementations of |Reload| function in NavigationManager to call |LoadURLWithParams| directly and then updates callers of CRWWebController's |Reload| to call NavigationManager's |Reload| to correct layer violations. This CL also adds a DCHECK to CRWWebController's |-loadWithParams:| to make sure that it won't be called with PAGE_TRANSITION_RELOAD. BUG=700569 Review-Url: https://codereview.chromium.org/2741413007 Cr-Commit-Position: refs/heads/master@{#457825} Committed: https://chromium.googlesource.com/chromium/src/+/563dc4a98290952cd8058a891574bfecce24c03c

Patch Set 1 #

Patch Set 2 : Addressed self review comments #

Patch Set 3 : Addressed high level comments #

Total comments: 2

Patch Set 4 : Remove unused methods in navigation manager delegate #

Total comments: 13

Patch Set 5 : change value of check_for_repost to false whereever necessary #

Patch Set 6 : tentative change #

Total comments: 8

Patch Set 7 : fixed more check_for_repost errors #

Total comments: 9

Patch Set 8 : Addressed comments #

Patch Set 9 : Rebase and Remove DCHECK in |loadWithParams| as it has already been taken care of #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -35 lines) Patch
M ios/chrome/browser/geolocation/omnibox_geolocation_controller.mm View 1 2 3 4 2 chunks +6 lines, -4 lines 0 comments Download
M ios/chrome/browser/tabs/tab.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -1 line 0 comments Download
M ios/chrome/browser/tabs/tab.mm View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -8 lines 0 comments Download
M ios/chrome/browser/ui/browser_view_controller.mm View 1 2 3 4 5 6 7 8 3 chunks +22 lines, -7 lines 0 comments Download
M ios/web/navigation/navigation_manager_delegate.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
M ios/web/navigation/navigation_manager_impl.mm View 1 2 3 4 5 6 7 8 1 chunk +1 line, -10 lines 0 comments Download
M ios/web/navigation/navigation_manager_impl_unittest.mm View 1 2 3 4 5 6 2 chunks +17 lines, -0 lines 0 comments Download
M ios/web/public/navigation_manager.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -3 lines 0 comments Download
M ios/web/web_state/ui/crw_web_controller.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M ios/web/web_state/web_state_impl.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M ios/web/web_state/web_state_impl.mm View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M ios/web_view/internal/cwv_web_view.mm View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 50 (31 generated)
liaoyuke
Hey Eugene, Kurt PTAL. Thank you very much!
3 years, 9 months ago (2017-03-14 23:01:22 UTC) #11
liaoyuke
CC Sylvain as Eugene told me you are also looking into cleaning up Reload.
3 years, 9 months ago (2017-03-14 23:03:05 UTC) #12
kkhorimoto
The CL description here is not quite accurate, since a pending item is not created ...
3 years, 9 months ago (2017-03-15 00:26:53 UTC) #13
liaoyuke
PTAL. Thanks!
3 years, 9 months ago (2017-03-15 16:16:41 UTC) #16
kkhorimoto
lgtm after you remove the unnecessary GetWebController() https://codereview.chromium.org/2741413007/diff/100001/ios/web/navigation/navigation_manager_delegate.h File ios/web/navigation/navigation_manager_delegate.h (right): https://codereview.chromium.org/2741413007/diff/100001/ios/web/navigation/navigation_manager_delegate.h#newcode46 ios/web/navigation/navigation_manager_delegate.h:46: virtual CRWWebController* ...
3 years, 9 months ago (2017-03-15 17:16:13 UTC) #17
liaoyuke
Hey Eugene, PTAL. Thanks! https://codereview.chromium.org/2741413007/diff/100001/ios/web/navigation/navigation_manager_delegate.h File ios/web/navigation/navigation_manager_delegate.h (right): https://codereview.chromium.org/2741413007/diff/100001/ios/web/navigation/navigation_manager_delegate.h#newcode46 ios/web/navigation/navigation_manager_delegate.h:46: virtual CRWWebController* GetWebController() = 0; ...
3 years, 9 months ago (2017-03-15 17:32:39 UTC) #19
kkhorimoto
Could you also update the CL description with the changes you made to CRWWebController? Thanks.
3 years, 9 months ago (2017-03-15 17:34:24 UTC) #20
liaoyuke
Done. Thank you for catching this! On Wed, Mar 15, 2017 at 10:34 AM <kkhorimoto@chromium.org> ...
3 years, 9 months ago (2017-03-15 17:48:16 UTC) #22
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2741413007/diff/140001/ios/chrome/browser/geolocation/omnibox_geolocation_controller.mm File ios/chrome/browser/geolocation/omnibox_geolocation_controller.mm (right): https://codereview.chromium.org/2741413007/diff/140001/ios/chrome/browser/geolocation/omnibox_geolocation_controller.mm#newcode460 ios/chrome/browser/geolocation/omnibox_geolocation_controller.mm:460: navigationManager->Reload(web::ReloadType::NORMAL, What is this called? check_for_repost means that FormResubmission ...
3 years, 9 months ago (2017-03-15 17:53:32 UTC) #23
kkhorimoto
https://codereview.chromium.org/2741413007/diff/140001/ios/web/web_state/ui/crw_web_controller.mm File ios/web/web_state/ui/crw_web_controller.mm (right): https://codereview.chromium.org/2741413007/diff/140001/ios/web/web_state/ui/crw_web_controller.mm#newcode1848 ios/web/web_state/ui/crw_web_controller.mm:1848: ui::PAGE_TRANSITION_RELOAD)) { On 2017/03/15 17:53:32, Eugene But wrote: > ...
3 years, 9 months ago (2017-03-15 18:04:11 UTC) #24
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2741413007/diff/140001/ios/web/web_state/ui/crw_web_controller.mm File ios/web/web_state/ui/crw_web_controller.mm (right): https://codereview.chromium.org/2741413007/diff/140001/ios/web/web_state/ui/crw_web_controller.mm#newcode1848 ios/web/web_state/ui/crw_web_controller.mm:1848: ui::PAGE_TRANSITION_RELOAD)) { On 2017/03/15 18:04:11, kkhorimoto_ wrote: > On ...
3 years, 9 months ago (2017-03-15 18:07:11 UTC) #25
liaoyuke
Actually, the fact that we are ignoring all WebLoadParams except originalParams.transition_type is making me quite ...
3 years, 9 months ago (2017-03-16 16:22:20 UTC) #26
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2741413007/diff/180001/ios/chrome/browser/tabs/tab.mm File ios/chrome/browser/tabs/tab.mm (right): https://codereview.chromium.org/2741413007/diff/180001/ios/chrome/browser/tabs/tab.mm#newcode2003 ios/chrome/browser/tabs/tab.mm:2003: web::ReloadType::NORMAL, false /* check_for_repost */); This is called from ...
3 years, 9 months ago (2017-03-16 17:17:47 UTC) #27
liaoyuke
https://codereview.chromium.org/2741413007/diff/180001/ios/chrome/browser/tabs/tab.mm File ios/chrome/browser/tabs/tab.mm (right): https://codereview.chromium.org/2741413007/diff/180001/ios/chrome/browser/tabs/tab.mm#newcode2003 ios/chrome/browser/tabs/tab.mm:2003: web::ReloadType::NORMAL, false /* check_for_repost */); On 2017/03/16 17:17:47, Eugene ...
3 years, 9 months ago (2017-03-16 18:10:42 UTC) #30
kkhorimoto
I generally like this approach, as Eugene is doing something similar for back/forward navigations in ...
3 years, 9 months ago (2017-03-16 18:13:05 UTC) #31
Eugene But (OOO till 7-30)
lgtm Thanks! https://codereview.chromium.org/2741413007/diff/240001/ios/web/navigation/navigation_manager_delegate.h File ios/web/navigation/navigation_manager_delegate.h (right): https://codereview.chromium.org/2741413007/diff/240001/ios/web/navigation/navigation_manager_delegate.h#newcode30 ios/web/navigation/navigation_manager_delegate.h:30: // Informs that delegate to reload. Instructs ...
3 years, 9 months ago (2017-03-16 18:39:04 UTC) #32
liaoyuke
Thank you very much for reviewing! :) https://codereview.chromium.org/2741413007/diff/240001/ios/web/navigation/navigation_manager_delegate.h File ios/web/navigation/navigation_manager_delegate.h (right): https://codereview.chromium.org/2741413007/diff/240001/ios/web/navigation/navigation_manager_delegate.h#newcode30 ios/web/navigation/navigation_manager_delegate.h:30: // Informs ...
3 years, 9 months ago (2017-03-17 17:59:21 UTC) #40
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/2741413007/320001
3 years, 9 months ago (2017-03-17 18:27:24 UTC) #47
commit-bot: I haz the power
3 years, 9 months ago (2017-03-17 18:37:22 UTC) #50
Message was sent while issue was closed.
Committed patchset #9 (id:320001) as
https://chromium.googlesource.com/chromium/src/+/563dc4a98290952cd8058a891574...

Powered by Google App Engine
This is Rietveld 408576698