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

Issue 2811073005: Replace requirePageReconstruction with setCustomUserAgent (Closed)

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

Description

Replace requirePageReconstruction with setCustomUserAgent WKWebView provides a property: customUserAgent that we can use to change the user agent associated with the web view, which means that we don't have to requirePageConstruction anymore when user agent changes. After applying this change, I observed that it's becoming significantly faster to navigate between desktop and mobile pages during back and forward navigations. BUG=707368 Review-Url: https://codereview.chromium.org/2811073005 Cr-Commit-Position: refs/heads/master@{#464830} Committed: https://chromium.googlesource.com/chromium/src/+/b647f8362016d8e5b7a614e92b72331d070a32cf

Patch Set 1 #

Total comments: 15

Patch Set 2 : Address comments #

Total comments: 4

Patch Set 3 : Avoid calling setCustomUserAgent for every load #

Total comments: 4

Patch Set 4 : Address comments #

Patch Set 5 : Remove unncessary if condition and add comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -47 lines) Patch
M ios/chrome/browser/tabs/tab.mm View 1 chunk +0 lines, -3 lines 0 comments Download
M ios/web/web_state/ui/crw_web_controller.h View 1 1 chunk +0 lines, -8 lines 0 comments Download
M ios/web/web_state/ui/crw_web_controller.mm View 1 2 3 4 7 chunks +36 lines, -24 lines 0 comments Download
M ios/web/web_state/web_view_internal_creation_util.h View 3 chunks +4 lines, -2 lines 0 comments Download
M ios/web/web_state/web_view_internal_creation_util.mm View 3 chunks +5 lines, -9 lines 0 comments Download
M ios/web/web_view_creation_util.mm View 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 24 (6 generated)
liaoyuke
Hey Eugene, Kurt, PTAL. Thank you very much!
3 years, 8 months ago (2017-04-12 18:12:43 UTC) #2
Eugene But (OOO till 7-30)
CCing sdefresne@ for this: https://codereview.chromium.org/2811073005/diff/1/ios/chrome/browser/tabs/tab.mm#oldcode1372 https://codereview.chromium.org/2811073005/diff/1/ios/chrome/browser/tabs/tab.mm File ios/chrome/browser/tabs/tab.mm (left): https://codereview.chromium.org/2811073005/diff/1/ios/chrome/browser/tabs/tab.mm#oldcode1372 ios/chrome/browser/tabs/tab.mm:1372: [self.webController requirePageReconstruction]; Cool. Can ...
3 years, 8 months ago (2017-04-12 18:22:02 UTC) #3
liaoyuke
PTAL. Thank you very much! https://codereview.chromium.org/2811073005/diff/1/ios/chrome/browser/tabs/tab.mm File ios/chrome/browser/tabs/tab.mm (left): https://codereview.chromium.org/2811073005/diff/1/ios/chrome/browser/tabs/tab.mm#oldcode1372 ios/chrome/browser/tabs/tab.mm:1372: [self.webController requirePageReconstruction]; On 2017/04/12 ...
3 years, 8 months ago (2017-04-12 19:17:59 UTC) #4
kkhorimoto
https://codereview.chromium.org/2811073005/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/2811073005/diff/20001/ios/web/web_state/ui/crw_web_controller.mm#newcode487 ios/web/web_state/ui/crw_web_controller.mm:487: // Requires that the next load rebuild the UIWebView. ...
3 years, 8 months ago (2017-04-12 19:42:28 UTC) #5
liaoyuke
PTAL @ the last patch. Thank you very much! https://codereview.chromium.org/2811073005/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/2811073005/diff/20001/ios/web/web_state/ui/crw_web_controller.mm#newcode487 ios/web/web_state/ui/crw_web_controller.mm:487: ...
3 years, 8 months ago (2017-04-12 22:45:33 UTC) #6
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2811073005/diff/1/ios/web/web_state/ui/crw_web_controller.mm File ios/web/web_state/ui/crw_web_controller.mm (right): https://codereview.chromium.org/2811073005/diff/1/ios/web/web_state/ui/crw_web_controller.mm#newcode1623 ios/web/web_state/ui/crw_web_controller.mm:1623: [_webView setCustomUserAgent:userAgent]; On 2017/04/12 19:17:59, liaoyuke wrote: > On ...
3 years, 8 months ago (2017-04-13 00:34:06 UTC) #7
liaoyuke
PTAL. Thank you very much! https://codereview.chromium.org/2811073005/diff/40001/ios/web/web_state/ui/crw_web_controller.mm File ios/web/web_state/ui/crw_web_controller.mm (right): https://codereview.chromium.org/2811073005/diff/40001/ios/web/web_state/ui/crw_web_controller.mm#newcode484 ios/web/web_state/ui/crw_web_controller.mm:484: - (void)updateWebViewUserAgentIfChanged:(web::UserAgentType)userAgentType; On 2017/04/13 ...
3 years, 8 months ago (2017-04-13 16:43:13 UTC) #8
kkhorimoto
lgtm
3 years, 8 months ago (2017-04-13 22:44:06 UTC) #9
Eugene But (OOO till 7-30)
FYI: there is still unanswered comment
3 years, 8 months ago (2017-04-13 22:58:35 UTC) #10
liaoyuke
https://codereview.chromium.org/2811073005/diff/1/ios/web/web_state/ui/crw_web_controller.mm File ios/web/web_state/ui/crw_web_controller.mm (right): https://codereview.chromium.org/2811073005/diff/1/ios/web/web_state/ui/crw_web_controller.mm#newcode1623 ios/web/web_state/ui/crw_web_controller.mm:1623: [_webView setCustomUserAgent:userAgent]; On 2017/04/13 00:34:06, Eugene But wrote: > ...
3 years, 8 months ago (2017-04-13 23:03:53 UTC) #11
Eugene But (OOO till 7-30)
https://codereview.chromium.org/2811073005/diff/1/ios/web/web_state/ui/crw_web_controller.mm File ios/web/web_state/ui/crw_web_controller.mm (right): https://codereview.chromium.org/2811073005/diff/1/ios/web/web_state/ui/crw_web_controller.mm#newcode1623 ios/web/web_state/ui/crw_web_controller.mm:1623: [_webView setCustomUserAgent:userAgent]; On 2017/04/13 23:03:53, liaoyuke wrote: > On ...
3 years, 8 months ago (2017-04-14 00:19:53 UTC) #12
liaoyuke
On 2017/04/14 00:19:53, Eugene But wrote: > https://codereview.chromium.org/2811073005/diff/1/ios/web/web_state/ui/crw_web_controller.mm > File ios/web/web_state/ui/crw_web_controller.mm (right): > > https://codereview.chromium.org/2811073005/diff/1/ios/web/web_state/ui/crw_web_controller.mm#newcode1623 ...
3 years, 8 months ago (2017-04-14 05:53:42 UTC) #13
Eugene But (OOO till 7-30)
On 2017/04/14 05:53:42, liaoyuke wrote: > On 2017/04/14 00:19:53, Eugene But wrote: > > > ...
3 years, 8 months ago (2017-04-14 13:48:09 UTC) #14
liaoyuke
On 2017/04/14 13:48:09, Eugene But wrote: > On 2017/04/14 05:53:42, liaoyuke wrote: > > On ...
3 years, 8 months ago (2017-04-14 17:11:40 UTC) #16
Eugene But (OOO till 7-30)
This is great! lgtm
3 years, 8 months ago (2017-04-14 17:40:43 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/2811073005/100001
3 years, 8 months ago (2017-04-14 23:32:34 UTC) #20
commit-bot: I haz the power
Committed patchset #5 (id:100001) as https://chromium.googlesource.com/chromium/src/+/b647f8362016d8e5b7a614e92b72331d070a32cf
3 years, 8 months ago (2017-04-14 23:53:05 UTC) #23
rohitrao (ping after 24h)
3 years, 8 months ago (2017-04-17 12:43:20 UTC) #24
Message was sent while issue was closed.
A revert of this CL (patchset #5 id:100001) has been created in
https://codereview.chromium.org/2820983003/ by rohitrao@chromium.org.

The reason for reverting is: Seeing crashes in EG tests:
https://build.chromium.org/p/chromium.fyi/builders/EarlGreyiOS/builds/26550.

Powered by Google App Engine
This is Rietveld 408576698