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

Issue 2099563002: WebUI: DisallowJavascript only on Refresh and non-same-page navigations (Closed)

Created:
4 years, 6 months ago by tommycli
Modified:
4 years, 5 months ago
Reviewers:
Charlie Reis, Dan Beam
CC:
chromium-reviews, darin-cc_chromium.org, jam, Dan Beam
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

WebUI: DisallowJavascript only on Refresh and non-same-page navigations Previously, WebUI handlers were being disabled via DisallowJavascript when the user clicked the browser's Back and Forward buttons, even for in-page navigations (fragments or window.history.push). That led to crashes and unexpected behavior. BUG=621885 R=creis@chromium.org, dbeam@chromium.org Committed: https://chromium.googlesource.com/chromium/src/+/e525223a1c71de1106cf8e23c54d239d298d9982

Patch Set 1 #

Patch Set 2 : small fixes #

Total comments: 10

Patch Set 3 : add test #

Total comments: 6

Patch Set 4 : add a reload portion to test #

Patch Set 5 : name fix #

Total comments: 5

Patch Set 6 : Use a test handler on chrome://terms instead #

Total comments: 2

Patch Set 7 : fix style #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -16 lines) Patch
M chrome/browser/ui/webui/webui_browsertest.cc View 1 2 3 4 5 6 3 chunks +44 lines, -2 lines 0 comments Download
M content/browser/webui/web_ui_impl.h View 1 2 3 chunks +8 lines, -0 lines 0 comments Download
M content/browser/webui/web_ui_impl.cc View 1 2 3 4 5 chunks +29 lines, -5 lines 0 comments Download
M content/browser/webui/web_ui_message_handler.cc View 1 chunk +0 lines, -4 lines 0 comments Download
M content/public/browser/web_ui_message_handler.h View 1 2 3 chunks +2 lines, -5 lines 0 comments Download

Messages

Total messages: 32 (9 generated)
tommycli
creis: PTAL, thanks! - this is the in-page navigation fix for WebUI handlers we discussed ...
4 years, 6 months ago (2016-06-24 00:24:02 UTC) #2
Charlie Reis
On 2016/06/24 00:24:02, tommycli wrote: > creis: PTAL, thanks! - this is the in-page navigation ...
4 years, 5 months ago (2016-06-24 16:10:46 UTC) #3
tommycli
On 2016/06/24 16:10:46, Charlie Reis wrote: > On 2016/06/24 00:24:02, tommycli wrote: > > creis: ...
4 years, 5 months ago (2016-06-24 16:54:38 UTC) #4
Charlie Reis
Great! Can you add a test that does a back after an in-page WebUI navigation ...
4 years, 5 months ago (2016-06-24 23:15:01 UTC) #5
tommycli
creis: Thanks. I added a test also for the inpage navigations. https://codereview.chromium.org/2099563002/diff/20001/content/browser/webui/web_ui_impl.cc File content/browser/webui/web_ui_impl.cc (right): ...
4 years, 5 months ago (2016-06-24 23:55:37 UTC) #6
Charlie Reis
Thanks for the quick test! One note about WaitForLoadStop and a few nits. Otherwise LGTM. ...
4 years, 5 months ago (2016-06-25 00:02:19 UTC) #7
tommycli
creis: thanks! I also added a Reload portion to the test. I think it's good ...
4 years, 5 months ago (2016-06-25 00:12:17 UTC) #8
Charlie Reis
https://codereview.chromium.org/2099563002/diff/80001/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc File chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc (right): https://codereview.chromium.org/2099563002/diff/80001/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc#newcode85 chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc:85: // Verify that after a reload, at least some ...
4 years, 5 months ago (2016-06-25 00:17:02 UTC) #9
tommycli
https://codereview.chromium.org/2099563002/diff/80001/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc File chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc (right): https://codereview.chromium.org/2099563002/diff/80001/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc#newcode85 chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc:85: // Verify that after a reload, at least some ...
4 years, 5 months ago (2016-06-25 00:21:51 UTC) #10
tommycli
https://codereview.chromium.org/2099563002/diff/80001/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc File chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc (right): https://codereview.chromium.org/2099563002/diff/80001/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc#newcode85 chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc:85: // Verify that after a reload, at least some ...
4 years, 5 months ago (2016-06-25 00:22:50 UTC) #11
tommycli
4 years, 5 months ago (2016-06-25 00:22:52 UTC) #12
Charlie Reis
Sorry for the delay-- two possible ideas below. https://codereview.chromium.org/2099563002/diff/80001/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc File chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc (right): https://codereview.chromium.org/2099563002/diff/80001/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc#newcode85 chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc:85: // ...
4 years, 5 months ago (2016-06-27 21:31:31 UTC) #13
tommycli
creis: thanks! The revised test is looking much better to me. https://codereview.chromium.org/2099563002/diff/80001/chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc File chrome/browser/ui/webui/settings/md_settings_ui_browsertest.cc (right): ...
4 years, 5 months ago (2016-06-27 21:56:08 UTC) #14
Charlie Reis
Ah, much better. New test LGTM. https://codereview.chromium.org/2099563002/diff/100001/chrome/browser/ui/webui/webui_browsertest.cc File chrome/browser/ui/webui/webui_browsertest.cc (right): https://codereview.chromium.org/2099563002/diff/100001/chrome/browser/ui/webui/webui_browsertest.cc#newcode25 chrome/browser/ui/webui/webui_browsertest.cc:25: void RegisterMessages() override{}; ...
4 years, 5 months ago (2016-06-27 22:18:19 UTC) #15
tommycli
creis: awesome, thanks for the testing help! https://codereview.chromium.org/2099563002/diff/100001/chrome/browser/ui/webui/webui_browsertest.cc File chrome/browser/ui/webui/webui_browsertest.cc (right): https://codereview.chromium.org/2099563002/diff/100001/chrome/browser/ui/webui/webui_browsertest.cc#newcode25 chrome/browser/ui/webui/webui_browsertest.cc:25: void RegisterMessages() ...
4 years, 5 months ago (2016-06-27 22:24:07 UTC) #16
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/2099563002/120001
4 years, 5 months ago (2016-06-27 22:25:07 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/208007)
4 years, 5 months ago (2016-06-27 22:44:28 UTC) #21
tommycli
dbeam: PTAL need OWNER stamp chrome/browser/ui/webui/webui_browsertest.cc, thanks!
4 years, 5 months ago (2016-06-27 22:52:22 UTC) #23
Dan Beam
lgtm
4 years, 5 months ago (2016-06-28 02:24:05 UTC) #24
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/2099563002/120001
4 years, 5 months ago (2016-06-28 15:49:33 UTC) #26
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/253799)
4 years, 5 months ago (2016-06-28 18:43:12 UTC) #28
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/e525223a1c71de1106cf8e23c54d239d298d9982 Cr-Commit-Position: refs/heads/master@{#402507}
4 years, 5 months ago (2016-06-28 19:11:12 UTC) #30
tommycli
4 years, 5 months ago (2016-06-28 19:12:23 UTC) #32
Message was sent while issue was closed.
Committed patchset #7 (id:120001) manually as
e525223a1c71de1106cf8e23c54d239d298d9982 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698