<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[167633] trunk/Source/WebKit2</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/167633">167633</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-04-21 16:51:15 -0700 (Mon, 21 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Errors passed to delegate methods should have recovery attempters
https://bugs.webkit.org/show_bug.cgi?id=131957
&lt;rdar://problem/16642539&gt;

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.h: Added.
* UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.mm: Added.
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::createErrorWithRecoveryAttempter):
(WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
(WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame):
* UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.h: Added.
* UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm: Added.
(-[WKReloadFrameErrorRecoveryAttempter initWithWebView:frameHandle:urlString:]):
(-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
* WebKit2.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaNavigationStatemm">trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKErrorRecoveryAttemptingh">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoa_WKErrorRecoveryAttemptingmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWKReloadFrameErrorRecoveryAttempterh">trunk/Source/WebKit2/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessCocoaWKReloadFrameErrorRecoveryAttemptermm">trunk/Source/WebKit2/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (167632 => 167633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-04-21 23:18:23 UTC (rev 167632)
+++ trunk/Source/WebKit2/ChangeLog        2014-04-21 23:51:15 UTC (rev 167633)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2014-04-21  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Errors passed to delegate methods should have recovery attempters
+        https://bugs.webkit.org/show_bug.cgi?id=131957
+        &lt;rdar://problem/16642539&gt;
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.h: Added.
+        * UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.mm: Added.
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::createErrorWithRecoveryAttempter):
+        (WebKit::NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame):
+        (WebKit::NavigationState::LoaderClient::didFailLoadWithErrorForFrame):
+        * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.h: Added.
+        * UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm: Added.
+        (-[WKReloadFrameErrorRecoveryAttempter initWithWebView:frameHandle:urlString:]):
+        (-[WKReloadFrameErrorRecoveryAttempter attemptRecovery]):
+        * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2014-04-21  Eric Carlson  &lt;eric.carlson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] implement WebKitDataCue
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKErrorRecoveryAttemptingh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.h (0 => 167633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.h        2014-04-21 23:51:15 UTC (rev 167633)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &lt;WebKit2/WKFoundation.h&gt;
+
+#if WK_API_ENABLED
+
+#import &lt;Foundation/Foundation.h&gt;
+#import &lt;WebKit2/WKDeclarationSpecifiers.h&gt;
+
+WK_EXPORT extern NSString * const _WKRecoveryAttempterErrorKey;
+
+@protocol _WKErrorRecoveryAttempting &lt;NSObject&gt;
+
+- (BOOL)attemptRecovery;
+
+@end
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoa_WKErrorRecoveryAttemptingmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.mm (0 => 167633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/_WKErrorRecoveryAttempting.mm        2014-04-21 23:51:15 UTC (rev 167633)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;_WKErrorRecoveryAttempting.h&quot;
+
+#if WK_API_ENABLED
+
+NSString * const _WKRecoveryAttempterErrorKey = @&quot;_WKRecoveryAttempterErrorKey&quot;;
+
+#endif // WK_API_ENABLED
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaNavigationStatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm (167632 => 167633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm        2014-04-21 23:18:23 UTC (rev 167632)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/NavigationState.mm        2014-04-21 23:51:15 UTC (rev 167633)
</span><span class="lines">@@ -28,6 +28,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if WK_API_ENABLED
</span><span class="cx"> 
</span><ins>+#import &quot;_WKErrorRecoveryAttempting.h&quot;
+#import &quot;_WKFrameHandleInternal.h&quot;
</ins><span class="cx"> #import &quot;APINavigationData.h&quot;
</span><span class="cx"> #import &quot;APIURL.h&quot;
</span><span class="cx"> #import &quot;APIString.h&quot;
</span><span class="lines">@@ -45,6 +47,7 @@
</span><span class="cx"> #import &quot;WKNavigationDelegatePrivate.h&quot;
</span><span class="cx"> #import &quot;WKNavigationInternal.h&quot;
</span><span class="cx"> #import &quot;WKNavigationResponseInternal.h&quot;
</span><ins>+#import &quot;WKReloadFrameErrorRecoveryAttempter.h&quot;
</ins><span class="cx"> #import &quot;WKWebViewInternal.h&quot;
</span><span class="cx"> #import &quot;WebFrameProxy.h&quot;
</span><span class="cx"> #import &quot;WebPageProxy.h&quot;
</span><span class="lines">@@ -381,6 +384,20 @@
</span><span class="cx">     [navigationDelegate webView:m_navigationState.m_webView didReceiveServerRedirectForProvisionalNavigation:navigation];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static RetainPtr&lt;NSError&gt; createErrorWithRecoveryAttempter(WKWebView *webView, WebFrameProxy&amp; webFrameProxy, NSError *originalError)
+{
+    RefPtr&lt;API::FrameHandle&gt; frameHandle = API::FrameHandle::create(webFrameProxy.frameID());
+
+    auto recoveryAttempter = adoptNS([[WKReloadFrameErrorRecoveryAttempter alloc] initWithWebView:webView frameHandle:wrapper(*frameHandle) urlString:originalError.userInfo[NSURLErrorFailingURLStringErrorKey]]);
+
+    auto userInfo = adoptNS([[NSMutableDictionary alloc] initWithObjectsAndKeys:recoveryAttempter.get(), _WKRecoveryAttempterErrorKey, nil]);
+
+    if (NSDictionary *originalUserInfo = originalError.userInfo)
+        [userInfo addEntriesFromDictionary:originalUserInfo];
+
+    return adoptNS([[NSError alloc] initWithDomain:originalError.domain code:originalError.code userInfo:userInfo.get()]);
+}
+
</ins><span class="cx"> void NavigationState::LoaderClient::didFailProvisionalLoadWithErrorForFrame(WebPageProxy*, WebFrameProxy* webFrameProxy, uint64_t navigationID, const WebCore::ResourceError&amp; error, API::Object*)
</span><span class="cx"> {
</span><span class="cx">     if (!webFrameProxy-&gt;isMainFrame())
</span><span class="lines">@@ -400,7 +417,8 @@
</span><span class="cx">     if (!navigationDelegate)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    [navigationDelegate webView:m_navigationState.m_webView didFailProvisionalNavigation:navigation.get() withError:error];
</del><ins>+    auto errorWithRecoveryAttempter = createErrorWithRecoveryAttempter(m_navigationState.m_webView, *webFrameProxy, error);
+    [navigationDelegate webView:m_navigationState.m_webView didFailProvisionalNavigation:navigation.get() withError:errorWithRecoveryAttempter.get()];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NavigationState::LoaderClient::didCommitLoadForFrame(WebPageProxy*, WebFrameProxy* webFrameProxy, uint64_t navigationID, API::Object*)
</span><span class="lines">@@ -479,7 +497,8 @@
</span><span class="cx">     if (navigationID)
</span><span class="cx">         navigation = m_navigationState.m_navigations.get(navigationID).get();
</span><span class="cx"> 
</span><del>-    [navigationDelegate webView:m_navigationState.m_webView didFailNavigation:navigation withError:error];
</del><ins>+    auto errorWithRecoveryAttempter = createErrorWithRecoveryAttempter(m_navigationState.m_webView, *webFrameProxy, error);
+    [navigationDelegate webView:m_navigationState.m_webView didFailNavigation:navigation withError:errorWithRecoveryAttempter.get()];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static _WKRenderingProgressEvents renderingProgressEvents(WebCore::LayoutMilestones milestones)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWKReloadFrameErrorRecoveryAttempterh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.h (0 => 167633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.h        2014-04-21 23:51:15 UTC (rev 167633)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &lt;WebKit2/WKFoundation.h&gt;
+
+#if WK_API_ENABLED
+
+#import &lt;wtf/Forward.h&gt;
+
+@class WKWebView;
+@class _WKFrameHandle;
+
+@interface WKReloadFrameErrorRecoveryAttempter : NSObject
+
+- (id)initWithWebView:(WKWebView *)webView frameHandle:(_WKFrameHandle *)frameHandle urlString:(const String&amp;)urlString;
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessCocoaWKReloadFrameErrorRecoveryAttemptermm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm (0 => 167633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WKReloadFrameErrorRecoveryAttempter.mm        2014-04-21 23:51:15 UTC (rev 167633)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+#import &quot;WKReloadFrameErrorRecoveryAttempter.h&quot;
+
+#if WK_API_ENABLED
+
+#import &quot;_WKErrorRecoveryAttempting.h&quot;
+#import &quot;_WKFrameHandleInternal.h&quot;
+#import &quot;WKWebViewInternal.h&quot;
+#import &quot;WeakObjCPtr.h&quot;
+#import &quot;WebFrameProxy.h&quot;
+#import &quot;WebPageProxy.h&quot;
+#import &quot;WebProcessProxy.h&quot;
+#import &lt;wtf/RetainPtr.h&gt;
+
+@interface WKReloadFrameErrorRecoveryAttempter () &lt;_WKErrorRecoveryAttempting&gt;
+@end
+
+@implementation WKReloadFrameErrorRecoveryAttempter {
+    WebKit::WeakObjCPtr&lt;WKWebView&gt; _webView;
+    RetainPtr&lt;_WKFrameHandle&gt; _frameHandle;
+    String _urlString;
+}
+
+- (id)initWithWebView:(WKWebView *)webView frameHandle:(_WKFrameHandle *)frameHandle urlString:(const String&amp;)urlString
+{
+    if (!(self = [super init]))
+        return nil;
+
+    _webView = webView;
+    _frameHandle = frameHandle;
+    _urlString = urlString;
+
+    return self;
+}
+
+- (BOOL)attemptRecovery
+{
+    auto webView = _webView.get();
+    if (!webView)
+        return NO;
+
+    uint64_t frameID = [_frameHandle _frameID];
+    WebKit::WebFrameProxy* webFrameProxy = webView-&gt;_page-&gt;process().webFrame(frameID);
+    if (!webFrameProxy)
+        return NO;
+
+    webFrameProxy-&gt;loadURL(_urlString);
+    return YES;
+}
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (167632 => 167633)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-04-21 23:18:23 UTC (rev 167632)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-04-21 23:51:15 UTC (rev 167633)
</span><span class="lines">@@ -376,6 +376,10 @@
</span><span class="cx">                 1AC8702E130B49A2002C1257 /* WebPluginSiteDataManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AC8702C130B49A2002C1257 /* WebPluginSiteDataManager.cpp */; };
</span><span class="cx">                 1ACECD2417162DB1001FC9EF /* StorageAreaMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1ACECD2217162DB1001FC9EF /* StorageAreaMap.cpp */; };
</span><span class="cx">                 1ACECD2517162DB1001FC9EF /* StorageAreaMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ACECD2317162DB1001FC9EF /* StorageAreaMap.h */; };
</span><ins>+                1AD01BC81905D37E00C9C45F /* _WKErrorRecoveryAttempting.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AD01BC61905D37E00C9C45F /* _WKErrorRecoveryAttempting.mm */; };
+                1AD01BC91905D37E00C9C45F /* _WKErrorRecoveryAttempting.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD01BC71905D37E00C9C45F /* _WKErrorRecoveryAttempting.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                1AD01BCC1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AD01BCA1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.mm */; };
+                1AD01BCD1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD01BCB1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h */; };
</ins><span class="cx">                 1AD09F2B1743F8E600A95E50 /* WKNPAPIPlugInContainer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AD09F291743F8E600A95E50 /* WKNPAPIPlugInContainer.mm */; };
</span><span class="cx">                 1AD09F2C1743F8E600A95E50 /* WKNPAPIPlugInContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD09F2A1743F8E600A95E50 /* WKNPAPIPlugInContainer.h */; };
</span><span class="cx">                 1AD25E95167AB08100EA9BCD /* DownloadProxyMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AD25E93167AB08100EA9BCD /* DownloadProxyMap.cpp */; };
</span><span class="lines">@@ -2164,6 +2168,10 @@
</span><span class="cx">                 1AC8702C130B49A2002C1257 /* WebPluginSiteDataManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPluginSiteDataManager.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1ACECD2217162DB1001FC9EF /* StorageAreaMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageAreaMap.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1ACECD2317162DB1001FC9EF /* StorageAreaMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageAreaMap.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                1AD01BC61905D37E00C9C45F /* _WKErrorRecoveryAttempting.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKErrorRecoveryAttempting.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1AD01BC71905D37E00C9C45F /* _WKErrorRecoveryAttempting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKErrorRecoveryAttempting.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1AD01BCA1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKReloadFrameErrorRecoveryAttempter.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
+                1AD01BCB1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKReloadFrameErrorRecoveryAttempter.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 1AD09F291743F8E600A95E50 /* WKNPAPIPlugInContainer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKNPAPIPlugInContainer.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AD09F2A1743F8E600A95E50 /* WKNPAPIPlugInContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNPAPIPlugInContainer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 1AD09F2D1743FB0300A95E50 /* WKNPAPIPlugInContainerInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WKNPAPIPlugInContainerInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -4264,6 +4272,8 @@
</span><span class="cx">                                 1ABC3DF31899E437004F0626 /* NavigationState.mm */,
</span><span class="cx">                                 1AFE436418B6C081009C7A48 /* UIDelegate.h */,
</span><span class="cx">                                 1AFE436318B6C081009C7A48 /* UIDelegate.mm */,
</span><ins>+                                1AD01BCB1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h */,
+                                1AD01BCA1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.mm */,
</ins><span class="cx">                                 2D7AAFD218C8640600A7ACD4 /* WKWebViewContentProvider.h */,
</span><span class="cx">                                 2DC6D9C118C44A610043BAD4 /* WKWebViewContentProviderRegistry.h */,
</span><span class="cx">                                 2DC6D9C218C44A610043BAD4 /* WKWebViewContentProviderRegistry.mm */,
</span><span class="lines">@@ -4628,6 +4638,8 @@
</span><span class="cx">                                 379A873818BBFE0F00588AF2 /* _WKElementAction.h */,
</span><span class="cx">                                 379A873718BBFE0F00588AF2 /* _WKElementAction.mm */,
</span><span class="cx">                                 379A873B18BBFF0700588AF2 /* _WKElementActionInternal.h */,
</span><ins>+                                1AD01BC71905D37E00C9C45F /* _WKErrorRecoveryAttempting.h */,
+                                1AD01BC61905D37E00C9C45F /* _WKErrorRecoveryAttempting.mm */,
</ins><span class="cx">                                 005D158E18E4C4EB00734619 /* _WKFindDelegate.h */,
</span><span class="cx">                                 37A64E5418F38E3C00EB30F1 /* _WKFormDelegate.h */,
</span><span class="cx">                                 37A64E5618F38F4600EB30F1 /* _WKFormInputSession.h */,
</span><span class="lines">@@ -7003,6 +7015,7 @@
</span><span class="cx">                                 2684055318B86ED60022C38B /* ViewUpdateDispatcherMessages.h in Headers */,
</span><span class="cx">                                 516A4A5D120A2CCD00C05B7F /* APIError.h in Headers */,
</span><span class="cx">                                 1A433F0D113C53DD00FACDE9 /* WebErrors.h in Headers */,
</span><ins>+                                1AD01BC91905D37E00C9C45F /* _WKErrorRecoveryAttempting.h in Headers */,
</ins><span class="cx">                                 BC032DB910F4380F0058C15A /* WebEvent.h in Headers */,
</span><span class="cx">                                 BC032DBB10F4380F0058C15A /* WebEventConversion.h in Headers */,
</span><span class="cx">                                 BC111B5D112F629800337BAB /* WebEventFactory.h in Headers */,
</span><span class="lines">@@ -7218,6 +7231,7 @@
</span><span class="cx">                                 1A9E328D182165A900F5D04C /* _WKRemoteObjectInterface.h in Headers */,
</span><span class="cx">                                 51290993183ACEAF005522A6 /* WebIDBServerConnection.h in Headers */,
</span><span class="cx">                                 370F34A31829BE1E009027C8 /* WKNavigationData.h in Headers */,
</span><ins>+                                1AD01BCD1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.h in Headers */,
</ins><span class="cx">                                 1AB7D78D1288CD9A00CFD08C /* WKDownload.h in Headers */,
</span><span class="cx">                                 BC4075FC124FF0270068F20A /* WKError.h in Headers */,
</span><span class="cx">                                 BCFD548C132D82680055D816 /* WKErrorCF.h in Headers */,
</span><span class="lines">@@ -8141,6 +8155,7 @@
</span><span class="cx">                                 1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */,
</span><span class="cx">                                 BCE81D8C1319F7EF00241910 /* FontInfo.cpp in Sources */,
</span><span class="cx">                                 378E1A4918208CD60031007A /* WKNSString.mm in Sources */,
</span><ins>+                                1AD01BCC1905D54900C9C45F /* WKReloadFrameErrorRecoveryAttempter.mm in Sources */,
</ins><span class="cx">                                 C55CB5B818C2A5D600CA81E1 /* WKFormSelectPicker.mm in Sources */,
</span><span class="cx">                                 BC06F43012DBB9B6002D78DE /* GeolocationPermissionRequestManager.cpp in Sources */,
</span><span class="cx">                                 BC06F44B12DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.cpp in Sources */,
</span><span class="lines">@@ -8577,6 +8592,7 @@
</span><span class="cx">                                 33367635130C99B2006C9DE2 /* WebResourceCacheManagerProxy.cpp in Sources */,
</span><span class="cx">                                 33367657130C9ECA006C9DE2 /* WebResourceCacheManagerProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 1A8E7D3C18C15149005A702A /* VisitedLinkTableControllerMessageReceiver.cpp in Sources */,
</span><ins>+                                1AD01BC81905D37E00C9C45F /* _WKErrorRecoveryAttempting.mm in Sources */,
</ins><span class="cx">                                 510AFFB916542048001BA05E /* WebResourceLoader.cpp in Sources */,
</span><span class="cx">                                 3F889D14188778C900FEADAF /* WebVideoFullscreenManagerProxy.mm in Sources */,
</span><span class="cx">                                 51F060E11654318500F3281B /* WebResourceLoaderMessageReceiver.cpp in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>