Simplify two HistoryController member functions
https://bugs.webkit.org/show_bug.cgi?id=134064

Reviewed by Dan Bernstein.

Remove the FrameLoadType parameter from recursiveSetProvisionalItem,
use early returns and modern loops.

* loader/HistoryController.cpp:
(WebCore::HistoryController::goToItem):
(WebCore::HistoryController::recursiveSetProvisionalItem):
(WebCore::HistoryController::recursiveGoToItem):
* loader/HistoryController.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix Windows build.

* WebFrame.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Address a review comment from Darin.

* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::willLoadXHR):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Put the divider in the right place.

* DerivedSources.make:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
check-webkit-style does not understand Obj-C literal syntax for NSDictionary
<http://webkit.org/b/134061>

Reviewed by Dan Bernstein.

* Scripts/webkitpy/style/checkers/cpp.py:
(check_spacing): Ignore '@' immediately before '{'.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest.test_spacing_before_braces): Add unit test for
'^{' block syntax and '@{' Objective-C liternal NSDitionary
syntax.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Curl] Compile errors related to http header field names.
https://bugs.webkit.org/show_bug.cgi?id=134029

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-06-19
Reviewed by Brent Fulgham.

Http header field names should now be specified with an enum, not a string.

* platform/network/curl/MultipartHandle.cpp:
(WebCore::MultipartHandle::didReceiveResponse):
* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::getProtectionSpace):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Copy SharedBuffer data into IPC message directly
https://bugs.webkit.org/show_bug.cgi?id=133920

Reviewed by Anders Carlsson.

When data array callbacks are enabled, we currently merge all the CFDataRefs in SharedBuffer
into one contiguous memory buffer when creating IPC::DataReference. This patch creates a
subclass of DataReference that uses SharedBuffer::getSomeData() to copy the data directly
into the IPC message.

* NetworkProcess/AsynchronousNetworkLoaderClient.cpp:
(WebKit::AsynchronousNetworkLoaderClient::didReceiveBuffer):
* Platform/IPC/ArgumentEncoder.cpp:
(IPC::ArgumentEncoder::reserve): Added.
(IPC::ArgumentEncoder::grow):
* Platform/IPC/ArgumentEncoder.h:
* Platform/IPC/DataReference.cpp:
(IPC::SharedBufferDataReference::encode):
* Platform/IPC/DataReference.h:
(IPC::DataReference::~DataReference):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170154 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-06-19  Oliver Hunt  <oliver@apple.com>

        Switch to using the process parameters during initialisation
        to determine whether we hsould be using the network process.

        RS=Sam Weinig

        * WebProcess/cocoa/WebProcessCocoa.mm:
        (WebKit::WebProcess::platformInitializeWebProcess):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170155 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't kill the UIProcess until all local storage transactions have been committed.
https://bugs.webkit.org/show_bug.cgi?id=134042.
<rdar://problem/16660724>.

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm: Add a listener for the application will terminate notification.
(-[WKView _applicationWillTerminate:]):
(-[WKView initWithFrame:context:configuration:webView:]):
* UIProcess/WebContext.cpp: Calls code in StorageManager to cleanup local storage transactions upon application termination.
(WebKit::WebContext::applicationWillTerminate):
* UIProcess/WebContext.h:

* UIProcess/Storage/StorageManager.cpp:
(WebKit::StorageManager::applicationWillTerminate):
Dispatch local storage cleanup task to background thread and make sure the UIProcess can't exit early.
* UIProcess/Storage/StorageManager.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170156 268f45cc-cd09-0410-ab3c-d52691b4dbfc
No way to handle HTTP Authentication with WKWebView
https://bugs.webkit.org/show_bug.cgi?id=134067
<rdar://problem/17317874>

Reviewed by Dan Bernstein.

Add a public webView:didReceiveAuthenticationChallenge:completionHandler: delegate method and get rid of the SPI.

* Shared/API/Cocoa/WKFoundation.h:
* UIProcess/API/Cocoa/WKNavigationDelegate.h:
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::LoaderClient::didReceiveAuthenticationChallengeInFrame):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@170157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use a single map for all callback types in WebPageProxy
https://bugs.webkit.org/show_bug.cgi?id=134069

Reviewed by Anders Carlsson.

* UIProcess/GenericCallback.h:
(WebKit::CallbackBase::as): Added. Performs a dynamic cast to a specific callback type.
(WebKit::CallbackBase::CallbackBase): Added a type parameter, which is used to initialize
the new m_type member.
(WebKit::GenericCallback::GenericCallback): Pass the type to the base class constructor.
(WebKit::GenericCallback::type): Added. Returns a unique type.
(WebKit::GenericCallback::invalidate): Now virtual.

(WebKit::CallbackMap::put): Adds the callback to the map.
(WebKit::CallbackMap::take): Removes the callback from the map, and dynamically casts it to
the specified type.
(WebKit::CallbackMap::invalidate): Invalidates the map.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::validateCommand):
(WebKit::WebPageProxy::runJavaScriptInMainFrame):
(WebKit::WebPageProxy::getRenderTreeExternalRepresentation):
(WebKit::WebPageProxy::getSourceForFrame):
(WebKit::WebPageProxy::getContentsAsString):
(WebKit::WebPageProxy::getBytecodeProfile):
(WebKit::WebPageProxy::getSelectionOrContentsAsString):
(WebKit::WebPageProxy::getSelectionAsWebArchiveData):
(WebKit::WebPageProxy::getMainResourceDataOfFrame):
(WebKit::WebPageProxy::getResourceDataFromFrame):
(WebKit::WebPageProxy::getWebArchiveOfFrame):
(WebKit::WebPageProxy::forceRepaint):
(WebKit::WebPageProxy::clearLoadDependentCallbacks):
(WebKit::WebPageProxy::voidCallback):
(WebKit::WebPageProxy::dataCallback):
(WebKit::WebPageProxy::imageCallback):
(WebKit::WebPageProxy::stringCallback):
(WebKit::WebPageProxy::scriptValueCallback):
(WebKit::WebPageProxy::computedPagesCallback):
(WebKit::WebPageProxy::validateCommandCallback):
(WebKit::WebPageProxy::unsignedCallback):
(WebKit::WebPageProxy::editingRangeCallback):
(WebKit::WebPageProxy::rectForCharacterRangeCallback):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::computePagesForPrinting):
(WebKit::WebPageProxy::drawRectToImage):
(WebKit::WebPageProxy::drawPagesToPDF):
(WebKit::WebPageProxy::getMarkedRangeAsync):
(WebKit::WebPageProxy::getSelectedRangeAsync):
(WebKit::WebPageProxy::characterIndexForPointAsync):
(WebKit::WebPageProxy::firstRectForCharacterRangeAsync):
(WebKit::WebPageProxy::takeSnapshot):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::gestureCallback):
(WebKit::WebPageProxy::touchesCallback):
(WebKit::WebPageProxy::autocorrectionDataCallback):
(WebKit::WebPageProxy::dictationContextCallback):
(WebKit::WebPageProxy::autocorrectionContextCallback):
(WebKit::WebPageProxy::selectWithGesture):
(WebKit::WebPageProxy::updateSelectionWithTouches):
(WebKit::WebPageProxy::requestAutocorrectionData):
(WebKit::WebPageProxy::applyAutocorrection):
(WebKit::WebPageProxy::requestDictationContext):
(WebKit::WebPageProxy::requestAutocorrectionContext):
(WebKit::WebPageProxy::selectWithTwoTouches):



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