Part 1 of Change GenericCallback<> function parameters into std::function<>
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jun 2014 04:09:25 +0000 (04:09 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Jun 2014 04:09:25 +0000 (04:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133927

Reviewed by Sam Weinig.

* 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/WKPluginSiteDataManager.cpp:
(WKPluginSiteDataManagerGetSitesWithData):
* UIProcess/API/C/WKResourceCacheManager.cpp:
(WKResourceCacheManagerGetCacheOrigins):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
* UIProcess/API/mac/WKView.mm:
(-[WKView attributedSubstringForProposedRange:completionHandler:]):
* UIProcess/Plugins/WebPluginSiteDataManager.cpp:
(WebKit::WebPluginSiteDataManager::getSitesWithData):
* UIProcess/Plugins/WebPluginSiteDataManager.h:
* UIProcess/WebApplicationCacheManagerProxy.cpp:
(WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins):
* UIProcess/WebApplicationCacheManagerProxy.h:
* UIProcess/WebContext.cpp:
(WebKit::WebContext::getStatistics):
* UIProcess/WebContext.h:
* UIProcess/WebCookieManagerProxy.cpp:
(WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
(WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
* UIProcess/WebCookieManagerProxy.h:
* UIProcess/WebDatabaseManagerProxy.cpp:
(WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
(WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
* UIProcess/WebDatabaseManagerProxy.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::getWebArchive):
(WebKit::WebFrameProxy::getMainResourceData):
(WebKit::WebFrameProxy::getResourceData):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebKeyValueStorageManager.cpp:
(WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
(WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
* UIProcess/WebKeyValueStorageManager.h:
* UIProcess/WebMediaCacheManagerProxy.cpp:
(WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache):
* UIProcess/WebMediaCacheManagerProxy.h:
* UIProcess/WebOriginDataManagerProxy.cpp:
(WebKit::WebOriginDataManagerProxy::getOrigins):
* UIProcess/WebOriginDataManagerProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::getMainResourceDataOfFrame):
(WebKit::WebPageProxy::getResourceDataFromFrame):
(WebKit::WebPageProxy::getWebArchiveOfFrame):
* UIProcess/WebPageProxy.h:
* UIProcess/WebResourceCacheManagerProxy.cpp:
(WebKit::WebResourceCacheManagerProxy::getCacheOrigins):
* UIProcess/WebResourceCacheManagerProxy.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
(-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::selectWithGesture):
(WebKit::WebPageProxy::selectWithTwoTouches):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):

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

38 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKApplicationCacheManager.cpp
Source/WebKit2/UIProcess/API/C/WKContext.cpp
Source/WebKit2/UIProcess/API/C/WKCookieManager.cpp
Source/WebKit2/UIProcess/API/C/WKDatabaseManager.cpp
Source/WebKit2/UIProcess/API/C/WKFrame.cpp
Source/WebKit2/UIProcess/API/C/WKKeyValueStorageManager.cpp
Source/WebKit2/UIProcess/API/C/WKMediaCacheManager.cpp
Source/WebKit2/UIProcess/API/C/WKOriginDataManager.cpp
Source/WebKit2/UIProcess/API/C/WKPluginSiteDataManager.cpp
Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.cpp
Source/WebKit2/UIProcess/Plugins/WebPluginSiteDataManager.h
Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp
Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.h
Source/WebKit2/UIProcess/WebContext.cpp
Source/WebKit2/UIProcess/WebContext.h
Source/WebKit2/UIProcess/WebCookieManagerProxy.cpp
Source/WebKit2/UIProcess/WebCookieManagerProxy.h
Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp
Source/WebKit2/UIProcess/WebDatabaseManagerProxy.h
Source/WebKit2/UIProcess/WebFrameProxy.cpp
Source/WebKit2/UIProcess/WebFrameProxy.h
Source/WebKit2/UIProcess/WebKeyValueStorageManager.cpp
Source/WebKit2/UIProcess/WebKeyValueStorageManager.h
Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.cpp
Source/WebKit2/UIProcess/WebMediaCacheManagerProxy.h
Source/WebKit2/UIProcess/WebOriginDataManagerProxy.cpp
Source/WebKit2/UIProcess/WebOriginDataManagerProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.cpp
Source/WebKit2/UIProcess/WebResourceCacheManagerProxy.h
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm

index 0a640cc..1faec15 100644 (file)
@@ -1,5 +1,91 @@
 2014-06-15  Dan Bernstein  <mitz@apple.com>
 
+        Part 1 of Change GenericCallback<> function parameters into std::function<>
+        https://bugs.webkit.org/show_bug.cgi?id=133927
+
+        Reviewed by Sam Weinig.
+
+        * 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/WKPluginSiteDataManager.cpp:
+        (WKPluginSiteDataManagerGetSitesWithData):
+        * UIProcess/API/C/WKResourceCacheManager.cpp:
+        (WKResourceCacheManagerGetCacheOrigins):
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _getWebArchiveDataWithCompletionHandler:]):
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView attributedSubstringForProposedRange:completionHandler:]):
+        * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
+        (WebKit::WebPluginSiteDataManager::getSitesWithData):
+        * UIProcess/Plugins/WebPluginSiteDataManager.h:
+        * UIProcess/WebApplicationCacheManagerProxy.cpp:
+        (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins):
+        * UIProcess/WebApplicationCacheManagerProxy.h:
+        * UIProcess/WebContext.cpp:
+        (WebKit::WebContext::getStatistics):
+        * UIProcess/WebContext.h:
+        * UIProcess/WebCookieManagerProxy.cpp:
+        (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
+        (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
+        * UIProcess/WebCookieManagerProxy.h:
+        * UIProcess/WebDatabaseManagerProxy.cpp:
+        (WebKit::WebDatabaseManagerProxy::getDatabasesByOrigin):
+        (WebKit::WebDatabaseManagerProxy::getDatabaseOrigins):
+        * UIProcess/WebDatabaseManagerProxy.h:
+        * UIProcess/WebFrameProxy.cpp:
+        (WebKit::WebFrameProxy::getWebArchive):
+        (WebKit::WebFrameProxy::getMainResourceData):
+        (WebKit::WebFrameProxy::getResourceData):
+        * UIProcess/WebFrameProxy.h:
+        * UIProcess/WebKeyValueStorageManager.cpp:
+        (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
+        (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
+        * UIProcess/WebKeyValueStorageManager.h:
+        * UIProcess/WebMediaCacheManagerProxy.cpp:
+        (WebKit::WebMediaCacheManagerProxy::getHostnamesWithMediaCache):
+        * UIProcess/WebMediaCacheManagerProxy.h:
+        * UIProcess/WebOriginDataManagerProxy.cpp:
+        (WebKit::WebOriginDataManagerProxy::getOrigins):
+        * UIProcess/WebOriginDataManagerProxy.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::getMainResourceDataOfFrame):
+        (WebKit::WebPageProxy::getResourceDataFromFrame):
+        (WebKit::WebPageProxy::getWebArchiveOfFrame):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebResourceCacheManagerProxy.cpp:
+        (WebKit::WebResourceCacheManagerProxy::getCacheOrigins):
+        * UIProcess/WebResourceCacheManagerProxy.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
+        (-[WKContentView changeSelectionWithTouchesFrom:to:withGesture:withState:]):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::selectWithGesture):
+        (WebKit::WebPageProxy::selectWithTwoTouches):
+        * UIProcess/mac/WebPageProxyMac.mm:
+        (WebKit::WebPageProxy::attributedSubstringForCharacterRangeAsync):
+
+2014-06-15  Dan Bernstein  <mitz@apple.com>
+
         <rdar://problem/17291697> [Cocoa] Can’t tell at policy decision time whether WebKit can handle the request
         https://bugs.webkit.org/show_bug.cgi?id=133930
 
index 7a86a2a..c6eaa60 100644 (file)
@@ -38,7 +38,7 @@ WKTypeID WKApplicationCacheManagerGetTypeID()
 
 void WKApplicationCacheManagerGetApplicationCacheOrigins(WKApplicationCacheManagerRef applicationCacheManagerRef, void* context, WKApplicationCacheManagerGetApplicationCacheOriginsFunction callback)
 {
-    toImpl(applicationCacheManagerRef)->getApplicationCacheOrigins(ArrayCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(applicationCacheManagerRef)->getApplicationCacheOrigins(toGenericCallbackFunction(context, callback));
 }
 
 void WKApplicationCacheManagerDeleteEntriesForOrigin(WKApplicationCacheManagerRef applicationCacheManagerRef, WKSecurityOriginRef originRef)
index 57495bc..9ebeb53 100644 (file)
@@ -517,12 +517,12 @@ void WKContextWarmInitialProcess(WKContextRef contextRef)
 
 void WKContextGetStatistics(WKContextRef contextRef, void* context, WKContextGetStatisticsFunction callback)
 {
-    toImpl(contextRef)->getStatistics(0xFFFFFFFF, DictionaryCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(contextRef)->getStatistics(0xFFFFFFFF, toGenericCallbackFunction(context, callback));
 }
 
 void WKContextGetStatisticsWithOptions(WKContextRef contextRef, WKStatisticsOptions optionsMask, void* context, WKContextGetStatisticsFunction callback)
 {
-    toImpl(contextRef)->getStatistics(optionsMask, DictionaryCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(contextRef)->getStatistics(optionsMask, toGenericCallbackFunction(context, callback));
 }
 
 void WKContextGarbageCollectJavaScriptObjects(WKContextRef contextRef)
index 4ec7ab0..a8d3a19 100644 (file)
@@ -43,7 +43,7 @@ void WKCookieManagerSetClient(WKCookieManagerRef cookieManagerRef, const WKCooki
 
 void WKCookieManagerGetHostnamesWithCookies(WKCookieManagerRef cookieManagerRef, void* context, WKCookieManagerGetCookieHostnamesFunction callback)
 {
-    toImpl(cookieManagerRef)->getHostnamesWithCookies(ArrayCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(cookieManagerRef)->getHostnamesWithCookies(toGenericCallbackFunction(context, callback));
 }
 
 void WKCookieManagerDeleteCookiesForHostname(WKCookieManagerRef cookieManagerRef, WKStringRef hostname)
@@ -68,7 +68,7 @@ void WKCookieManagerSetHTTPCookieAcceptPolicy(WKCookieManagerRef cookieManager,
 
 void WKCookieManagerGetHTTPCookieAcceptPolicy(WKCookieManagerRef cookieManager, void* context, WKCookieManagerGetHTTPCookieAcceptPolicyFunction callback)
 {
-    toImpl(cookieManager)->getHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicyCallback::create(toGenericCallbackFunction<WKHTTPCookieAcceptPolicy, HTTPCookieAcceptPolicy>(context, callback)));
+    toImpl(cookieManager)->getHTTPCookieAcceptPolicy(toGenericCallbackFunction<WKHTTPCookieAcceptPolicy, HTTPCookieAcceptPolicy>(context, callback));
 }
 
 void WKCookieManagerStartObservingCookieChanges(WKCookieManagerRef cookieManager)
index b3ded28..9ac8f86 100644 (file)
@@ -155,7 +155,7 @@ void WKDatabaseManagerSetClient(WKDatabaseManagerRef databaseManagerRef, const W
 void WKDatabaseManagerGetDatabasesByOrigin(WKDatabaseManagerRef databaseManagerRef, void* context, WKDatabaseManagerGetDatabasesByOriginFunction callback)
 {
 #if ENABLE(SQL_DATABASE)
-    toImpl(databaseManagerRef)->getDatabasesByOrigin(ArrayCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(databaseManagerRef)->getDatabasesByOrigin(toGenericCallbackFunction(context, callback));
 #else
     UNUSED_PARAM(databaseManagerRef);
     UNUSED_PARAM(context);
@@ -166,7 +166,7 @@ void WKDatabaseManagerGetDatabasesByOrigin(WKDatabaseManagerRef databaseManagerR
 void WKDatabaseManagerGetDatabaseOrigins(WKDatabaseManagerRef databaseManagerRef, void* context, WKDatabaseManagerGetDatabaseOriginsFunction callback)
 {
 #if ENABLE(SQL_DATABASE)
-    toImpl(databaseManagerRef)->getDatabaseOrigins(ArrayCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(databaseManagerRef)->getDatabaseOrigins(toGenericCallbackFunction(context, callback));
 #else
     UNUSED_PARAM(databaseManagerRef);
     UNUSED_PARAM(context);
index 826584a..24be534 100644 (file)
@@ -124,17 +124,17 @@ bool WKFrameIsFrameSet(WKFrameRef frameRef)
 
 void WKFrameGetMainResourceData(WKFrameRef frameRef, WKFrameGetResourceDataFunction callback, void* context)
 {
-    toImpl(frameRef)->getMainResourceData(DataCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(frameRef)->getMainResourceData(toGenericCallbackFunction(context, callback));
 }
 
 void WKFrameGetResourceData(WKFrameRef frameRef, WKURLRef resourceURL, WKFrameGetResourceDataFunction callback, void* context)
 {
-    toImpl(frameRef)->getResourceData(toImpl(resourceURL), DataCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(frameRef)->getResourceData(toImpl(resourceURL), toGenericCallbackFunction(context, callback));
 }
 
 void WKFrameGetWebArchive(WKFrameRef frameRef, WKFrameGetWebArchiveFunction callback, void* context)
 {
-    toImpl(frameRef)->getWebArchive(DataCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(frameRef)->getWebArchive(toGenericCallbackFunction(context, callback));
 }
 
 // NOTE: These are deprecated and should be removed. They currently do nothing.
index 43b2592..f4b9890 100644 (file)
@@ -56,12 +56,12 @@ WKStringRef WKKeyValueStorageManagerGetModificationTimeKey()
 
 void WKKeyValueStorageManagerGetKeyValueStorageOrigins(WKKeyValueStorageManagerRef keyValueStorageManagerRef, void* context, WKKeyValueStorageManagerGetKeyValueStorageOriginsFunction callback)
 {
-    toImpl(keyValueStorageManagerRef)->getKeyValueStorageOrigins(ArrayCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(keyValueStorageManagerRef)->getKeyValueStorageOrigins(toGenericCallbackFunction(context, callback));
 }
 
 void WKKeyValueStorageManagerGetStorageDetailsByOrigin(WKKeyValueStorageManagerRef keyValueStorageManagerRef, void* context, WKKeyValueStorageManagerGetStorageDetailsByOriginFunction callback)
 {
-    toImpl(keyValueStorageManagerRef)->getStorageDetailsByOrigin(ArrayCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(keyValueStorageManagerRef)->getStorageDetailsByOrigin(toGenericCallbackFunction(context, callback));
 }
 
 void WKKeyValueStorageManagerDeleteEntriesForOrigin(WKKeyValueStorageManagerRef keyValueStorageManagerRef, WKSecurityOriginRef originRef)
index c17025e..d672f8e 100644 (file)
@@ -38,7 +38,7 @@ WKTypeID WKMediaCacheManagerGetTypeID()
 
 void WKMediaCacheManagerGetHostnamesWithMediaCache(WKMediaCacheManagerRef mediaCacheManagerRef, void* context, WKMediaCacheManagerGetHostnamesWithMediaCacheFunction callback)
 {
-    toImpl(mediaCacheManagerRef)->getHostnamesWithMediaCache(ArrayCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(mediaCacheManagerRef)->getHostnamesWithMediaCache(toGenericCallbackFunction(context, callback));
 }
 
 void WKMediaCacheManagerClearCacheForHostname(WKMediaCacheManagerRef mediaCacheManagerRef, WKStringRef hostname)
index 55cb721..ce9d3b2 100644 (file)
@@ -38,7 +38,7 @@ WKTypeID WKOriginDataManagerGetTypeID()
 
 void WKOriginDataManagerGetOrigins(WKOriginDataManagerRef originDataManagerRef, WKOriginDataTypes types, void* context, WKOriginDataManagerGetOriginsFunction callback)
 {
-    toImpl(originDataManagerRef)->getOrigins(types, ArrayCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(originDataManagerRef)->getOrigins(types, toGenericCallbackFunction(context, callback));
 }
 
 void WKOriginDataManagerDeleteEntriesForOrigin(WKOriginDataManagerRef originDataManagerRef, WKOriginDataTypes types, WKSecurityOriginRef originRef)
index 24eb13c..9bf0e24 100644 (file)
@@ -48,7 +48,7 @@ WKTypeID WKPluginSiteDataManagerGetTypeID()
 void WKPluginSiteDataManagerGetSitesWithData(WKPluginSiteDataManagerRef managerRef, void* context, WKPluginSiteDataManagerGetSitesWithDataFunction callback)
 {
 #if ENABLE(NETSCAPE_PLUGIN_API)
-    toImpl(managerRef)->getSitesWithData(ArrayCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(managerRef)->getSitesWithData(toGenericCallbackFunction(context, callback));
 #else
     UNUSED_PARAM(managerRef);
     UNUSED_PARAM(context);
index 5c7f213..a9c62ea 100644 (file)
@@ -38,7 +38,7 @@ WKTypeID WKResourceCacheManagerGetTypeID()
 
 void WKResourceCacheManagerGetCacheOrigins(WKResourceCacheManagerRef cacheManagerRef, void* context, WKResourceCacheManagerGetCacheOriginsFunction callback)
 {
-    toImpl(cacheManagerRef)->getCacheOrigins(ArrayCallback::create(toGenericCallbackFunction(context, callback)));
+    toImpl(cacheManagerRef)->getCacheOrigins(toGenericCallbackFunction(context, callback));
 }
 
 void WKResourceCacheManagerClearCacheForOrigin(WKResourceCacheManagerRef cacheManagerRef, WKSecurityOriginRef originRef, WKResourceCachesToClear cachesToClear)
index 046167b..e5b91b2 100644 (file)
@@ -1520,7 +1520,7 @@ static inline WebCore::LayoutMilestones layoutMilestones(_WKRenderingProgressEve
 {
     auto handler = adoptNS([completionHandler copy]);
 
-    _page->getWebArchiveOfFrame(_page->mainFrame(), WebKit::DataCallback::create([handler](API::Data* data, WebKit::CallbackBase::Error error) {
+    _page->getWebArchiveOfFrame(_page->mainFrame(), [handler](API::Data* data, WebKit::CallbackBase::Error error) {
         void (^completionHandlerBlock)(NSData *, NSError *) = (void (^)(NSData *, NSError *))handler.get();
         if (error != WebKit::CallbackBase::Error::None) {
             // FIXME: Pipe a proper error in from the WebPageProxy.
@@ -1528,7 +1528,7 @@ static inline WebCore::LayoutMilestones layoutMilestones(_WKRenderingProgressEve
             completionHandlerBlock(nil, error.get());
         } else
             completionHandlerBlock(wrapper(*data), nil);
-    }));
+    });
 }
 
 - (_WKPaginationMode)_paginationMode
index 5a10caa..1c1e826 100644 (file)
@@ -1524,7 +1524,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
     RetainPtr<id> completionHandler = adoptNS([completionHandlerPtr copy]);
 
     LOG(TextInput, "attributedSubstringFromRange:(%u, %u)", nsRange.location, nsRange.length);
-    _data->_page->attributedSubstringForCharacterRangeAsync(nsRange, AttributedStringForCharacterRangeCallback::create([completionHandler](const AttributedString& string, const EditingRange& actualRange, CallbackBase::Error error) {
+    _data->_page->attributedSubstringForCharacterRangeAsync(nsRange, [completionHandler](const AttributedString& string, const EditingRange& actualRange, CallbackBase::Error error) {
         void (^completionHandlerBlock)(NSAttributedString *, NSRange) = (void (^)(NSAttributedString *, NSRange))completionHandler.get();
         if (error != CallbackBase::Error::None) {
             LOG(TextInput, "    ...attributedSubstringFromRange failed.");
@@ -1533,7 +1533,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
         }
         LOG(TextInput, "    -> attributedSubstringFromRange returned %@", [string.string.get() string]);
         completionHandlerBlock([[string.string.get() retain] autorelease], actualRange);
-    }));
+    });
 }
 
 - (void)firstRectForCharacterRange:(NSRange)theRange completionHandler:(void(^)(NSRect firstRect, NSRange actualRange))completionHandlerPtr
index 52c1513..7022a52 100644 (file)
@@ -138,9 +138,9 @@ void WebPluginSiteDataManager::invalidate()
     m_pendingClearSiteData.clear();
 }
 
-void WebPluginSiteDataManager::getSitesWithData(PassRefPtr<ArrayCallback> prpCallback)
+void WebPluginSiteDataManager::getSitesWithData(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    RefPtr<ArrayCallback> callback = prpCallback;
+    RefPtr<ArrayCallback> callback = ArrayCallback::create(std::move(callbackFunction));
 
     if (!m_webContext) {
         callback->invalidate();
index e6aafaf..0dcc86f 100644 (file)
@@ -50,7 +50,7 @@ public:
     void invalidate();
     void clearContext() { m_webContext = 0; }
 
-    void getSitesWithData(PassRefPtr<ArrayCallback>);
+    void getSitesWithData(std::function<void (API::Array*, CallbackBase::Error)>);
     void didGetSitesWithData(const Vector<String>& sites, uint64_t callbackID);
 
     void clearSiteData(API::Array* sites, uint64_t flags, uint64_t maxAgeInSeconds, PassRefPtr<VoidCallback>);
index 6ac90e7..3a3c88c 100644 (file)
@@ -80,13 +80,15 @@ void WebApplicationCacheManagerProxy::derefWebContextSupplement()
     API::Object::deref();
 }
 
-void WebApplicationCacheManagerProxy::getApplicationCacheOrigins(PassRefPtr<ArrayCallback> prpCallback)
+void WebApplicationCacheManagerProxy::getApplicationCacheOrigins(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    if (!context())
+    RefPtr<ArrayCallback> callback = ArrayCallback::create(std::move(callbackFunction));
+
+    if (!context()) {
+        callback->invalidate();
         return;
+    }
 
-    RefPtr<ArrayCallback> callback = prpCallback;
-    
     uint64_t callbackID = callback->callbackID();
     m_arrayCallbacks.set(callbackID, callback.release());
 
index 8ecfb67..581aed1 100644 (file)
@@ -52,7 +52,7 @@ public:
     static PassRefPtr<WebApplicationCacheManagerProxy> create(WebContext*);
     virtual ~WebApplicationCacheManagerProxy();
 
-    void getApplicationCacheOrigins(PassRefPtr<ArrayCallback>);
+    void getApplicationCacheOrigins(std::function<void (API::Array*, CallbackBase::Error)>);
     void deleteEntriesForOrigin(WebSecurityOrigin*);
     void deleteAllEntries();
 
index 9d237cc..eb2cf0d 100644 (file)
@@ -1216,14 +1216,14 @@ bool WebContext::httpPipeliningEnabled() const
 #endif
 }
 
-void WebContext::getStatistics(uint32_t statisticsMask, PassRefPtr<DictionaryCallback> callback)
+void WebContext::getStatistics(uint32_t statisticsMask, std::function<void (ImmutableDictionary*, CallbackBase::Error)> callbackFunction)
 {
     if (!statisticsMask) {
-        callback->invalidate();
+        callbackFunction(nullptr, CallbackBase::Error::Unknown);
         return;
     }
 
-    RefPtr<StatisticsRequest> request = StatisticsRequest::create(callback);
+    RefPtr<StatisticsRequest> request = StatisticsRequest::create(DictionaryCallback::create(std::move(callbackFunction)));
 
     if (statisticsMask & StatisticsRequestTypeWebContent)
         requestWebContentStatistics(request.get());
index 7df2b5e..33021f5 100644 (file)
@@ -267,7 +267,7 @@ public:
     void setHTTPPipeliningEnabled(bool);
     bool httpPipeliningEnabled() const;
 
-    void getStatistics(uint32_t statisticsMask, PassRefPtr<DictionaryCallback>);
+    void getStatistics(uint32_t statisticsMask, std::function<void (ImmutableDictionary*, CallbackBase::Error)>);
     
     void garbageCollectJavaScriptObjects();
     void setJavaScriptGarbageCollectorTimerEnabled(bool flag);
index b7ad9cf..c7d45c8 100644 (file)
@@ -99,9 +99,9 @@ void WebCookieManagerProxy::derefWebContextSupplement()
     API::Object::deref();
 }
 
-void WebCookieManagerProxy::getHostnamesWithCookies(PassRefPtr<ArrayCallback> prpCallback)
+void WebCookieManagerProxy::getHostnamesWithCookies(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    RefPtr<ArrayCallback> callback = prpCallback;
+    RefPtr<ArrayCallback> callback = ArrayCallback::create(std::move(callbackFunction));
     uint64_t callbackID = callback->callbackID();
     m_arrayCallbacks.set(callbackID, callback.release());
 
@@ -161,9 +161,9 @@ void WebCookieManagerProxy::setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy pol
     context()->sendToNetworkingProcessRelaunchingIfNecessary(Messages::WebCookieManager::SetHTTPCookieAcceptPolicy(policy));
 }
 
-void WebCookieManagerProxy::getHTTPCookieAcceptPolicy(PassRefPtr<HTTPCookieAcceptPolicyCallback> prpCallback)
+void WebCookieManagerProxy::getHTTPCookieAcceptPolicy(std::function<void (HTTPCookieAcceptPolicy, CallbackBase::Error)> callbackFunction)
 {
-    RefPtr<HTTPCookieAcceptPolicyCallback> callback = prpCallback;
+    RefPtr<HTTPCookieAcceptPolicyCallback> callback = HTTPCookieAcceptPolicyCallback::create(std::move(callbackFunction));
 
     uint64_t callbackID = callback->callbackID();
     m_httpCookieAcceptPolicyCallbacks.set(callbackID, callback.release());
index 796c004..d01402d 100644 (file)
@@ -60,13 +60,13 @@ public:
 
     void initializeClient(const WKCookieManagerClientBase*);
     
-    void getHostnamesWithCookies(PassRefPtr<ArrayCallback>);
+    void getHostnamesWithCookies(std::function<void (API::Array*, CallbackBase::Error)>);
     void deleteCookiesForHostname(const String& hostname);
     void deleteAllCookies();
     void deleteAllCookiesModifiedAfterDate(double);
 
     void setHTTPCookieAcceptPolicy(HTTPCookieAcceptPolicy);
-    void getHTTPCookieAcceptPolicy(PassRefPtr<HTTPCookieAcceptPolicyCallback>);
+    void getHTTPCookieAcceptPolicy(std::function<void (HTTPCookieAcceptPolicy, CallbackBase::Error)>);
 
     void startObservingCookieChanges();
     void stopObservingCookieChanges();
index 98d4646..f57132d 100644 (file)
@@ -152,9 +152,9 @@ void WebDatabaseManagerProxy::derefWebContextSupplement()
     API::Object::deref();
 }
 
-void WebDatabaseManagerProxy::getDatabasesByOrigin(PassRefPtr<ArrayCallback> prpCallback)
+void WebDatabaseManagerProxy::getDatabasesByOrigin(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    RefPtr<ArrayCallback> callback = prpCallback;
+    RefPtr<ArrayCallback> callback = ArrayCallback::create(std::move(callbackFunction));
     uint64_t callbackID = callback->callbackID();
     m_arrayCallbacks.set(callbackID, callback.release());
 
@@ -205,9 +205,9 @@ void WebDatabaseManagerProxy::didGetDatabasesByOrigin(const Vector<OriginAndData
     callback->performCallbackWithReturnValue(API::Array::create(std::move(result)).get());
 }
 
-void WebDatabaseManagerProxy::getDatabaseOrigins(PassRefPtr<ArrayCallback> prpCallback)
+void WebDatabaseManagerProxy::getDatabaseOrigins(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    RefPtr<ArrayCallback> callback = prpCallback;
+    RefPtr<ArrayCallback> callback = ArrayCallback::create(std::move(callbackFunction));
     uint64_t callbackID = callback->callbackID();
     m_arrayCallbacks.set(callbackID, callback.release());
 
index 681630e..df46b0b 100644 (file)
@@ -55,8 +55,8 @@ public:
 
     void initializeClient(const WKDatabaseManagerClientBase*);
 
-    void getDatabasesByOrigin(PassRefPtr<ArrayCallback>);
-    void getDatabaseOrigins(PassRefPtr<ArrayCallback>);
+    void getDatabasesByOrigin(std::function<void (API::Array*, CallbackBase::Error)>);
+    void getDatabaseOrigins(std::function<void (API::Array*, CallbackBase::Error)>);
     void deleteDatabaseWithNameForOrigin(const String& databaseIdentifier, WebSecurityOrigin*);
     void deleteDatabasesForOrigin(WebSecurityOrigin*);
     void deleteAllDatabases();
index ea26db2..59015f1 100644 (file)
@@ -195,34 +195,34 @@ WebFormSubmissionListenerProxy* WebFrameProxy::setUpFormSubmissionListenerProxy(
     return static_cast<WebFormSubmissionListenerProxy*>(m_activeListener.get());
 }
 
-void WebFrameProxy::getWebArchive(PassRefPtr<DataCallback> callback)
+void WebFrameProxy::getWebArchive(std::function<void (API::Data*, CallbackBase::Error)> callbackFunction)
 {
     if (!m_page) {
-        callback->invalidate();
+        callbackFunction(nullptr, CallbackBase::Error::Unknown);
         return;
     }
 
-    m_page->getWebArchiveOfFrame(this, callback);
+    m_page->getWebArchiveOfFrame(this, callbackFunction);
 }
 
-void WebFrameProxy::getMainResourceData(PassRefPtr<DataCallback> callback)
+void WebFrameProxy::getMainResourceData(std::function<void (API::Data*, CallbackBase::Error)> callbackFunction)
 {
     if (!m_page) {
-        callback->invalidate();
+        callbackFunction(nullptr, CallbackBase::Error::Unknown);
         return;
     }
 
-    m_page->getMainResourceDataOfFrame(this, callback);
+    m_page->getMainResourceDataOfFrame(this, callbackFunction);
 }
 
-void WebFrameProxy::getResourceData(API::URL* resourceURL, PassRefPtr<DataCallback> callback)
+void WebFrameProxy::getResourceData(API::URL* resourceURL, std::function<void (API::Data*, CallbackBase::Error)> callbackFunction)
 {
     if (!m_page) {
-        callback->invalidate();
+        callbackFunction(nullptr, CallbackBase::Error::Unknown);
         return;
     }
 
-    m_page->getResourceDataFromFrame(this, resourceURL, callback);
+    m_page->getResourceDataFromFrame(this, resourceURL, callbackFunction);
 }
 
 void WebFrameProxy::setUnreachableURL(const String& unreachableURL)
index de16954..c202ae0 100644 (file)
@@ -95,9 +95,9 @@ public:
     bool isDisplayingMarkupDocument() const;
     bool isDisplayingPDFDocument() const;
 
-    void getWebArchive(PassRefPtr<DataCallback>);
-    void getMainResourceData(PassRefPtr<DataCallback>);
-    void getResourceData(API::URL*, PassRefPtr<DataCallback>);
+    void getWebArchive(std::function<void (API::Data*, CallbackBase::Error)>);
+    void getMainResourceData(std::function<void (API::Data*, CallbackBase::Error)>);
+    void getResourceData(API::URL*, std::function<void (API::Data*, CallbackBase::Error)>);
 
     void didStartProvisionalLoad(const String& url);
     void didReceiveServerRedirectForProvisionalLoad(const String& url);
index b8e32c7..ce6e630 100644 (file)
@@ -99,9 +99,9 @@ static void didGetKeyValueStorageOrigins(const Vector<RefPtr<SecurityOrigin>>& s
     callback->performCallbackWithReturnValue(API::Array::create(std::move(webSecurityOrigins)).get());
 }
 
-void WebKeyValueStorageManager::getKeyValueStorageOrigins(PassRefPtr<ArrayCallback> prpCallback)
+void WebKeyValueStorageManager::getKeyValueStorageOrigins(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    context()->storageManager().getOrigins(RunLoop::main(), prpCallback.leakRef(), didGetKeyValueStorageOrigins);
+    context()->storageManager().getOrigins(RunLoop::main(), ArrayCallback::create(std::move(callbackFunction)).leakRef(), didGetKeyValueStorageOrigins);
 }
 
 static void didGetStorageDetailsByOrigin(const Vector<LocalStorageDetails>& storageDetails, void* context)
@@ -128,9 +128,9 @@ static void didGetStorageDetailsByOrigin(const Vector<LocalStorageDetails>& stor
     callback->performCallbackWithReturnValue(API::Array::create(std::move(result)).get());
 }
 
-void WebKeyValueStorageManager::getStorageDetailsByOrigin(PassRefPtr<ArrayCallback> prpCallback)
+void WebKeyValueStorageManager::getStorageDetailsByOrigin(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    context()->storageManager().getStorageDetailsByOrigin(RunLoop::main(), prpCallback.leakRef(), didGetStorageDetailsByOrigin);
+    context()->storageManager().getStorageDetailsByOrigin(RunLoop::main(), ArrayCallback::create(std::move(callbackFunction)).leakRef(), didGetStorageDetailsByOrigin);
 }
 
 void WebKeyValueStorageManager::deleteEntriesForOrigin(WebSecurityOrigin* origin)
index 8faf211..98e9a54 100644 (file)
@@ -45,8 +45,8 @@ public:
     static PassRefPtr<WebKeyValueStorageManager> create(WebContext*);
     virtual ~WebKeyValueStorageManager();
 
-    void getKeyValueStorageOrigins(PassRefPtr<ArrayCallback>);
-    void getStorageDetailsByOrigin(PassRefPtr<ArrayCallback>);
+    void getKeyValueStorageOrigins(std::function<void (API::Array*, CallbackBase::Error)>);
+    void getStorageDetailsByOrigin(std::function<void (API::Array*, CallbackBase::Error)>);
     void deleteEntriesForOrigin(WebSecurityOrigin*);
     void deleteAllEntries();
 
index 5d3a162..3b3f5ab 100644 (file)
@@ -81,9 +81,9 @@ void WebMediaCacheManagerProxy::derefWebContextSupplement()
     API::Object::deref();
 }
 
-void WebMediaCacheManagerProxy::getHostnamesWithMediaCache(PassRefPtr<ArrayCallback> prpCallback)
+void WebMediaCacheManagerProxy::getHostnamesWithMediaCache(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    RefPtr<ArrayCallback> callback = prpCallback;
+    RefPtr<ArrayCallback> callback = ArrayCallback::create(std::move(callbackFunction));
     uint64_t callbackID = callback->callbackID();
     m_arrayCallbacks.set(callbackID, callback.release());
 
index 7eba053..6d2a043 100644 (file)
@@ -48,7 +48,7 @@ public:
     static PassRefPtr<WebMediaCacheManagerProxy> create(WebContext*);
     virtual ~WebMediaCacheManagerProxy();
     
-    void getHostnamesWithMediaCache(PassRefPtr<ArrayCallback>);
+    void getHostnamesWithMediaCache(std::function<void (API::Array*, CallbackBase::Error)>);
     void clearCacheForHostname(const String&);
     void clearCacheForAllHostnames();
 
index 712dc88..0d52423 100644 (file)
@@ -80,12 +80,14 @@ void WebOriginDataManagerProxy::derefWebContextSupplement()
     API::Object::deref();
 }
 
-void WebOriginDataManagerProxy::getOrigins(WKOriginDataTypes types, PassRefPtr<ArrayCallback> prpCallback)
+void WebOriginDataManagerProxy::getOrigins(WKOriginDataTypes types, std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    if (!context())
-        return;
+    RefPtr<ArrayCallback> callback = ArrayCallback::create(std::move(callbackFunction));
 
-    RefPtr<ArrayCallback> callback = prpCallback;
+    if (!context()) {
+        callback->invalidate();
+        return;
+    }
 
     uint64_t callbackID = callback->callbackID();
     m_arrayCallbacks.set(callbackID, callback.release());
index 9719a21..6db45d6 100644 (file)
@@ -54,7 +54,7 @@ public:
     static PassRefPtr<WebOriginDataManagerProxy> create(WebContext*);
     virtual ~WebOriginDataManagerProxy();
 
-    void getOrigins(WKOriginDataTypes, PassRefPtr<ArrayCallback>);
+    void getOrigins(WKOriginDataTypes, std::function<void (API::Array*, CallbackBase::Error)>);
     void deleteEntriesForOrigin(WKOriginDataTypes, WebSecurityOrigin*);
     void deleteAllEntries(WKOriginDataTypes);
 
index 6fb5fed..a668111 100644 (file)
@@ -2292,9 +2292,9 @@ void WebPageProxy::getSelectionAsWebArchiveData(PassRefPtr<DataCallback> prpCall
     m_process->send(Messages::WebPage::GetSelectionAsWebArchiveData(callbackID), m_pageID);
 }
 
-void WebPageProxy::getMainResourceDataOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
+void WebPageProxy::getMainResourceDataOfFrame(WebFrameProxy* frame, std::function<void (API::Data*, CallbackBase::Error)> callbackFunction)
 {
-    RefPtr<DataCallback> callback = prpCallback;
+    RefPtr<DataCallback> callback = DataCallback::create(std::move(callbackFunction));
     if (!isValid()) {
         callback->invalidate();
         return;
@@ -2305,9 +2305,9 @@ void WebPageProxy::getMainResourceDataOfFrame(WebFrameProxy* frame, PassRefPtr<D
     m_process->send(Messages::WebPage::GetMainResourceDataOfFrame(frame->frameID(), callbackID), m_pageID);
 }
 
-void WebPageProxy::getResourceDataFromFrame(WebFrameProxy* frame, API::URL* resourceURL, PassRefPtr<DataCallback> prpCallback)
+void WebPageProxy::getResourceDataFromFrame(WebFrameProxy* frame, API::URL* resourceURL, std::function<void (API::Data*, CallbackBase::Error)> callbackFunction)
 {
-    RefPtr<DataCallback> callback = prpCallback;
+    RefPtr<DataCallback> callback = DataCallback::create(std::move(callbackFunction));
     if (!isValid()) {
         callback->invalidate();
         return;
@@ -2318,9 +2318,9 @@ void WebPageProxy::getResourceDataFromFrame(WebFrameProxy* frame, API::URL* reso
     m_process->send(Messages::WebPage::GetResourceDataFromFrame(frame->frameID(), resourceURL->string(), callbackID), m_pageID);
 }
 
-void WebPageProxy::getWebArchiveOfFrame(WebFrameProxy* frame, PassRefPtr<DataCallback> prpCallback)
+void WebPageProxy::getWebArchiveOfFrame(WebFrameProxy* frame, std::function<void (API::Data*, CallbackBase::Error)> callbackFunction)
 {
-    RefPtr<DataCallback> callback = prpCallback;
+    RefPtr<DataCallback> callback = DataCallback::create(std::move(callbackFunction));
     if (!isValid()) {
         callback->invalidate();
         return;
index 332f5f4..7b675b8 100644 (file)
@@ -397,9 +397,9 @@ public:
     int32_t deviceOrientation() const { return m_deviceOrientation; }
     void didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&);
 
-    void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, PassRefPtr<GestureCallback>);
+    void selectWithGesture(const WebCore::IntPoint, WebCore::TextGranularity, uint32_t gestureType, uint32_t gestureState, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>);
     void updateSelectionWithTouches(const WebCore::IntPoint, uint32_t touches, bool baseIsStart, PassRefPtr<TouchesCallback>);
-    void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, PassRefPtr<GestureCallback>);
+    void selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)>);
     void updateBlockSelectionWithTouch(const WebCore::IntPoint, uint32_t touch, uint32_t handlePosition);
     void extendSelection(WebCore::TextGranularity);
     void selectWordBackward();
@@ -480,7 +480,7 @@ public:
 
 #if PLATFORM(MAC)
     void insertDictatedTextAsync(const String& text, const EditingRange& replacementRange, const Vector<WebCore::TextAlternativeWithRange>& dictationAlternatives);
-    void attributedSubstringForCharacterRangeAsync(const EditingRange&, PassRefPtr<AttributedStringForCharacterRangeCallback>);
+    void attributedSubstringForCharacterRangeAsync(const EditingRange&, std::function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)>);
 
 #if !USE(ASYNC_NSTEXTINPUTCLIENT)
     bool insertText(const String& text, const EditingRange& replacementRange);
@@ -657,13 +657,13 @@ public:
 #if ENABLE(MHTML)
     void getContentsAsMHTMLData(PassRefPtr<DataCallback>, bool useBinaryEncoding);
 #endif
-    void getMainResourceDataOfFrame(WebFrameProxy*, PassRefPtr<DataCallback>);
-    void getResourceDataFromFrame(WebFrameProxy*, API::URL*, PassRefPtr<DataCallback>);
+    void getMainResourceDataOfFrame(WebFrameProxy*, std::function<void (API::Data*, CallbackBase::Error)>);
+    void getResourceDataFromFrame(WebFrameProxy*, API::URL*, std::function<void (API::Data*, CallbackBase::Error)>);
     void getRenderTreeExternalRepresentation(PassRefPtr<StringCallback>);
     void getSelectionOrContentsAsString(PassRefPtr<StringCallback>);
     void getSelectionAsWebArchiveData(PassRefPtr<DataCallback>);
     void getSourceForFrame(WebFrameProxy*, PassRefPtr<StringCallback>);
-    void getWebArchiveOfFrame(WebFrameProxy*, PassRefPtr<DataCallback>);
+    void getWebArchiveOfFrame(WebFrameProxy*, std::function<void (API::Data*, CallbackBase::Error)>);
     void runJavaScriptInMainFrame(const String&, PassRefPtr<ScriptValueCallback>);
     void forceRepaint(PassRefPtr<VoidCallback>);
 
index 9c7d218..966b718 100644 (file)
@@ -88,9 +88,9 @@ void WebResourceCacheManagerProxy::derefWebContextSupplement()
     API::Object::deref();
 }
 
-void WebResourceCacheManagerProxy::getCacheOrigins(PassRefPtr<ArrayCallback> prpCallback)
+void WebResourceCacheManagerProxy::getCacheOrigins(std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
 {
-    RefPtr<ArrayCallback> callback = prpCallback;
+    RefPtr<ArrayCallback> callback = ArrayCallback::create(std::move(callbackFunction));
     uint64_t callbackID = callback->callbackID();
     m_arrayCallbacks.set(callbackID, callback.release());
 
index fa4335d..673bba4 100644 (file)
@@ -51,7 +51,7 @@ public:
     static PassRefPtr<WebResourceCacheManagerProxy> create(WebContext*);
     virtual ~WebResourceCacheManagerProxy();
 
-    void getCacheOrigins(PassRefPtr<ArrayCallback>);
+    void getCacheOrigins(std::function<void (API::Array*, CallbackBase::Error)>);
     void clearCacheForOrigin(WebSecurityOrigin*, ResourceCachesToClear);
     void clearCacheForAllOrigins(ResourceCachesToClear);
 
index 77f9502..c3b9179 100644 (file)
@@ -1429,11 +1429,11 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
 - (void)changeSelectionWithGestureAt:(CGPoint)point withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)state
 {
     _usingGestureForSelection = YES;
-    _page->selectWithGesture(WebCore::IntPoint(point), CharacterGranularity, static_cast<uint32_t>(toGestureType(gestureType)), static_cast<uint32_t>(toGestureRecognizerState(state)), GestureCallback::create([self, state](const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackBase::Error error) {
+    _page->selectWithGesture(WebCore::IntPoint(point), CharacterGranularity, static_cast<uint32_t>(toGestureType(gestureType)), static_cast<uint32_t>(toGestureRecognizerState(state)), [self, state](const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackBase::Error error) {
         selectionChangedWithGesture(self, point, gestureType, gestureState, flags, error);
         if (state == UIGestureRecognizerStateEnded || state == UIGestureRecognizerStateCancelled)
             _usingGestureForSelection = NO;
-    }));
+    });
 }
 
 - (void)changeSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch baseIsStart:(BOOL)baseIsStart
@@ -1449,11 +1449,11 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
 - (void)changeSelectionWithTouchesFrom:(CGPoint)from to:(CGPoint)to withGesture:(UIWKGestureType)gestureType withState:(UIGestureRecognizerState)gestureState
 {
     _usingGestureForSelection = YES;
-    _page->selectWithTwoTouches(WebCore::IntPoint(from), WebCore::IntPoint(to), static_cast<uint32_t>(toGestureType(gestureType)), static_cast<uint32_t>(toGestureRecognizerState(gestureState)), GestureCallback::create([self, gestureState](const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackBase::Error error) {
+    _page->selectWithTwoTouches(WebCore::IntPoint(from), WebCore::IntPoint(to), static_cast<uint32_t>(toGestureType(gestureType)), static_cast<uint32_t>(toGestureRecognizerState(gestureState)), [self, gestureState](const WebCore::IntPoint& point, uint32_t gestureType, uint32_t gestureState, uint32_t flags, CallbackBase::Error error) {
         selectionChangedWithGesture(self, point, gestureType, gestureState, flags, error);
         if (gestureState == UIGestureRecognizerStateEnded || gestureState == UIGestureRecognizerStateCancelled)
             _usingGestureForSelection = NO;
-    }));
+    });
 }
 
 - (void)changeBlockSelectionWithTouchAt:(CGPoint)point withSelectionTouch:(UIWKSelectionTouch)touch forHandle:(UIWKHandlePosition)handle
index bf8cae7..6c09211 100644 (file)
@@ -303,8 +303,10 @@ void WebPageProxy::didCommitLayerTree(const WebKit::RemoteLayerTreeTransaction&
     m_pageClient.didCommitLayerTree(layerTreeTransaction);
 }
 
-void WebPageProxy::selectWithGesture(const WebCore::IntPoint point, WebCore::TextGranularity granularity, uint32_t gestureType, uint32_t gestureState, PassRefPtr<GestureCallback> callback)
+void WebPageProxy::selectWithGesture(const WebCore::IntPoint point, WebCore::TextGranularity granularity, uint32_t gestureType, uint32_t gestureState, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)> callbackFunction)
 {
+    RefPtr<GestureCallback> callback = GestureCallback::create(std::move(callbackFunction));
+
     if (!isValid()) {
         callback->invalidate();
         return;
@@ -397,8 +399,10 @@ void WebPageProxy::getAutocorrectionContext(String& beforeContext, String& marke
     m_process->sendSync(Messages::WebPage::GetAutocorrectionContext(), Messages::WebPage::GetAutocorrectionContext::Reply(beforeContext, markedText, selectedText, afterContext, location, length), m_pageID);
 }
 
-void WebPageProxy::selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, PassRefPtr<GestureCallback> callback)
+void WebPageProxy::selectWithTwoTouches(const WebCore::IntPoint from, const WebCore::IntPoint to, uint32_t gestureType, uint32_t gestureState, std::function<void (const WebCore::IntPoint&, uint32_t, uint32_t, uint32_t, CallbackBase::Error)> callbackFunction)
 {
+    RefPtr<GestureCallback> callback = GestureCallback::create(std::move(callbackFunction));
+
     if (!isValid()) {
         callback->invalidate();
         return;
index a5fedfe..fefef3f 100644 (file)
@@ -325,8 +325,10 @@ void WebPageProxy::insertDictatedTextAsync(const String& text, const EditingRang
 #endif
 }
 
-void WebPageProxy::attributedSubstringForCharacterRangeAsync(const EditingRange& range, PassRefPtr<AttributedStringForCharacterRangeCallback> callback)
+void WebPageProxy::attributedSubstringForCharacterRangeAsync(const EditingRange& range, std::function<void (const AttributedString&, const EditingRange&, CallbackBase::Error)> callbackFunction)
 {
+    RefPtr<AttributedStringForCharacterRangeCallback> callback = AttributedStringForCharacterRangeCallback::create(std::move(callbackFunction));
+
     if (!isValid()) {
         callback->invalidate();
         return;