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

Issue 2698773002: [iOS] Refactoring web CRWSessionController user agent code. (Closed)

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

Description

[iOS] Refactoring CRWSessionController web user agent code. This CL refactoring web agent code by moving them from CRWSessionController to NavigationManager, and updates corresponding references and unit tests to call methods directly from NavigationManager instead of CRWSessionController. This CL also introduces NavigationInitiationType, consisting of USER_INITIATED and RENDERER_INITIATED, to avoid passing boolean values as parameters to C++ functions, which is error prone and un-maintainable. BUG=678047 Review-Url: https://codereview.chromium.org/2698773002 Cr-Commit-Position: refs/heads/master@{#451698} Committed: https://chromium.googlesource.com/chromium/src/+/6e5d49d75e64a08cbe73b4a39bb0a333417f3170

Patch Set 1 #

Total comments: 25

Patch Set 2 : Addressed feedback #

Total comments: 15

Patch Set 3 : Addressed feedback #

Total comments: 16

Patch Set 4 : Addressed feedback #

Patch Set 5 : Add comments #

Patch Set 6 : Rename enum class name and reformatting #

Total comments: 9

Patch Set 7 : Make navigationManagerImpl as a readonly property #

Patch Set 8 : Update NavigationItemImpl to use NavigationInitiationType #

Total comments: 6

Patch Set 9 : Update CRWSessionController to use NavigationInitiationType #

Patch Set 10 : Fix unit tests and rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+622 lines, -499 lines) Patch
M ios/chrome/browser/native_app_launcher/native_app_navigation_util_unittest.mm View 1 2 3 4 5 1 chunk +3 lines, -4 lines 0 comments Download
M ios/chrome/browser/tabs/tab.mm View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -2 lines 0 comments Download
M ios/chrome/browser/tabs/tab_unittest.mm View 1 2 3 4 5 1 chunk +9 lines, -6 lines 0 comments Download
M ios/web/navigation/crw_session_controller.h View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -8 lines 0 comments Download
M ios/web/navigation/crw_session_controller.mm View 1 2 3 4 5 6 7 8 9 10 chunks +37 lines, -40 lines 0 comments Download
M ios/web/navigation/crw_session_controller_unittest.mm View 1 2 3 4 5 6 7 8 35 chunks +329 lines, -265 lines 0 comments Download
M ios/web/navigation/navigation_item_impl.h View 1 2 3 4 5 6 7 8 4 chunks +11 lines, -11 lines 0 comments Download
M ios/web/navigation/navigation_item_impl.mm View 1 2 3 4 5 6 7 8 5 chunks +15 lines, -3 lines 0 comments Download
M ios/web/navigation/navigation_manager_impl.h View 1 2 3 4 5 4 chunks +31 lines, -0 lines 0 comments Download
M ios/web/navigation/navigation_manager_impl.mm View 1 2 3 4 5 6 7 8 9 3 chunks +32 lines, -1 line 0 comments Download
M ios/web/navigation/navigation_manager_impl_unittest.mm View 1 2 3 4 5 12 chunks +89 lines, -100 lines 0 comments Download
M ios/web/net/crw_ssl_status_updater_unittest.mm View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -4 lines 0 comments Download
M ios/web/public/navigation_manager.h View 1 1 chunk +6 lines, -0 lines 0 comments Download
M ios/web/public/test/fakes/test_navigation_manager.h View 1 chunk +1 line, -0 lines 0 comments Download
M ios/web/public/test/fakes/test_navigation_manager.mm View 1 2 2 chunks +4 lines, -8 lines 0 comments Download
M ios/web/web_state/ui/crw_web_controller.mm View 1 2 3 4 5 6 7 8 9 14 chunks +37 lines, -37 lines 0 comments Download
M ios/web/web_state/ui/crw_web_controller_unittest.mm View 1 2 3 4 5 2 chunks +7 lines, -10 lines 0 comments Download

Messages

Total messages: 62 (32 generated)
liaoyuke
Hi Eugene, Kurt Please take a look. Thank you very much!
3 years, 10 months ago (2017-02-15 22:25:22 UTC) #3
liaoyuke
Added a comment. https://codereview.chromium.org/2698773002/diff/1/ios/web/navigation/crw_session_controller.mm File ios/web/navigation/crw_session_controller.mm (right): https://codereview.chromium.org/2698773002/diff/1/ios/web/navigation/crw_session_controller.mm#newcode377 ios/web/navigation/crw_session_controller.mm:377: No structural changes. Just happened to ...
3 years, 10 months ago (2017-02-15 22:26:51 UTC) #4
kkhorimoto
https://codereview.chromium.org/2698773002/diff/1/ios/web/navigation/crw_session_controller.h File ios/web/navigation/crw_session_controller.h (right): https://codereview.chromium.org/2698773002/diff/1/ios/web/navigation/crw_session_controller.h#newcode102 ios/web/navigation/crw_session_controller.h:102: // pending, and will be lost unless |-commitPendingItem| is ...
3 years, 10 months ago (2017-02-15 23:02:06 UTC) #5
liaoyuke
PTAL. Thank you very much! https://codereview.chromium.org/2698773002/diff/1/ios/web/navigation/crw_session_controller.h File ios/web/navigation/crw_session_controller.h (right): https://codereview.chromium.org/2698773002/diff/1/ios/web/navigation/crw_session_controller.h#newcode102 ios/web/navigation/crw_session_controller.h:102: // pending, and will ...
3 years, 10 months ago (2017-02-16 01:49:05 UTC) #6
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2698773002/diff/20001/ios/web/navigation/crw_session_controller.mm File ios/web/navigation/crw_session_controller.mm (right): https://codereview.chromium.org/2698773002/diff/20001/ios/web/navigation/crw_session_controller.mm#newcode513 ios/web/navigation/crw_session_controller.mm:513: self.currentEntry.navigationItem->IsOverridingUserAgent(); nit: How about this?: pushedItem->SetIsOverridingUserAgent(currentItem->IsOverridingUserAgent()); https://codereview.chromium.org/2698773002/diff/20001/ios/web/navigation/navigation_manager_impl.h File ios/web/navigation/navigation_manager_impl.h ...
3 years, 10 months ago (2017-02-16 02:20:48 UTC) #7
liaoyuke
PTAL! Thank you very much! https://codereview.chromium.org/2698773002/diff/1/ios/web/navigation/navigation_manager_impl_unittest.mm File ios/web/navigation/navigation_manager_impl_unittest.mm (right): https://codereview.chromium.org/2698773002/diff/1/ios/web/navigation/navigation_manager_impl_unittest.mm#newcode499 ios/web/navigation/navigation_manager_impl_unittest.mm:499: EXPECT_FALSE(visible_item->IsOverridingUserAgent()); On 2017/02/15 23:02:06, ...
3 years, 10 months ago (2017-02-16 22:04:29 UTC) #8
Eugene But (OOO till 7-30)
Thanks you for cleaning up web controller https://codereview.chromium.org/2698773002/diff/20001/ios/web/web_state/ui/crw_web_controller.mm File ios/web/web_state/ui/crw_web_controller.mm (right): https://codereview.chromium.org/2698773002/diff/20001/ios/web/web_state/ui/crw_web_controller.mm#newcode1917 ios/web/web_state/ui/crw_web_controller.mm:1917: _webStateImpl->GetNavigationManagerImpl().AddRendererInitiatedPendingItem( On ...
3 years, 10 months ago (2017-02-17 00:00:24 UTC) #10
liaoyuke
PTAL! Thank you very much! https://codereview.chromium.org/2698773002/diff/60001/ios/web/navigation/navigation_manager_impl.h File ios/web/navigation/navigation_manager_impl.h (right): https://codereview.chromium.org/2698773002/diff/60001/ios/web/navigation/navigation_manager_impl.h#newcode29 ios/web/navigation/navigation_manager_impl.h:29: // |USER_INITIATED| represents pending ...
3 years, 10 months ago (2017-02-17 01:16:52 UTC) #11
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2698773002/diff/20001/ios/web/web_state/ui/crw_web_controller.mm File ios/web/web_state/ui/crw_web_controller.mm (right): https://codereview.chromium.org/2698773002/diff/20001/ios/web/web_state/ui/crw_web_controller.mm#newcode1917 ios/web/web_state/ui/crw_web_controller.mm:1917: _webStateImpl->GetNavigationManagerImpl().AddRendererInitiatedPendingItem( On 2017/02/17 00:00:23, Eugene But wrote: > On ...
3 years, 10 months ago (2017-02-17 01:21:11 UTC) #12
liaoyuke
PTAL! https://codereview.chromium.org/2698773002/diff/60001/ios/web/navigation/navigation_manager_impl.h File ios/web/navigation/navigation_manager_impl.h (right): https://codereview.chromium.org/2698773002/diff/60001/ios/web/navigation/navigation_manager_impl.h#newcode29 ios/web/navigation/navigation_manager_impl.h:29: // |USER_INITIATED| represents pending item that is initiated ...
3 years, 10 months ago (2017-02-17 01:32:59 UTC) #13
liaoyuke
PTAL! https://codereview.chromium.org/2698773002/diff/20001/ios/web/web_state/ui/crw_web_controller.mm File ios/web/web_state/ui/crw_web_controller.mm (right): https://codereview.chromium.org/2698773002/diff/20001/ios/web/web_state/ui/crw_web_controller.mm#newcode1917 ios/web/web_state/ui/crw_web_controller.mm:1917: _webStateImpl->GetNavigationManagerImpl().AddRendererInitiatedPendingItem( On 2017/02/17 01:21:11, Eugene But wrote: > ...
3 years, 10 months ago (2017-02-17 01:58:45 UTC) #14
Eugene But (OOO till 7-30)
Thanks! lgtm
3 years, 10 months ago (2017-02-17 02:04:14 UTC) #15
liaoyuke
Thank you very much for reviewing! On Thu, Feb 16, 2017 at 6:04 PM <eugenebut@chromium.org> ...
3 years, 10 months ago (2017-02-17 02:06:27 UTC) #17
kkhorimoto
lgtm with a couple nits https://codereview.chromium.org/2698773002/diff/120001/ios/web/navigation/navigation_manager_impl.h File ios/web/navigation/navigation_manager_impl.h (right): https://codereview.chromium.org/2698773002/diff/120001/ios/web/navigation/navigation_manager_impl.h#newcode30 ios/web/navigation/navigation_manager_impl.h:30: enum class NavigationInitiationType { ...
3 years, 10 months ago (2017-02-17 02:26:37 UTC) #19
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2698773002/diff/120001/ios/web/navigation/navigation_manager_impl.h File ios/web/navigation/navigation_manager_impl.h (right): https://codereview.chromium.org/2698773002/diff/120001/ios/web/navigation/navigation_manager_impl.h#newcode30 ios/web/navigation/navigation_manager_impl.h:30: enum class NavigationInitiationType { On 2017/02/17 02:26:37, kkhorimoto_ wrote: ...
3 years, 10 months ago (2017-02-17 16:09:46 UTC) #23
liaoyuke
https://codereview.chromium.org/2698773002/diff/120001/ios/web/navigation/navigation_manager_impl.h File ios/web/navigation/navigation_manager_impl.h (right): https://codereview.chromium.org/2698773002/diff/120001/ios/web/navigation/navigation_manager_impl.h#newcode30 ios/web/navigation/navigation_manager_impl.h:30: enum class NavigationInitiationType { On 2017/02/17 16:09:46, Eugene But ...
3 years, 10 months ago (2017-02-17 17:44:30 UTC) #24
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2698773002/diff/120001/ios/web/navigation/navigation_manager_impl.h File ios/web/navigation/navigation_manager_impl.h (right): https://codereview.chromium.org/2698773002/diff/120001/ios/web/navigation/navigation_manager_impl.h#newcode30 ios/web/navigation/navigation_manager_impl.h:30: enum class NavigationInitiationType { On 2017/02/17 17:44:30, liaoyuke wrote: ...
3 years, 10 months ago (2017-02-17 18:30:48 UTC) #25
kkhorimoto
not lgtm. Can you please update NavigationItemImpl to contain the enum class rather than the ...
3 years, 10 months ago (2017-02-17 18:37:41 UTC) #26
kkhorimoto
https://codereview.chromium.org/2698773002/diff/120001/ios/web/navigation/navigation_manager_impl.h File ios/web/navigation/navigation_manager_impl.h (right): https://codereview.chromium.org/2698773002/diff/120001/ios/web/navigation/navigation_manager_impl.h#newcode30 ios/web/navigation/navigation_manager_impl.h:30: enum class NavigationInitiationType { On 2017/02/17 18:37:40, kkhorimoto_ wrote: ...
3 years, 10 months ago (2017-02-17 18:41:34 UTC) #27
Eugene But (OOO till 7-30)
On 2017/02/17 18:41:34, kkhorimoto_ wrote: > https://codereview.chromium.org/2698773002/diff/120001/ios/web/navigation/navigation_manager_impl.h > File ios/web/navigation/navigation_manager_impl.h (right): > > https://codereview.chromium.org/2698773002/diff/120001/ios/web/navigation/navigation_manager_impl.h#newcode30 > ...
3 years, 10 months ago (2017-02-17 18:50:14 UTC) #28
liaoyuke
On 2017/02/17 18:50:14, Eugene But wrote: > On 2017/02/17 18:41:34, kkhorimoto_ wrote: > > > ...
3 years, 10 months ago (2017-02-17 20:19:57 UTC) #29
kkhorimoto
https://codereview.chromium.org/2698773002/diff/180001/ios/web/navigation/crw_session_controller.mm File ios/web/navigation/crw_session_controller.mm (right): https://codereview.chromium.org/2698773002/diff/180001/ios/web/navigation/crw_session_controller.mm#newcode117 ios/web/navigation/crw_session_controller.mm:117: rendererInitiated:(BOOL)rendererInitiated; Let's update this API to use web::NavigationInitiationType rather ...
3 years, 10 months ago (2017-02-17 20:51:35 UTC) #30
liaoyuke
Hey Kurt, PTAL! Thank you very much! https://codereview.chromium.org/2698773002/diff/180001/ios/web/navigation/crw_session_controller.mm File ios/web/navigation/crw_session_controller.mm (right): https://codereview.chromium.org/2698773002/diff/180001/ios/web/navigation/crw_session_controller.mm#newcode117 ios/web/navigation/crw_session_controller.mm:117: rendererInitiated:(BOOL)rendererInitiated; On ...
3 years, 10 months ago (2017-02-17 22:15:40 UTC) #31
kkhorimoto
lgtm, thanks!
3 years, 10 months ago (2017-02-17 22:17:42 UTC) #32
kkhorimoto
Could you also update the CL description to describe the non-UA changes that are in ...
3 years, 10 months ago (2017-02-17 22:19:22 UTC) #33
liaoyuke
On 2017/02/17 22:19:22, kkhorimoto_ wrote: > Could you also update the CL description to describe ...
3 years, 10 months ago (2017-02-17 22:24:11 UTC) #35
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/2698773002/240001
3 years, 10 months ago (2017-02-18 01:43:06 UTC) #51
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
3 years, 10 months ago (2017-02-18 03:45:07 UTC) #53
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/2698773002/240001
3 years, 10 months ago (2017-02-21 03:59:33 UTC) #59
commit-bot: I haz the power
3 years, 10 months ago (2017-02-21 04:07:16 UTC) #62
Message was sent while issue was closed.
Committed patchset #10 (id:240001) as
https://chromium.googlesource.com/chromium/src/+/6e5d49d75e64a08cbe73b4a39bb0...

Powered by Google App Engine
This is Rietveld 408576698