Skip to content

Commit

Permalink
Merge r187432 - [GTK] Pass a GstInstallPluginsContext to gst_install_…
Browse files Browse the repository at this point in the history
…plugins_async

https://bugs.webkit.org/show_bug.cgi?id=147103

Reviewed by Philippe Normand.

Source/WebCore:

* platform/graphics/gstreamer/GUniquePtrGStreamer.h: Allow to use
GUniquePtr with GstInstallPluginsContext.

Source/WebKit2:

This allows PackageKit to properly position the window and make it
transient to the web view window.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::setCursor): Disambiguate Cursor now that
we include gtkx.h.
(WebKit::PageClientImpl::createGstInstallPluginsContext): Create a
new GstInstallPluginsContext and set the web view window XID when
running on X11.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/efl/WebViewEfl.h:
* UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
(WebKit::WebPageProxy::requestInstallMissingMediaPlugins): Use
PageClient::createGstInstallPluginsContext() to create a new
GstInstallPluginsContext and pass it to gst_install_plugins_async().
  • Loading branch information
carlosgcampos committed Aug 5, 2015
1 parent 75f7d88 commit b3cc6bb
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 4 deletions.
10 changes: 10 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,13 @@
2015-07-27 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] Pass a GstInstallPluginsContext to gst_install_plugins_async
https://bugs.webkit.org/show_bug.cgi?id=147103

Reviewed by Philippe Normand.

* platform/graphics/gstreamer/GUniquePtrGStreamer.h: Allow to use
GUniquePtr with GstInstallPluginsContext.

2015-07-24 Carlos Garcia Campos <cgarcia@igalia.com>

[GStreamer] Crashes during plugin installation
Expand Down
Expand Up @@ -22,11 +22,13 @@
#if USE(GSTREAMER)

#include <gst/gststructure.h>
#include <gst/pbutils/install-plugins.h>
#include <wtf/gobject/GUniquePtr.h>

namespace WTF {

WTF_DEFINE_GPTR_DELETER(GstStructure, gst_structure_free)
WTF_DEFINE_GPTR_DELETER(GstInstallPluginsContext, gst_install_plugins_context_free)

}

Expand Down
24 changes: 24 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,27 @@
2015-07-27 Carlos Garcia Campos <cgarcia@igalia.com>

[GTK] Pass a GstInstallPluginsContext to gst_install_plugins_async
https://bugs.webkit.org/show_bug.cgi?id=147103

Reviewed by Philippe Normand.

This allows PackageKit to properly position the window and make it
transient to the web view window.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::setCursor): Disambiguate Cursor now that
we include gtkx.h.
(WebKit::PageClientImpl::createGstInstallPluginsContext): Create a
new GstInstallPluginsContext and set the web view window XID when
running on X11.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/efl/WebViewEfl.h:
* UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
(WebKit::WebPageProxy::requestInstallMissingMediaPlugins): Use
PageClient::createGstInstallPluginsContext() to create a new
GstInstallPluginsContext and pass it to gst_install_plugins_async().

2015-07-24 Anders Carlsson <andersca@apple.com>

Networking process crash in NetworkConnectionToWebProcess::convertMainResourceLoadToDownload while attempting to download a blob
Expand Down
22 changes: 21 additions & 1 deletion Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
Expand Up @@ -47,6 +47,11 @@
#include <wtf/text/CString.h>
#include <wtf/text/WTFString.h>

#if PLATFORM(X11)
#include <gdk/gdkx.h>
#undef KeyPress
#endif

using namespace WebCore;

namespace WebKit {
Expand Down Expand Up @@ -132,7 +137,7 @@ void PageClientImpl::toolTipChanged(const String&, const String& newToolTip)
webkitWebViewBaseSetTooltipText(WEBKIT_WEB_VIEW_BASE(m_viewWidget), newToolTip.utf8().data());
}

void PageClientImpl::setCursor(const Cursor& cursor)
void PageClientImpl::setCursor(const WebCore::Cursor& cursor)
{
if (!gtk_widget_get_realized(m_viewWidget))
return;
Expand Down Expand Up @@ -427,4 +432,19 @@ void PageClientImpl::didSameDocumentNavigationForMainFrame(SameDocumentNavigatio
{
}

#if ENABLE(VIDEO)
GUniquePtr<GstInstallPluginsContext> PageClientImpl::createGstInstallPluginsContext()
{
#if PLATFORM(X11)
if (GDK_IS_X11_DISPLAY(gdk_display_manager_get_default_display(gdk_display_manager_get()))) {
GUniquePtr<GstInstallPluginsContext> context(gst_install_plugins_context_new());
gst_install_plugins_context_set_xid(context.get(), GDK_WINDOW_XID(gtk_widget_get_window(m_viewWidget)));
return context;
}
#endif

return nullptr;
}
#endif

} // namespace WebKit
4 changes: 4 additions & 0 deletions Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
Expand Up @@ -136,6 +136,10 @@ class PageClientImpl : public PageClient

virtual void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled) override;

#if ENABLE(VIDEO)
virtual GUniquePtr<GstInstallPluginsContext> createGstInstallPluginsContext() override;
#endif

// Members of PageClientImpl class
GtkWidget* m_viewWidget;
DefaultUndoController m_undoController;
Expand Down
8 changes: 8 additions & 0 deletions Source/WebKit2/UIProcess/PageClient.h
Expand Up @@ -34,6 +34,10 @@
#include <WebCore/EditorClient.h>
#include <wtf/Forward.h>

#if ENABLE(VIDEO) && USE(GSTREAMER)
#include <WebCore/GUniquePtrGStreamer.h>
#endif

#if PLATFORM(COCOA)
#include "PluginComplexTextInputState.h"

Expand Down Expand Up @@ -315,6 +319,10 @@ class PageClient {
#if PLATFORM(MAC)
virtual void didPerformActionMenuHitTest(const ActionMenuHitTestResult&, bool forImmediateAction, API::Object*) = 0;
#endif

#if ENABLE(VIDEO) && USE(GSTREAMER)
virtual GUniquePtr<GstInstallPluginsContext> createGstInstallPluginsContext() = 0;
#endif
};

} // namespace WebKit
Expand Down
6 changes: 3 additions & 3 deletions Source/WebKit2/UIProcess/gstreamer/WebPageProxyGStreamer.cpp
Expand Up @@ -28,8 +28,8 @@

#if ENABLE(VIDEO) && USE(GSTREAMER)

#include "PageClient.h"
#include "WebPageMessages.h"
#include <gst/pbutils/install-plugins.h>

namespace WebKit {

Expand All @@ -38,8 +38,8 @@ void WebPageProxy::requestInstallMissingMediaPlugins(const String& details)
CString detail = details.utf8();
const char* detailArray[2] = { detail.data(), nullptr };
ref();
// FIXME: Use a proper GstInstallPluginsContext instead of nullptr.
GstInstallPluginsReturn result = gst_install_plugins_async(detailArray, nullptr, [](GstInstallPluginsReturn result, gpointer userData) {
GUniquePtr<GstInstallPluginsContext> context = m_pageClient.createGstInstallPluginsContext();
GstInstallPluginsReturn result = gst_install_plugins_async(detailArray, context.get(), [](GstInstallPluginsReturn result, gpointer userData) {
RefPtr<WebPageProxy> page = adoptRef(static_cast<WebPageProxy*>(userData));
if (page->isValid())
page->send(Messages::WebPage::DidEndRequestInstallMissingMediaPlugins(static_cast<uint32_t>(result)));
Expand Down

0 comments on commit b3cc6bb

Please sign in to comment.