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

Issue 10154004: re-use WebUIs (Closed)

Created:
8 years, 8 months ago by Evan Stade
Modified:
8 years, 8 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, jam
Visibility:
Public.

Description

re-use WebUIs this is a partial revert of r133077 and an alternative fix for bug 121741. The last commit was faulty because a same-document navigate would not send new DocumentAvailableInFrame IPCs, hence all WebUISend messages would be ignored after a same document navigation. An example of a same-document navigation is when the user presses back, and the page handles window.onpopstate. The new fix: Re-use WebUI objects for navigations where we re-use the render view, and the old and new URLs return the same WebUIController type. This covers both the reload case and the same-document nav case. This way, the re-used WebUI is still initialized and is able to continue to handle messages without the possibility of unexpected messages causing crashes. WebUI re-builds on every back/forward/reload are also wasteful so this is a performance win. BUG=123705, 121741, 123710 TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=134055

Patch Set 1 #

Patch Set 2 : initialize pointer #

Patch Set 3 : . #

Patch Set 4 : test fixes #

Patch Set 5 : git try #

Patch Set 6 : fix reload DCHECKs #

Total comments: 27

Patch Set 7 : smorgan review/dbeam nits #

Patch Set 8 : fix refptr management #

Patch Set 9 : move dumb line of code #

Patch Set 10 : WeakPtr solution #

Unified diffs Side-by-side diffs Delta from patch set Stats (+150 lines, -169 lines) Patch
M chrome/browser/resources/options2/options_page.js View 1 2 3 4 5 6 3 chunks +0 lines, -19 lines 0 comments Download
M chrome/browser/ui/webui/downloads_dom_handler.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/downloads_dom_handler.cc View 1 2 3 4 5 6 7 8 9 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/gpu_internals_ui.cc View 1 2 3 4 5 6 7 8 9 3 chunks +9 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/help/help_handler.cc View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/net_internals/net_internals_ui.cc View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/ntp/new_tab_ui.cc View 1 2 3 4 5 6 7 8 9 1 chunk +10 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/options2/options_ui2.h View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/options2/options_ui2.cc View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -18 lines 0 comments Download
M chrome/browser/ui/webui/tracing_ui.cc View 1 2 3 4 5 6 7 8 9 3 chunks +9 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/uber/uber_ui.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/uber/uber_ui.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -7 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.h View 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 2 chunks +4 lines, -6 lines 0 comments Download
M content/browser/web_contents/render_view_host_manager.h View 1 2 3 4 5 6 7 8 9 4 chunks +21 lines, -6 lines 0 comments Download
M content/browser/web_contents/render_view_host_manager.cc View 1 2 3 4 5 6 7 8 9 11 chunks +56 lines, -26 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 chunk +2 lines, -4 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -11 lines 0 comments Download
M content/browser/webui/web_ui_impl.h View 1 2 3 4 5 6 7 8 9 4 chunks +3 lines, -16 lines 0 comments Download
M content/browser/webui/web_ui_impl.cc View 2 chunks +0 lines, -12 lines 0 comments Download
M content/common/view_messages.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -5 lines 0 comments Download
M content/public/browser/render_view_host_delegate.h View 1 chunk +3 lines, -5 lines 0 comments Download
M content/public/browser/web_ui_controller.h View 1 1 chunk +0 lines, -11 lines 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -4 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Evan Stade
not sure who the best reviewer is these days. This seems to be code no ...
8 years, 8 months ago (2012-04-20 19:05:44 UTC) #1
jam
I'm not familiar with the webui code in WebContents/RenderViewHostManager, so I can't review that, but ...
8 years, 8 months ago (2012-04-20 19:18:51 UTC) #2
Evan Stade
a little more background: WebUIs will now outlast their page in the reload case. This ...
8 years, 8 months ago (2012-04-20 23:12:41 UTC) #3
Dan Beam
I'm not qualified to review this deep into the code either, but here's some style ...
8 years, 8 months ago (2012-04-21 02:53:07 UTC) #4
Evan Stade
someone needs to provide a substantive review for this patch. Stuart, can you take a ...
8 years, 8 months ago (2012-04-23 20:09:42 UTC) #5
stuartmorgan
It's a bit scary that I'm the most qualified reviewer for this, but okay :) ...
8 years, 8 months ago (2012-04-24 09:12:20 UTC) #6
Evan Stade
http://codereview.chromium.org/10154004/diff/14018/chrome/browser/ui/webui/gpu_internals_ui.cc File chrome/browser/ui/webui/gpu_internals_ui.cc (right): http://codereview.chromium.org/10154004/diff/14018/chrome/browser/ui/webui/gpu_internals_ui.cc#newcode90 chrome/browser/ui/webui/gpu_internals_ui.cc:90: bool crash_list_available_; On 2012/04/21 02:53:07, Dan Beam wrote: > ...
8 years, 8 months ago (2012-04-24 17:52:40 UTC) #7
stuartmorgan
LGTM http://codereview.chromium.org/10154004/diff/14018/chrome/browser/ui/webui/help/help_handler.cc File chrome/browser/ui/webui/help/help_handler.cc (right): http://codereview.chromium.org/10154004/diff/14018/chrome/browser/ui/webui/help/help_handler.cc#newcode189 chrome/browser/ui/webui/help/help_handler.cc:189: content::NotificationService::AllSources()); On 2012/04/24 17:52:40, Evan Stade wrote: > ...
8 years, 8 months ago (2012-04-24 19:20:02 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/estade@chromium.org/10154004/17004
8 years, 8 months ago (2012-04-25 19:25:51 UTC) #9
commit-bot: I haz the power
Presubmit check for 10154004-17004 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 8 months ago (2012-04-25 19:26:09 UTC) #10
arv (Not doing code reviews)
Would it not be better to recreate the webui when we do reloads? It seems ...
8 years, 8 months ago (2012-04-25 22:10:36 UTC) #11
arv (Not doing code reviews)
On Wed, Apr 25, 2012 at 15:10, <arv@chromium.org> wrote: > Would it not be better ...
8 years, 8 months ago (2012-04-25 22:12:50 UTC) #12
arv (Not doing code reviews)
I'm still concerned. It seems like it would be cleaner if the "life time" of ...
8 years, 8 months ago (2012-04-25 22:25:47 UTC) #13
Evan Stade
changed from refptrs to WeakPtrs as I'm informed refptrs are considered harmful. There have now ...
8 years, 8 months ago (2012-04-25 22:29:46 UTC) #14
Evan Stade
On 2012/04/25 22:25:47, arv wrote: > I'm still concerned. It seems like it would be ...
8 years, 8 months ago (2012-04-25 22:34:27 UTC) #15
arv (Not doing code reviews)
On 2012/04/25 22:29:46, Evan Stade wrote: > > Sorry, I should have looked at the ...
8 years, 8 months ago (2012-04-25 22:35:42 UTC) #16
Evan Stade
On 2012/04/25 22:35:42, arv wrote: > On 2012/04/25 22:29:46, Evan Stade wrote: > > > ...
8 years, 8 months ago (2012-04-25 22:47:03 UTC) #17
arv (Not doing code reviews)
LGTM
8 years, 8 months ago (2012-04-25 22:55:01 UTC) #18
jam
lgtm
8 years, 8 months ago (2012-04-26 01:09:28 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/estade@chromium.org/10154004/35003
8 years, 8 months ago (2012-04-26 01:25:14 UTC) #20
commit-bot: I haz the power
8 years, 8 months ago (2012-04-26 02:58:47 UTC) #21
Change committed as 134055

Powered by Google App Engine
This is Rietveld 408576698