Fix for https://bugs.webkit.org/show_bug.cgi?id=38471
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 May 2010 17:28:17 +0000 (17:28 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 May 2010 17:28:17 +0000 (17:28 +0000)
commit3e68877e75e687b8026ace041ca7f841458d6b67
treedf34bdf4c0b6dd456d34c2c7c7d2d64a0bbe2e63
parent54eb952a4c215874aabb3aa20632320bdd7e73bc
Fix for https://bugs.webkit.org/show_bug.cgi?id=38471
Add generic callback mechanism

Reviewed by Anders Carlsson.

Added GenericCallback class replacing RenderTreeExternalRepresentationCallback
and ScriptReturnValueCallback.

Also,
- Standardize C API callbacks to take the context last.
- Standardize C API callbacks to not have the _f suffix (now the block
  variants have a _b suffix).
- Re-write toWK and toRef methods as a set of template functions using
  the generic API->implementation mapping information.

* UIProcess/API/C/WKAPICast.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageRunJavaScriptInMainFrame):
(callRunJavaScriptBlockAndRelease):
(disposeRunJavaScriptBlock):
(WKPageRunJavaScriptInMainFrame_b):
(WKPageRenderTreeExternalRepresentation):
(WKPageRenderTreeExternalRepresentation_b):
* UIProcess/API/C/WKPage.h:
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/GenericCallback.h: Added.
(WebKit::GenericCallback::create):
(WebKit::GenericCallback::~GenericCallback):
(WebKit::GenericCallback::performCallbackWithReturnValue):
(WebKit::GenericCallback::invalidate):
(WebKit::GenericCallback::callbackID):
(WebKit::GenericCallback::generateCallbackID):
(WebKit::GenericCallback::GenericCallback):
* UIProcess/RenderTreeExternalRepresentationCallback.cpp: Removed.
* UIProcess/RenderTreeExternalRepresentationCallback.h: Removed.
* UIProcess/ScriptReturnValueCallback.cpp: Removed.
* UIProcess/ScriptReturnValueCallback.h: Removed.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didRunJavaScriptInMainFrame):
(WebKit::WebPageProxy::didGetRenderTreeExternalRepresentation):
* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58684 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
WebKit2/ChangeLog
WebKit2/UIProcess/API/C/WKAPICast.h
WebKit2/UIProcess/API/C/WKPage.cpp
WebKit2/UIProcess/API/C/WKPage.h
WebKit2/UIProcess/API/C/WKPagePrivate.h
WebKit2/UIProcess/GenericCallback.h [moved from WebKit2/UIProcess/ScriptReturnValueCallback.h with 50% similarity]
WebKit2/UIProcess/RenderTreeExternalRepresentationCallback.cpp [deleted file]
WebKit2/UIProcess/RenderTreeExternalRepresentationCallback.h [deleted file]
WebKit2/UIProcess/ScriptReturnValueCallback.cpp [deleted file]
WebKit2/UIProcess/WebPageProxy.cpp
WebKit2/UIProcess/WebPageProxy.h
WebKit2/WebKit2.xcodeproj/project.pbxproj
WebKit2/win/WebKit2.vcproj