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

Issue 2041993002: WebUI: Fix lifecycle-bug when RenderFrameHost is swapped out (Closed)

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

Description

WebUI: Fix lifecycle-bug when RenderFrameHost is swapped out Currently, once the RenderFrameHost is swapped out, WebUI C++ -> JS calls will trigger a crash. These C++ -> JS calls are usually triggered by an observer action that occurs on navigation. (For instance, updating the list of cookies in the settings UI.) This patch calls WebUIMessageHandler::DisallowJavascript once Swap Out begins. This is a quick fix to the issue. The ideal fix would be to make WebUI have a pointer to its owning RenderFrameHost. However, that will have to wait until the UberUI is removed. BUG=615274 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/ff556e56a916f1b24d35573641b3a8f6c9d49884 Cr-Commit-Position: refs/heads/master@{#398898}

Patch Set 1 #

Total comments: 5

Patch Set 2 : #

Patch Set 3 : #

Total comments: 6

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+127 lines, -44 lines) Patch
M content/browser/frame_host/render_frame_host_impl.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/frame_host/render_frame_host_manager_browsertest.cc View 1 2 3 4 chunks +111 lines, -41 lines 0 comments Download
M content/browser/webui/web_ui_impl.h View 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/webui/web_ui_impl.cc View 1 1 chunk +5 lines, -0 lines 0 comments Download
M content/public/browser/web_ui_message_handler.h View 1 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 22 (7 generated)
tommycli
creis, dbeam: PTAL, this is the quick-fix we discussed. Thanks!
4 years, 6 months ago (2016-06-06 19:30:23 UTC) #3
Charlie Reis
Thanks. Would it be possible to include a test for this? Seems like something we'll ...
4 years, 6 months ago (2016-06-06 21:09:52 UTC) #4
Dan Beam
https://codereview.chromium.org/2041993002/diff/1/content/browser/webui/web_ui_impl.cc File content/browser/webui/web_ui_impl.cc (right): https://codereview.chromium.org/2041993002/diff/1/content/browser/webui/web_ui_impl.cc#newcode105 content/browser/webui/web_ui_impl.cc:105: handler->RenderFrameHostSwappingOut(); why wouldn't we just call DisallowJavascript() directly here ...
4 years, 6 months ago (2016-06-06 23:41:47 UTC) #5
tommycli
Hey, I updated it to no longer modify the public interface. As for a test ...
4 years, 6 months ago (2016-06-07 17:46:07 UTC) #6
Charlie Reis
On 2016/06/07 17:46:07, tommycli wrote: > Hey, I updated it to no longer modify the ...
4 years, 6 months ago (2016-06-07 18:12:01 UTC) #7
Dan Beam
lgtm
4 years, 6 months ago (2016-06-08 00:21:39 UTC) #8
tommycli
creis: Thanks. Based on the example you pointed out, I was able to write a ...
4 years, 6 months ago (2016-06-08 18:14:14 UTC) #9
Charlie Reis
Thanks! LGTM with one flakiness fix. https://codereview.chromium.org/2041993002/diff/40001/content/browser/frame_host/render_frame_host_manager_browsertest.cc File content/browser/frame_host/render_frame_host_manager_browsertest.cc (right): https://codereview.chromium.org/2041993002/diff/40001/content/browser/frame_host/render_frame_host_manager_browsertest.cc#newcode1874 content/browser/frame_host/render_frame_host_manager_browsertest.cc:1874: // This test ...
4 years, 6 months ago (2016-06-08 20:57:11 UTC) #10
tommycli
creis: thanks! https://codereview.chromium.org/2041993002/diff/40001/content/browser/frame_host/render_frame_host_manager_browsertest.cc File content/browser/frame_host/render_frame_host_manager_browsertest.cc (right): https://codereview.chromium.org/2041993002/diff/40001/content/browser/frame_host/render_frame_host_manager_browsertest.cc#newcode1874 content/browser/frame_host/render_frame_host_manager_browsertest.cc:1874: // This test ensures that after an ...
4 years, 6 months ago (2016-06-08 22:52:34 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2041993002/60001
4 years, 6 months ago (2016-06-08 22:53:26 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/84541)
4 years, 6 months ago (2016-06-09 00:50:19 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2041993002/60001
4 years, 6 months ago (2016-06-09 15:20:39 UTC) #18
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 6 months ago (2016-06-09 15:55:03 UTC) #19
commit-bot: I haz the power
CQ bit was unchecked
4 years, 6 months ago (2016-06-09 15:55:04 UTC) #20
commit-bot: I haz the power
4 years, 6 months ago (2016-06-09 15:56:25 UTC) #22
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/ff556e56a916f1b24d35573641b3a8f6c9d49884
Cr-Commit-Position: refs/heads/master@{#398898}

Powered by Google App Engine
This is Rietveld 408576698