-
weinig@apple.com authored
Add callback based API to get the textual representation of the RenderTree. Reviewed by Anders Carlsson. - Also ensures that any pending callbacks are invalidated if the WebPage closes (expectedly or unexpectedly). - A follow up patch will unify the callback mechanism with a common base class. * Shared/CoreIPCSupport/WebPageMessageKinds.h: (WebPageMessage::): * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h: (WebPageProxyMessage::): * UIProcess/API/C/WKPage.cpp: (WKPageRunJavaScriptInMainFrame_f): (WKPageRenderTreeExternalRepresentation_f): (callRenderTreeExternalRepresentationBlockAndDispose): (disposeRenderTreeExternalRepresentationBlock): (WKPageRenderTreeExternalRepresentation): * UIProcess/API/C/WKPagePrivate.h: Added. * UIProcess/RenderTreeExternalRepresentationCallback.cpp: Added. (WebKit::generateCallbackID): (WebKit::RenderTreeExternalRepresentationCallback::RenderTreeExternalRepresentationCallback): (WebKit::RenderTreeExternalRepresentationCallback::~RenderTreeExternalRepresentationCallback): (WebKit::RenderTreeExternalRepresentationCallback::performCallbackWithReturnValue): (WebKit::RenderTreeExternalRepresentationCallback::invalidate): * UIProcess/RenderTreeExternalRepresentationCallback.h: Added. (WebKit::RenderTreeExternalRepresentationCallback::create): (WebKit::RenderTreeExternalRepresentationCallback::callbackID): * UIProcess/ScriptReturnValueCallback.cpp: (WebKit::ScriptReturnValueCallback::~ScriptReturnValueCallback): (WebKit::ScriptReturnValueCallback::performCallbackWithReturnValue): (WebKit::ScriptReturnValueCallback::invalidate): * UIProcess/ScriptReturnValueCallback.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::close): (WebKit::WebPageProxy::getRenderTreeExternalRepresentation): (WebKit::WebPageProxy::didReceiveMessage): (WebKit::WebPageProxy::didRunJavaScriptInMainFrame): (WebKit::WebPageProxy::didGetRenderTreeExternalRepresentation): (WebKit::WebPageProxy::processDidExit): * UIProcess/WebPageProxy.h: * WebKit2.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::getRenderTreeExternalRepresentation): (WebKit::WebPage::didReceiveMessage): * WebProcess/WebPage/WebPage.h: * win/WebKit2.vcproj: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@58624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
60495919