Changeset 285000 in webkit
- Timestamp:
- Oct 28, 2021, 1:57:59 PM (4 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r284997 r285000 1 2021-10-28 Adrian Perez de Castro <aperez@igalia.com> 2 3 [WPE][Qt] Do not use WebKit internals in the implementation 4 https://bugs.webkit.org/show_bug.cgi?id=232228 5 6 Reviewed by Philippe Normand. 7 8 Remove usage of GRefPtr, GUniquePtr, WTF macros, and usage of the config.h header from 9 the WPE Qt API implementation, as all the funcionality can be achieved on top of the 10 public API. This allows building the Qt plug-in in a standalone fashion, without involving 11 any of the WebKit machinery, and a sample CMakeLists.txt which does that is provided as 12 well. Distributors may prefer to build using this approach instead of as part of the whole 13 WebKit compilation process, specially if when providing split packages on top of their 14 base WPE WebKit ones. 15 16 No new tests needed. 17 18 * UIProcess/API/wpe/qt/CMakeLists.txt: Added. 19 * UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.cpp: 20 * UIProcess/API/wpe/qt/WPEQtView.cpp: 21 (WPEQtView::createWebView): 22 (jsAsyncReadyCallback): 23 * UIProcess/API/wpe/qt/WPEQtView.h: 24 * UIProcess/API/wpe/qt/WPEQtViewBackend.cpp: 25 (WPEQtViewBackend::displayImage): 26 * UIProcess/API/wpe/qt/WPEQtViewLoadRequest.cpp: 27 1 28 2021-10-28 Wenson Hsieh <wenson_hsieh@apple.com> 2 29 -
trunk/Source/WebKit/UIProcess/API/wpe/qt/WPEQmlExtensionPlugin.cpp
r240141 r285000 1 1 /* 2 * Copyright (C) 2018, 2019 Igalia S.L2 * Copyright (C) 2018, 2019, 2021 Igalia S.L 3 3 * Copyright (C) 2018, 2019 Zodiac Inflight Innovations 4 4 * … … 19 19 */ 20 20 21 #include "config.h"22 21 #include "WPEQmlExtensionPlugin.h" 23 22 -
trunk/Source/WebKit/UIProcess/API/wpe/qt/WPEQtView.cpp
r284983 r285000 1 1 /* 2 * Copyright (C) 2018, 2019 Igalia S.L2 * Copyright (C) 2018, 2019, 2021 Igalia S.L 3 3 * Copyright (C) 2018, 2019 Zodiac Inflight Innovations 4 4 * … … 19 19 */ 20 20 21 #include "config.h"22 21 #include "WPEQtView.h" 23 22 … … 32 31 #include <QtPlatformHeaders/QEGLNativeContext> 33 32 #include <qpa/qplatformnativeinterface.h> 34 #include <wtf/glib/GUniquePtr.h>35 33 36 34 /*! … … 98 96 auto* context = window()->openglContext(); 99 97 std::unique_ptr<WPEQtViewBackend> backend = WPEQtViewBackend::create(m_size, context, display, QPointer<WPEQtView>(this)); 100 RELEASE_ASSERT_WITH_MESSAGE(backend, "EGL initialization failed");101 if (!backend)98 if (!backend) { 99 qFatal("WPEQtView::createWebView(): EGL initialization failed"); 102 100 return; 101 } 103 102 104 103 m_backend = backend.get(); 105 auto settings = adoptGRef(webkit_settings_new_with_settings("enable-developer-extras", TRUE,106 "enable-webgl", TRUE, "enable-mediasource", TRUE, nullptr) );104 auto* settings = webkit_settings_new_with_settings("enable-developer-extras", TRUE, 105 "enable-webgl", TRUE, "enable-mediasource", TRUE, nullptr); 107 106 m_webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, 108 107 "backend", webkit_web_view_backend_new(m_backend->backend(), [](gpointer data) { 109 108 delete static_cast<WPEQtViewBackend*>(data); 110 109 }, backend.release()), 111 "settings", settings.get(), nullptr)); 110 "settings", settings, nullptr)); 111 g_clear_object(&settings); 112 112 113 113 g_signal_connect_swapped(m_webView, "notify::uri", G_CALLBACK(notifyUrlChangedCallback), this); … … 405 405 static void jsAsyncReadyCallback(GObject* object, GAsyncResult* result, gpointer userData) 406 406 { 407 G UniqueOutPtr<GError> error;407 GError* error { nullptr }; 408 408 std::unique_ptr<JavascriptCallbackData> data(reinterpret_cast<JavascriptCallbackData*>(userData)); 409 WebKitJavascriptResult* jsResult = webkit_web_view_run_javascript_finish(WEBKIT_WEB_VIEW(object), result, &error .outPtr());409 WebKitJavascriptResult* jsResult = webkit_web_view_run_javascript_finish(WEBKIT_WEB_VIEW(object), result, &error); 410 410 if (!jsResult) { 411 411 qWarning("Error running javascript: %s", error->message); 412 g_error_free(error); 412 413 return; 413 414 } … … 426 427 // FIXME: Handle more value types? 427 428 if (jsc_value_is_string(value)) { 428 GUniquePtr<gchar> strValue(jsc_value_to_string(value));429 auto* strValue = jsc_value_to_string(value); 429 430 JSCContext* context = jsc_value_get_context(value); 430 431 JSCException* exception = jsc_context_get_exception(context); … … 433 434 jsc_context_clear_exception(context); 434 435 } else 435 variant.setValue(QString::fromUtf8(strValue.get())); 436 variant.setValue(QString::fromUtf8(strValue)); 437 g_free(strValue); 436 438 } 437 439 args.append(engine->toScriptValue(variant)); -
trunk/Source/WebKit/UIProcess/API/wpe/qt/WPEQtView.h
r283802 r285000 1 1 /* 2 * Copyright (C) 2018, 2019 Igalia S.L2 * Copyright (C) 2018, 2019, 2021 Igalia S.L 3 3 * Copyright (C) 2018, 2019 Zodiac Inflight Innovations 4 4 * … … 21 21 #pragma once 22 22 23 #include "config.h"24 25 23 #include <QQmlEngine> 26 24 #include <QQuickItem> … … 28 26 #include <memory> 29 27 #include <wpe/webkit.h> 30 #include <wtf/glib/GRefPtr.h>31 28 32 29 class WPEQtViewBackend; -
trunk/Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp
r276308 r285000 1 1 /* 2 * Copyright (C) 2018, 2019 Igalia S.L2 * Copyright (C) 2018, 2019, 2021 Igalia S.L 3 3 * Copyright (C) 2018, 2019 Zodiac Inflight Innovations 4 4 * … … 19 19 */ 20 20 21 #include "config.h"22 21 #include "WPEQtViewBackend.h" 23 22 … … 211 210 void WPEQtViewBackend::displayImage(struct wpe_fdo_egl_exported_image* image) 212 211 { 213 RELEASE_ASSERT(!m_lockedImage);212 Q_ASSUME(!m_lockedImage); 214 213 m_lockedImage = image; 215 214 if (m_view) -
trunk/Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewLoadRequest.cpp
r240141 r285000 1 1 /* 2 * Copyright (C) 2018, 2019 Igalia S.L2 * Copyright (C) 2018, 2019, 2021 Igalia S.L 3 3 * Copyright (C) 2018, 2019 Zodiac Inflight Innovations 4 4 * … … 19 19 */ 20 20 21 #include "config.h"22 21 #include "WPEQtViewLoadRequest.h" 23 22
Note:
See TracChangeset
for help on using the changeset viewer.