Bug 128022

Summary: Add webView:didFailNavigation:withError: delegate method
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch darin: review+

Description Anders Carlsson 2014-01-31 14:53:34 PST
Add webView:didFailNavigation:withError: delegate method
Comment 1 Anders Carlsson 2014-01-31 14:53:57 PST
Created attachment 222857 [details]
Patch
Comment 2 Darin Adler 2014-01-31 15:39:56 PST
Comment on attachment 222857 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=222857&action=review

> Source/WebKit2/UIProcess/API/C/WKPage.cpp:743
> +        virtual void didFailLoadWithErrorForFrame(WebPageProxy* page, WebFrameProxy* frame, uint64_t navigationID, const ResourceError& error, API::Object* userData) override

Won’t we get a warning because we are not using navigationID here?

> Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:487
> +    WebDocumentLoader& documentLoader = static_cast<WebDocumentLoader&>(*m_frame->coreFrame()->loader().documentLoader());

Do we have a checked version of this cast? Should we?

Seems like coreFrame should return a reference, not a pointer.
Comment 3 Anders Carlsson 2014-02-01 09:24:21 PST
(In reply to comment #2)
> (From update of attachment 222857 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=222857&action=review
> 
> > Source/WebKit2/UIProcess/API/C/WKPage.cpp:743
> > +        virtual void didFailLoadWithErrorForFrame(WebPageProxy* page, WebFrameProxy* frame, uint64_t navigationID, const ResourceError& error, API::Object* userData) override
> 
> Won’t we get a warning because we are not using navigationID here?

I don't think we enable that warning.

> 
> > Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:487
> > +    WebDocumentLoader& documentLoader = static_cast<WebDocumentLoader&>(*m_frame->coreFrame()->loader().documentLoader());
> 
> Do we have a checked version of this cast? Should we?

We're sure that all document loaders are created by WebKit so I don't think we do.

> 
> Seems like coreFrame should return a reference, not a pointer.

I think the member variable backing coreFrame can end up being nulled out.
Comment 4 Anders Carlsson 2014-02-01 09:27:04 PST
Committed r163243: <http://trac.webkit.org/changeset/163243>