[WK2] IPC callback classes should not be tightly coupled to C API
https://bugs.webkit.org/show_bug.cgi?id=129030

Reviewed by Anders Carlsson.

Changed CallbackBase subclasses to take an std::function (with context captured inside).
Instead of C API objects, these callback functions take implementation ones.
There are VoidAPICallback and GenericAPICallback helpers for the common case of C API.

* Shared/SecurityOriginData.h:
* UIProcess/API/C/WKApplicationCacheManager.cpp:
(WKApplicationCacheManagerGetApplicationCacheOrigins):
* UIProcess/API/C/WKContext.cpp:
(WKContextGetStatistics):
(WKContextGetStatisticsWithOptions):
* UIProcess/API/C/WKCookieManager.cpp:
(WKCookieManagerGetHostnamesWithCookies):
(WKCookieManagerGetHTTPCookieAcceptPolicy):
* UIProcess/API/C/WKDatabaseManager.cpp:
(WKDatabaseManagerGetDatabasesByOrigin):
(WKDatabaseManagerGetDatabaseOrigins):
* UIProcess/API/C/WKFrame.cpp:
(WKFrameGetMainResourceData):
(WKFrameGetResourceData):
(WKFrameGetWebArchive):
* UIProcess/API/C/WKKeyValueStorageManager.cpp:
(WKKeyValueStorageManagerGetKeyValueStorageOrigins):
(WKKeyValueStorageManagerGetStorageDetailsByOrigin):
* UIProcess/API/C/WKMediaCacheManager.cpp:
(WKMediaCacheManagerGetHostnamesWithMediaCache):
* UIProcess/API/C/WKOriginDataManager.cpp:
(WKOriginDataManagerGetOrigins):
* UIProcess/API/C/WKPage.cpp:
(WKPageRunJavaScriptInMainFrame):
(WKPageRenderTreeExternalRepresentation):
(WKPageGetSourceForFrame):
(WKPageGetContentsAsString):
(WKPageGetSelectionAsWebArchiveData):
(WKPageGetContentsAsMHTMLData):
(WKPageForceRepaint):
(WKPageValidateCommand):
(WKPageComputePagesForPrinting):
(WKPageDrawPagesToPDF):
* UIProcess/API/C/WKPluginSiteDataManager.cpp:
(WKPluginSiteDataManagerGetSitesWithData):
(WKPluginSiteDataManagerClearSiteData):
(WKPluginSiteDataManagerClearAllSiteData):
* UIProcess/API/C/WKResourceCacheManager.cpp:
(WKResourceCacheManagerGetCacheOrigins):
* UIProcess/API/gtk/WebKitCookieManager.cpp:
(webkit_cookie_manager_get_accept_policy):
(webkit_cookie_manager_get_domains_with_cookies):
* UIProcess/API/gtk/WebKitPrintOperation.cpp:
(drawPagesForPrintingCompleted):
(webkitPrintOperationPrintPagesForFrame):
* UIProcess/API/gtk/WebKitWebResource.cpp:
(resourceDataCallback):
(webkit_web_resource_get_data):
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_can_execute_editing_command):
(webkitWebViewRunJavaScriptCallback):
(webkit_web_view_run_javascript):
(resourcesStreamReadCallback):
(getContentsAsMHTMLDataCallback):
(webkit_web_view_save):
(webkit_web_view_save_to_file):
* UIProcess/API/ios/WKInteractionView.mm:
(-[WKInteractionView _define:]):
(selectionChangedWithGesture):
(selectionChangedWithTouch):
(-[WKInteractionView changeSelectionWithGestureAt:withGesture:withState:]):
(-[WKInteractionView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
(-[WKInteractionView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
(-[WKInteractionView requestAutocorrectionRectsForString:withCompletionHandler:]):
(-[WKInteractionView applyAutocorrection:toString:withCompletionHandler:]):
(-[WKInteractionView requestAutocorrectionContextWithCompletionHandler:]):
* UIProcess/API/mac/WKPrintingView.mm:
(pageDidDrawToImage):
(-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
(pageDidComputePageRects):
(-[WKPrintingView _askPageToComputePageRects]):
(-[WKPrintingView _drawPreview:]):
* UIProcess/API/mac/WKView.mm:
(-[WKView validateUserInterfaceItem:]):
(-[WKView startSpeaking:]):
* UIProcess/AutoCorrectionCallback.h:
(WebKit::AutocorrectionDataCallback::create):
(WebKit::AutocorrectionDataCallback::performCallbackWithReturnValue):
(WebKit::AutocorrectionDataCallback::invalidate):
(WebKit::AutocorrectionDataCallback::AutocorrectionDataCallback):
(WebKit::AutocorrectionContextCallback::create):
(WebKit::AutocorrectionContextCallback::performCallbackWithReturnValue):
(WebKit::AutocorrectionContextCallback::invalidate):
(WebKit::AutocorrectionContextCallback::AutocorrectionContextCallback):
* UIProcess/GenericCallback.h:
(WebKit::CallbackBase::CallbackBase):
(WebKit::CallbackBase::generateCallbackID):
(WebKit::VoidCallback::create):
(WebKit::VoidCallback::performCallback):
(WebKit::VoidCallback::invalidate):
(WebKit::VoidCallback::VoidCallback):
(WebKit::VoidAPICallback::create):
(WebKit::GenericCallback::create):
(WebKit::GenericCallback::performCallbackWithReturnValue):
(WebKit::GenericCallback::invalidate):
(WebKit::GenericCallback::GenericCallback):
(WebKit::GenericAPICallback::create):
(WebKit::ComputedPagesCallback::create):
(WebKit::ComputedPagesCallback::performCallbackWithReturnValue):
(WebKit::ComputedPagesCallback::invalidate):
(WebKit::ComputedPagesCallback::ComputedPagesCallback):
(WebKit::ImageCallback::create):
(WebKit::ImageCallback::performCallbackWithReturnValue):
(WebKit::ImageCallback::invalidate):
(WebKit::ImageCallback::ImageCallback):
* UIProcess/Plugins/WebPluginSiteDataManager.h:
* UIProcess/StatisticsRequest.h:
* UIProcess/WebApplicationCacheManagerProxy.h:
* UIProcess/WebContext.h:
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebDatabaseManagerProxy.h:
* UIProcess/WebFrameProxy.h:
* UIProcess/WebKeyValueStorageManager.h:
* UIProcess/WebMediaCacheManagerProxy.h:
* UIProcess/WebOriginDataManagerProxy.h:
* UIProcess/WebPageProxy.h:
(WebKit::ValidateCommandCallback::create):
(WebKit::ValidateCommandCallback::performCallbackWithReturnValue):
(WebKit::ValidateCommandCallback::invalidate):
(WebKit::ValidateCommandCallback::ValidateCommandCallback):
(WebKit::GestureCallback::create):
(WebKit::GestureCallback::performCallbackWithReturnValue):
(WebKit::GestureCallback::invalidate):
(WebKit::GestureCallback::GestureCallback):
(WebKit::TouchesCallback::create):
(WebKit::TouchesCallback::performCallbackWithReturnValue):
(WebKit::TouchesCallback::invalidate):
(WebKit::TouchesCallback::TouchesCallback):
* UIProcess/WebResourceCacheManagerProxy.h:
* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):



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

* UIProcess/API/C/WKPage.cpp: (WKPageGetBytecodeProfile): Updated a recently added
instance of ScriptCallback.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel rendering: (RenderLayer)Pass non-css-pixel-snapped dirty rects to PaintInfo when painting renderer().
https://bugs.webkit.org/show_bug.cgi?id=128913

Reviewed by Simon Fraser.

This is part of the preparation to move RenderLayers to device pixel positioning.
We might need to device pixelsnapp the dirty rects later, but PaintInfo should be
able to manage that instead of doing it everywhere in the code.

Covered by existing tests.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintBackgroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
(WebCore::RenderLayer::paintOutlineForFragments):
(WebCore::RenderLayer::paintMaskForFragments):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164411 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel rendering: Make GraphicsLayer::paintGraphicsLayerContents()'s cliprect FloatRect based.
https://bugs.webkit.org/show_bug.cgi?id=128911

Reviewed by Simon Fraser.

Switching from IntRect to FloatRect makes device pixel position clipping possible.

Covered by existing tests.

* WebCore.exp.in:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::paintGraphicsLayerContents):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::platformCALayerPaintContents):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayerClient.h:
* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::platformCALayerPaintContents):
* platform/graphics/mac/WebLayer.mm:
(WebCore::drawLayerContents):
(-[WebSimpleLayer drawInContext:]):


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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Subpixel rendering: Make GraphicsLayer's offsetFromRenderer subpixel position based.
https://bugs.webkit.org/show_bug.cgi?id=128694

Reviewed by Simon Fraser.

Changing layers from using integral types to using Float/LayoutUnits so that
we can position them on subpixels. They are still integral positioned though.

Covered by existing tests.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setOffsetFromRenderer):
(WebCore::GraphicsLayer::paintGraphicsLayerContents):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::offsetFromRenderer): removed incorrect comment.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
(WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
(WebCore::RenderLayerBacking::computeTransformOrigin):
(WebCore::RenderLayerBacking::computePerspectiveOrigin):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresOwnBackingStore):
* rendering/RenderLayerCompositor.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::adjustRegionBoundsFromFlowThreadPortionRect):
* rendering/RenderMultiColumnSet.h:
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::adjustRegionBoundsFromFlowThreadPortionRect):
* rendering/RenderRegion.h:


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