[GTK] Move RedirectedXCompositeWindow from platform to WebKit2 layer
https://bugs.webkit.org/show_bug.cgi?id=138093

Reviewed by Martin Robinson.

Source/WebCore:

Remove RedirectedXCompositeWindow.

* PlatformGTK.cmake:

Source/WebKit2:

It's only used by WebKitWebViewBase. While moving the code the
following cleanups have been made:

  - Use NeverDestroyed instead of DEPRECATED_DEFINE_STATIC_LOCAL.
  - Use a helper class XDamageNotifier to handle the XDamage
    events filtering and notification.
  - Use std::function instead of pointer to function for the
    damage callback.
  - Pass the X display to the RedirectedXCompositeWindow constructor
    and keep it as a member to use it everywhere, instead of using
    the default display in some places and the widget display in others.
  - Pass the damage notify function as a contructor parameter of
    RedirectedXCompositeWindow instead of setting the callback
    right after creating the object.
  - Remove GLContextNeeded and all the dead code related to the
    CreateGLContext mode that is no longer used.
  - Rename cairoSurfaceForWidget() as surface().
  - windowId() has been renamed as windowID() and made const.
  - Use std::unique_ptr instead of PassOwnPtr.
  - Fix coding style issues.

* PlatformGTK.cmake:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseConstructed):
(webkitWebViewRenderAcceleratedCompositingResults):
(webkitWebViewBaseCreateWebPage):
(redirectedWindowDamagedCallback): Deleted.
* UIProcess/gtk/RedirectedXCompositeWindow.cpp: Renamed from Source/WebCore/platform/gtk/RedirectedXCompositeWindow.cpp.
(WebKit::XDamageNotifier::XDamageNotifier):
(WebKit::XDamageNotifier::add):
(WebKit::XDamageNotifier::remove):
(WebKit::XDamageNotifier::filterXDamageEvent):
(WebKit::XDamageNotifier::filterXEvent):
(WebKit::xDamageNotifier):
(WebKit::supportsXDamageAndXComposite):
(WebKit::RedirectedXCompositeWindow::create):
(WebKit::RedirectedXCompositeWindow::RedirectedXCompositeWindow):
(WebKit::RedirectedXCompositeWindow::~RedirectedXCompositeWindow):
(WebKit::RedirectedXCompositeWindow::resize):
(WebKit::RedirectedXCompositeWindow::cleanupPixmapAndPixmapSurface):
(WebKit::RedirectedXCompositeWindow::surface):
* UIProcess/gtk/RedirectedXCompositeWindow.h: Renamed from Source/WebCore/platform/gtk/RedirectedXCompositeWindow.h.
(WebKit::RedirectedXCompositeWindow::windowID):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176016 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Fix how SerializedScriptValue is exposed to GObject DOM bindings
https://bugs.webkit.org/show_bug.cgi?id=138409

Reviewed by Philippe Normand.

It's currently exposed as a WebKitDOMSerializedScriptValue class
that doesn't really exist. It should be handled as a string, that
is used to create a SerializedScriptValue when coming from the
API, and converted to a string again when returned to the API.

* bindings/scripts/CodeGeneratorGObject.pm:
(GetGlibTypeName): Return gchar* as glib type of SerializedScriptValue.
(IsGDOMClassType): Don't consider SerializedScriptValue as a GDOM class.
(GenerateFunction): Handle SerializedScriptValue parameters and
return values specially.
* bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
(webkit_dom_test_callback_callback_with_serialized_script_value_param):
* bindings/scripts/test/GObject/WebKitDOMTestCallback.h:
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_serialized_value):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
(webkit_dom_test_serialized_script_value_interface_class_init):
(webkit_dom_test_serialized_script_value_interface_get_value):
(webkit_dom_test_serialized_script_value_interface_set_value):
(webkit_dom_test_serialized_script_value_interface_get_readonly_value):
(webkit_dom_test_serialized_script_value_interface_get_cached_value):
(webkit_dom_test_serialized_script_value_interface_set_cached_value):
(webkit_dom_test_serialized_script_value_interface_get_cached_readonly_value):
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h:
* bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp:
(webkit_dom_test_typedefs_class_init):
(webkit_dom_test_typedefs_get_immutable_serialized_script_value):
(webkit_dom_test_typedefs_set_immutable_serialized_script_value):
* bindings/scripts/test/GObject/WebKitDOMTestTypedefs.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Expose user script messages to GObject DOM bindings
https://bugs.webkit.org/show_bug.cgi?id=138411

Reviewed by Philippe Normand.

Source/WebCore:

* PlatformGTK.cmake: Add WebKitDOMCustomUnstable.h to the list of
installed headers and make a symlink for it in the DerivedSources dir.
* bindings/gobject/WebKitDOMCustomUnstable.h: Added.
* bindings/gobject/WebKitDOMCustom.cpp:
(webkit_dom_dom_window_get_webkit_namespace):
(webkit_dom_user_message_handlers_namespace_get_handler):
* bindings/scripts/CodeGeneratorGObject.pm:
(HasUnstableCustomAPI): Helper function to check if the given
class has custom unstable API.
(WriteData): Include WebKitDOMCustomUnstable.h header if the class
has API defined there.

Tools:

Add a test case to check that user script messages sent using the
DOM bindings API are also received in the UI process.

* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitUserContentManager.cpp:
(UserScriptMessageTest::waitUntilMessageReceived):
(UserScriptMessageTest::postMessageAndWaitUntilReceived):
(testUserContentManagerScriptMessageFromDOMBindings):
(beforeAll):
* TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
(documentLoadedCallback):

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