Fix a typo causing TestWebKitAPI to timeout when testing Find.

Reviewed by Dan Bernstein.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageFindClient): Test for !functionPointer like
all the other implementations do.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Pool IOSurfaces to help with allocation cost
https://bugs.webkit.org/show_bug.cgi?id=131096
<rdar://problem/15373942>

Reviewed by Simon Fraser.

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:

* platform/Timer.h:
(WebCore::TimerBase::startRepeating): Add a std::chrono startRepeating.

* platform/graphics/cg/IOSurfacePool.h: Added.
(WebCore::IOSurfacePool::CachedSurfaceDetails::CachedSurfaceDetails):
(WebCore::IOSurfacePool::CachedSurfaceDetails::resetLastUseTime):
* platform/graphics/cg/ImageBufferBackingStoreCache.cpp: Removed.
* platform/graphics/cg/ImageBufferBackingStoreCache.h: Removed.
* platform/graphics/cg/IOSurfacePool.cpp: Added.
(WebCore::IOSurfacePool::IOSurfacePool):
(WebCore::IOSurfacePool::sharedPool):
(WebCore::surfaceMatchesParameters):
(WebCore::IOSurfacePool::willAddSurface):
(WebCore::IOSurfacePool::didRemoveSurface):
(WebCore::IOSurfacePool::didUseSurfaceOfSize):
(WebCore::IOSurfacePool::takeSurface):
(WebCore::IOSurfacePool::addSurface):
(WebCore::IOSurfacePool::insertSurfaceIntoPool):
(WebCore::IOSurfacePool::setPoolSize):
(WebCore::IOSurfacePool::tryEvictInUseSurface):
(WebCore::IOSurfacePool::tryEvictOldestCachedSurface):
(WebCore::IOSurfacePool::evict):
(WebCore::IOSurfacePool::collectInUseSurfaces):
(WebCore::IOSurfacePool::markOlderSurfacesPurgeable):
(WebCore::IOSurfacePool::collectionTimerFired):
(WebCore::IOSurfacePool::scheduleCollectionTimer):
(WebCore::IOSurfacePool::discardAllSurfaces):
(WebCore::IOSurfacePool::showPoolStatistics):
Add a pool of IOSurfaces. It behaves as such:

    - Keeps up to 64MB of surfaces.
    - Keeps unused and in-use surfaces (but never gets more than 1/2 full with the latter)
    - Marks surfaces purgeable after they've been unused for 2 seconds.
    - Tries to move surfaces from the in-use pool to the unused pool every 500ms.
    - Evicts in an LRU-ish fashion, interleaving eviction of the oldest
      surfaces and the in-use surfaces (since in-use surfaces are not immediately
      useful for the pool, but they are desirous because they were recently used).
    - Throws everything away under memory pressure.

* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::create):
Try to grab a surface from the IOSurfacePool.

* platform/ios/MemoryPressureHandlerIOS.mm:
(WebCore::MemoryPressureHandler::platformReleaseMemory):
* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore::MemoryPressureHandler::install):
(WebCore::MemoryPressureHandler::platformReleaseMemory):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::platformReleaseMemory):
Fix some includes, and throw away all surfaces when we're under memory pressure.

* Shared/mac/RemoteLayerBackingStore.h:
* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::~RemoteLayerBackingStore):
(WebKit::RemoteLayerBackingStore::clearBackingStore):
(WebKit::RemoteLayerBackingStore::display):
When RemoteLayerBackingStore discards a layer, throw it into the pool.

* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):
Disable the pool in the UI process.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update WKSI.
<rdar://problem/16321286>

* libWebKitSystemInterfaceMavericks.a:
* libWebKitSystemInterfaceMountainLion.a:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/131135> Introduce LockHistory and LockBackForwardList enums to use in place of bools.

These arguments are often passed using literals at the call site, where the use of bools severely hinders
the readability of the code.

Reviewed by Andreas Kling.

Source/WebCore:

* WebCore.exp.in:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::submit):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::openURL):
(WebCore::HTMLFrameElementBase::setLocation):
* html/HTMLFrameElementBase.h:
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::openInNewTab):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::navigate):
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::FormSubmission):
(WebCore::FormSubmission::create):
* loader/FormSubmission.h:
(WebCore::FormSubmission::lockHistory):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::changeLocation):
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::loadFrameRequest):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::clientRedirected):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/FrameLoader.h:
* loader/FrameLoaderTypes.h:
* loader/NavigationScheduler.cpp:
(WebCore::ScheduledNavigation::ScheduledNavigation):
(WebCore::ScheduledNavigation::lockHistory):
(WebCore::ScheduledNavigation::lockBackForwardList):
(WebCore::ScheduledURLNavigation::ScheduledURLNavigation):
(WebCore::ScheduledRedirect::ScheduledRedirect):
(WebCore::ScheduledLocationChange::ScheduledLocationChange):
(WebCore::ScheduledRefresh::ScheduledRefresh):
(WebCore::ScheduledHistoryNavigation::ScheduledHistoryNavigation):
(WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
(WebCore::NavigationScheduler::scheduleRedirect):
(WebCore::NavigationScheduler::mustLockBackForwardList):
(WebCore::NavigationScheduler::scheduleLocationChange):
(WebCore::NavigationScheduler::scheduleFormSubmission):
* loader/NavigationScheduler.h:
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::requestFrame):
(WebCore::SubframeLoader::requestObject):
(WebCore::SubframeLoader::loadOrRedirectSubframe):
* loader/SubframeLoader.h:
* page/ContextMenuController.cpp:
(WebCore::openNewWindow):
(WebCore::ContextMenuController::contextMenuItemSelected):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::setLocation):
(WebCore::DOMWindow::createWindow):
(WebCore::DOMWindow::open):
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::defaultEventHandler):

Source/WebKit/mac:

* WebView/WebPDFView.mm:
(-[WebPDFView PDFViewWillClickOnLink:withURL:]):

Source/WebKit2:

* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::clickedLink):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/131136> Remove FrameLoadRequest's m_lockHistory member since it's always false.

Reviewed by Andreas Kling.

* loader/FrameLoadRequest.cpp:
(WebCore::FrameLoadRequest::FrameLoadRequest):
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::FrameLoadRequest):
(WebCore::FrameLoadRequest::lockHistory): Deleted.
(WebCore::FrameLoadRequest::setLockHistory): Deleted.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::load): Remove an if whose body was never executed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the !USE(IOSURFACE) iOS build.

* platform/ios/MemoryPressureHandlerIOS.mm:
(WebCore::MemoryPressureHandler::platformReleaseMemory):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the !USE(IOSURFACE) build... again.

* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix after r166684.

Source/WebKit/ios:

* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder simulateClickOnLinkToURL:]):

Source/WebKit/win:

* WebCoreSupport/WebContextMenuClient.cpp:
(WebContextMenuClient::searchWithGoogle):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Speculative build fix for Windows.

* DerivedSources.make: Make sure we generate our media control
scripts for Apple Windows (but not WinCairo)



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@166689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove a FIXME that happened.

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::display):


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