[WPE] webkit_web_view_new() should enable specifying wpe_view_backend object
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Nov 2017 08:16:26 +0000 (08:16 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Nov 2017 08:16:26 +0000 (08:16 +0000)
commitdc8d29ce523a9c7b524b09cb1bd084935b1c71e6
tree2bb09349ed6a824ebb989e4d61c05d3505f8af23
parent194bce173385b94298a9f9dd28cd1674398f8706
[WPE] webkit_web_view_new() should enable specifying wpe_view_backend object
https://bugs.webkit.org/show_bug.cgi?id=178655

Reviewed by Michael Catanzaro.

Source/WebKit:

Update all WebKitWebView constructors to receive a WebKitWebViewBackend as argument. It's now required to
provide a backend to create a web view, but it can be NULL to use the default one. WebKitWebViewBackend is a
boxed type wrapping a struct wpe_view_backend* used as construct only property of WebKitWebView. The view always
takes the ownership of the WebKitWebViewBackend which owns the struct wpe_view_backend*. An optional
GDestroyNotify and user data pointer can be passed to the WebKitWebViewBackend constructor to provide a custom
deleter for the backend. In the C API the struct wpe_view_backend* is also mandatory now, but it can't be NULL
and it's owned by the caller, not the view.

* PlatformWPE.cmake:
* UIProcess/API/C/wpe/WKView.cpp:
(WKViewCreate):
* UIProcess/API/C/wpe/WKView.h:
* UIProcess/API/glib/WebKitWebView.cpp:
(_WebKitWebViewPrivate::~_WebKitWebViewPrivate):
(webkitWebViewConstructed):
(webkitWebViewSetProperty):
(webkitWebViewGetProperty):
(webkit_web_view_class_init):
(webkitWebViewCreatePage):
(webkit_web_view_get_backend):
* UIProcess/API/wpe/WPEView.cpp:
(WKWPE::m_backend):
(WKWPE::View::~View):
* UIProcess/API/wpe/WebKitWebView.h:
* UIProcess/API/wpe/WebKitWebViewBackend.cpp: Added.
(_WebKitWebViewBackend::_WebKitWebViewBackend):
(_WebKitWebViewBackend::~_WebKitWebViewBackend):
(webkitWebViewBackendRef):
(webkitWebViewBackendUnref):
(webkitWebViewBackendCreateDefault):
(webkit_web_view_backend_new):
(webkit_web_view_backend_get_wpe_backend):
* UIProcess/API/wpe/WebKitWebViewBackend.h: Added.
* UIProcess/API/wpe/WebKitWebViewBackendPrivate.h: Added.
* UIProcess/API/wpe/WebKitWebViewWPE.cpp:
(webkit_web_view_new):
(webkit_web_view_new_with_context):
(webkit_web_view_new_with_related_view):
(webkit_web_view_new_with_settings):
(webkit_web_view_new_with_user_content_manager):
* UIProcess/API/wpe/webkit.h:

Tools:

Update unit tests to create web views using helper methods that have a different implementation for GTK and
WPE. Also add a new test case to check the new API to create a WebKitWebView with a WPE backend. Use
WKViewCreate in WTR and fix a memory leak in HeadlessViewBackend.

* TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp:
(testAutomationSessionRequestSession):
* TestWebKitAPI/Tests/WebKitGLib/TestBackForwardList.cpp:
(testWebKitWebViewSessionState):
(testWebKitWebViewSessionStateWithFormData):
(testWebKitWebViewNavigationAfterSessionRestore):
* TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp:
* TestWebKitAPI/Tests/WebKitGLib/TestResources.cpp:
(testWebResourceGetDataError):
* TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp:
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp:
(testWebViewNewWithUserContentManager):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp:
(testWebContextEphemeral):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp:
(testWebViewWebContext):
(testWebViewWebContextLifetime):
(testWebViewWebBackend):
(testWebViewSettings):
(beforeAll):
* TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp:
(testWebsiteDataEphemeral):
* TestWebKitAPI/glib/WebKitGLib/TestMain.h:
(Test::createWebView):
* WebKitTestRunner/wpe/HeadlessViewBackend.cpp:
(HeadlessViewBackend::~HeadlessViewBackend):
* WebKitTestRunner/wpe/PlatformWebViewWPE.cpp:
(WTR::PlatformWebView::PlatformWebView):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225044 268f45cc-cd09-0410-ab3c-d52691b4dbfc
25 files changed:
Source/WebKit/ChangeLog
Source/WebKit/PlatformWPE.cmake
Source/WebKit/UIProcess/API/C/wpe/WKView.cpp
Source/WebKit/UIProcess/API/C/wpe/WKView.h
Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp
Source/WebKit/UIProcess/API/wpe/WPEView.cpp
Source/WebKit/UIProcess/API/wpe/WebKitWebView.h
Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.cpp [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackend.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/WebKitWebViewBackendPrivate.h [new file with mode: 0644]
Source/WebKit/UIProcess/API/wpe/WebKitWebViewWPE.cpp
Source/WebKit/UIProcess/API/wpe/webkit.h
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitGLib/TestAutomationSession.cpp
Tools/TestWebKitAPI/Tests/WebKitGLib/TestBackForwardList.cpp
Tools/TestWebKitAPI/Tests/WebKitGLib/TestMultiprocess.cpp
Tools/TestWebKitAPI/Tests/WebKitGLib/TestResources.cpp
Tools/TestWebKitAPI/Tests/WebKitGLib/TestUIClient.cpp
Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitUserContentManager.cpp
Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp
Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp
Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebsiteData.cpp
Tools/TestWebKitAPI/glib/WebKitGLib/TestMain.h
Tools/WebKitTestRunner/wpe/HeadlessViewBackend.cpp
Tools/WebKitTestRunner/wpe/PlatformWebViewWPE.cpp