[Cocoa] Add a way to recover from load errors
https://bugs.webkit.org/show_bug.cgi?id=125020

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(createErrorWithRecoveryAttempter): Added this helper function. It creates an NSError from
the given error, adding two keys to the user info dictionary: the context controller under
the recovery attempter key, and the frame under a private key.
(didFailProvisionalLoadWithErrorForFrame): Changed to use createErrorWithRecoveryAttempter.
(didFailLoadWithErrorForFrame): Ditto.
(-[WKBrowsingContextController attemptRecoveryFromError:]): Implemented this
WKErrorRecoveryAttempting protocol method by loading the failing URL from the error into the
frame from the error.

* UIProcess/API/Cocoa/WKErrorRecoveryAttempting.h: Added. Defines a protocol for attempting
recovery from errors and declares the error user info dictionary key under which an object
conforming to this protocol may be stored.
* UIProcess/API/Cocoa/WKErrorRecoveryAttempting.m: Added. Defines
WKRecoveryAttempterErrorKey.

* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::loadURL): Added. Sends the LoadURLInFrame message to the page.
* UIProcess/WebFrameProxy.h:

* WebKit2.xcodeproj/project.pbxproj: Added references to new files.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadURLInFrame): Added. Loads the URL in the given frame.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: Added LoadURLInFrame.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159876 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Make WKBrowsingContextController work with WKObject wrapping
https://bugs.webkit.org/show_bug.cgi?id=125022

Reviewed by Dan Bernstein.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
        
* Shared/mac/ObjCObjectGraphCoders.mm:
Add support for WKProcessGroup.

(WebKit::WebContextObjCObjectGraphDecoderImpl::decode):
Replace call to _browsingContextControllerForPageRef: with wrapper.

* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
Convert from wrapping the C-SPI type to storing the bits of the wrapped object inline.

(-[WKBrowsingContextController dealloc]):
Add explicit destructor call.

(-[WKBrowsingContextController setLoadDelegate:]):
(-[WKBrowsingContextController setPolicyDelegate:]):
Lazily set up the load and policy clients only once a delegate has been set to allow
continued use of the C-SPI clients for WebKitTestRunner.

(-[WKBrowsingContextController _finishInitialization]):
Move remaining work that was done in the initialize (setting up the observer) here,
and have the WebPageProxy call it.

* UIProcess/API/Cocoa/WKBrowsingContextControllerInternal.h:
(WebKit::wrapper):
Add wrapper() helper and declare conformance to the WKObject protocol. Remove no longer used
_initWithPageRef: and _browsingContextControllerForPageRef: helpers.

* UIProcess/API/Cocoa/WKProcessGroup.mm:
(didNavigateWithNavigationData):
(didPerformClientRedirect):
(didPerformServerRedirect):
(didUpdateHistoryTitle):
Switch to using wrapper().

* UIProcess/API/ios/WKContentView.mm:
* UIProcess/API/mac/WKView.mm:
Stop caching the WKBrowsingContextController, as it no long makes sense since it is the same object
as the WebPageProxy.

* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::platformInitialize):
Inform the wrapper that it is safe to finish initialization.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the iOS build.

* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController loadDelegate]):
(-[WKBrowsingContextController policyDelegate]):
(-[WKBrowsingContextController setPolicyDelegate:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix some style boo-boos.

* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController loadDelegate]):
(-[WKBrowsingContextController setLoadDelegate:]):
(-[WKBrowsingContextController policyDelegate]):
(-[WKBrowsingContextController setPolicyDelegate:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix crashing API tests.

* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController dealloc]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Add a little template magic to the inline API::Object storage to remove the need for all the reinterpret_casts
https://bugs.webkit.org/show_bug.cgi?id=125024

Reviewed by Dan Bernstein.

Introduce API::ObjectStorage which wraps std::aligned_storage and adds some convenience functions
to reinterpret the data as the corresponding type. Deploy it everywhere we were previously using 
std::aligned_storage.

* Shared/Cocoa/WKNSArray.mm:
* Shared/Cocoa/WKNSDictionary.mm:
* Shared/Cocoa/WKObject.h:
* UIProcess/API/Cocoa/WKBackForwardList.mm:
* UIProcess/API/Cocoa/WKBackForwardListItem.mm:
* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
* UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
* UIProcess/API/Cocoa/WKNavigationData.mm:
* UIProcess/API/Cocoa/WKProcessGroup.mm:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159881 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix build warnings in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=125012

Patch by Tibor Meszaros <mtibor@inf.u-szeged.hu> on 2013-11-29
Reviewed by Anders Carlsson.

fix unused parameter warnings in the following files:

* Platform/gtk/WorkQueueGtk.cpp:
(WorkQueue::SocketEventSource::eventCallback):
* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKArrayIsMutable):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::unavailablePluginButtonClicked):
(WebKit::WebChromeClient::didAddHeaderLayer):
(WebKit::WebChromeClient::didAddFooterLayer):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createJavaAppletWidget):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159882 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL IC should nop-fill to make up the difference between the actual IC size and the requested patchpoint size
https://bugs.webkit.org/show_bug.cgi?id=124960

Reviewed by Sam Weinig.

* assembler/LinkBuffer.h:
(JSC::LinkBuffer::size):
* assembler/X86Assembler.h:
(JSC::X86Assembler::fillNops):
* dfg/DFGDisassembler.cpp:
(JSC::DFG::Disassembler::dumpHeader):
* ftl/FTLCompile.cpp:
(JSC::FTL::generateICFastPath):
* jit/JITDisassembler.cpp:
(JSC::JITDisassembler::dumpHeader):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159883 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix for EFL and GTK WK2 builds.

* Scripts/generate-forwarding-headers.pl: Add Cocoa to the list of platform prefixes.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159884 268f45cc-cd09-0410-ab3c-d52691b4dbfc