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

Issue 159575: Move alternate error page loading out of WebFrame.... (Closed)

Created:
11 years, 4 months ago by darin (slow to review)
Modified:
9 years, 7 months ago
Reviewers:
tony, brettw
CC:
chromium-reviews_googlegroups.com, darin (slow to review), brettw, jam
Visibility:
Public.

Description

Move alternate error page loading out of WebFrame. Make the RenderView be in charge of loading alternate error pages. While working on this change, I noticed several related bugs: 1- Loading an URL with an invalid host name from the new tab page results in an error page. If you hit back and then forward, you will be left with an empty location bar. In a debug build this trips an assertion in ClassifyNavigation because the given page_id is -1. This problem is caused by not duplicating the NavigationState of the failed load when creating a load for the error page. Hence, the pending_page_id of the forward navigation is lost. 2- Loading an URL with an invalid host name as a subframe results in an extra navigation in session history. One navigation for the main frame and one navigation for the error page load. This is another symptom of the problem described in #1. However, the solution is different. Here, we need to know that the subframe load is an AUTO_SUBFRAME load so that we load the error page using 'replace' semantics (so that WebCore does not generate a new session history entry). Finally, I decided to restrict alternative DNS error pages to only work for the main frame to match what we do for alternative 404 error pages. It doesn't seem worth it to show link doctor results for subframes since their primary purpose is to assist people who mis-type an URL. R=tony,brettw BUG=15648 TEST=covered by errorpage_uitest.cc Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=22253

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 2

Patch Set 5 : '' #

Total comments: 10

Patch Set 6 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+251 lines, -140 lines) Patch
M chrome/browser/errorpage_uitest.cc View 2 chunks +115 lines, -34 lines 0 comments Download
M chrome/renderer/navigation_state.h View 1 2 3 4 chunks +9 lines, -3 lines 0 comments Download
M chrome/renderer/render_view.h View 1 2 3 1 chunk +7 lines, -2 lines 0 comments Download
M chrome/renderer/render_view.cc View 1 2 3 4 5 7 chunks +91 lines, -29 lines 0 comments Download
A chrome/test/data/iframe_dns_error.html View 1 chunk +9 lines, -0 lines 0 comments Download
M webkit/glue/alt_error_page_resource_fetcher.h View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M webkit/glue/alt_error_page_resource_fetcher.cc View 1 2 3 2 chunks +4 lines, -3 lines 0 comments Download
M webkit/glue/webframe.h View 1 2 3 2 chunks +3 lines, -10 lines 0 comments Download
M webkit/glue/webframe_impl.h View 1 2 3 4 5 chunks +1 line, -15 lines 0 comments Download
M webkit/glue/webframe_impl.cc View 1 2 3 6 chunks +6 lines, -41 lines 0 comments Download
M webkit/glue/webframeloaderclient_impl.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M webkit/glue/webframeloaderclient_impl.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
darin (slow to review)
11 years, 4 months ago (2009-07-31 20:36:00 UTC) #1
tony
I see, since AltErrorPageResourceFetcher now takes a WebFrame, you can call it from RenderView. Nice! ...
11 years, 4 months ago (2009-07-31 20:56:30 UTC) #2
brettw
http://codereview.chromium.org/159575/diff/68/1048 File chrome/renderer/render_view.cc (right): http://codereview.chromium.org/159575/diff/68/1048#newcode969 Line 969: navigation_state->set_transition_type(params.transition); This just gets clobbered 9 lines below ...
11 years, 4 months ago (2009-07-31 21:45:56 UTC) #3
darin (slow to review)
http://codereview.chromium.org/159575/diff/62/1017 File webkit/glue/webframe_impl.h (right): http://codereview.chromium.org/159575/diff/62/1017#newcode280 Line 280: //XXX scoped_ptr<webkit_glue::AltErrorPageResourceFetcher> alt_error_page_fetcher_; On 2009/07/31 20:56:30, tony wrote: ...
11 years, 4 months ago (2009-07-31 22:56:24 UTC) #4
darin (slow to review)
http://codereview.chromium.org/159575/diff/68/1048 File chrome/renderer/render_view.cc (right): http://codereview.chromium.org/159575/diff/68/1048#newcode969 Line 969: navigation_state->set_transition_type(params.transition); On 2009/07/31 21:45:56, brettw wrote: > This ...
11 years, 4 months ago (2009-07-31 23:28:38 UTC) #5
brettw
11 years, 4 months ago (2009-08-01 00:23:19 UTC) #6
On Fri, Jul 31, 2009 at 11:28 PM, <darin@chromium.org> wrote:
>
> http://codereview.chromium.org/159575/diff/68/1048
> File chrome/renderer/render_view.cc (right):
>
> http://codereview.chromium.org/159575/diff/68/1048#newcode969
> Line 969: navigation_state->set_transition_type(params.transition);
> On 2009/07/31 21:45:56, brettw wrote:
>>
>> This just gets clobbered 9 lines below with LINK.
>
> Indeed. =A0I don't think that is necessary.
>
> http://codereview.chromium.org/159575/diff/68/1048#newcode1145
> Line 1145: } else if (frame->GetParent()->IsLoading()) {
> On 2009/07/31 21:45:56, brettw wrote:
>>
>> It seems bad to use this signal here, and another way of computing
>
> whether this
>>
>> is an auto-subframe above. Is it possible to somehow be consistent in
>
> what
>>
>> signals we use for this?
>
> Yeah, I was not happy about this either. =A0But, unfortunately, I cannot
> use the same signal as above. =A0That =A0one is based on whether or not
> there is a page transition (did the page_id_ increment or not?).
> Unfortunately, at the time of DidFailProvisionalLoadWithError, there
> will never have been a page transition for the frame.
>
> So, instead, I went with looking to see if the parent frame is loading.
> I could store this information as a bool on NavigationState instead of
> reusing the transition_type_ field, but this seemed better.
>
> I open to suggestions for how to make this cleaner :-)

No, I'll trust you on this that bad things won't happen.

LGTM

Powered by Google App Engine
This is Rietveld 408576698