<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[189094] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/189094">189094</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-08-28 04:16:05 -0700 (Fri, 28 Aug 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>[GTK] Simplify the internal API to create a WebView
https://bugs.webkit.org/show_bug.cgi?id=148570
Reviewed by Žan Doberšek.
Source/WebKit2:
Now that all the information required to create a WebView is in
API::PageConfiguration, we can simplify the internal API to
receive only the configuration instead of receiving a long list of
parameters that we use to build a new API::PageConfiguration.
* UIProcess/API/C/gtk/WKView.cpp:
(WKViewCreate):
* UIProcess/API/C/gtk/WKView.h:
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextCreatePageForWebView):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseCreate):
(webkitWebViewBaseCreateWebPage):
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformCreateInspectorPage):
Tools:
* TestWebKitAPI/PlatformWebView.h: Add initialize method for GTK+ too.
* TestWebKitAPI/gtk/PlatformWebViewGtk.cpp:
(TestWebKitAPI::PlatformWebView::PlatformWebView): Implement all
PlatformWebView constructors that end up calling initialize with a PageConfiguration.
(TestWebKitAPI::PlatformWebView::initialize): Create the WebView
passing the received PageConfiguration.
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::PlatformWebView): Create the WebView
passing the received PageConfiguration.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICgtkWKViewcpp">trunk/Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICgtkWKViewh">trunk/Source/WebKit2/UIProcess/API/C/gtk/WKView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextcpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasecpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasePrivateh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessgtkWebInspectorProxyGtkcpp">trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPIPlatformWebViewh">trunk/Tools/TestWebKitAPI/PlatformWebView.h</a></li>
<li><a href="#trunkToolsTestWebKitAPIgtkPlatformWebViewGtkcpp">trunk/Tools/TestWebKitAPI/gtk/PlatformWebViewGtk.cpp</a></li>
<li><a href="#trunkToolsWebKitTestRunnergtkPlatformWebViewGtkcpp">trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (189093 => 189094)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-08-28 09:48:41 UTC (rev 189093)
+++ trunk/Source/WebKit2/ChangeLog        2015-08-28 11:16:05 UTC (rev 189094)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2015-08-28 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Simplify the internal API to create a WebView
+ https://bugs.webkit.org/show_bug.cgi?id=148570
+
+ Reviewed by Žan Doberšek.
+
+ Now that all the information required to create a WebView is in
+ API::PageConfiguration, we can simplify the internal API to
+ receive only the configuration instead of receiving a long list of
+ parameters that we use to build a new API::PageConfiguration.
+
+ * UIProcess/API/C/gtk/WKView.cpp:
+ (WKViewCreate):
+ * UIProcess/API/C/gtk/WKView.h:
+ * UIProcess/API/gtk/WebKitWebContext.cpp:
+ (webkitWebContextCreatePageForWebView):
+ * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+ (webkitWebViewBaseCreate):
+ (webkitWebViewBaseCreateWebPage):
+ * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
+ * UIProcess/gtk/WebInspectorProxyGtk.cpp:
+ (WebKit::WebInspectorProxy::platformCreateInspectorPage):
+
</ins><span class="cx"> 2015-08-27 Timothy Horton <timothy_horton@apple.com>
</span><span class="cx">
</span><span class="cx"> Video full-screen shouldn't use the DynamicSizeWithMinimumViewSize layout mode
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICgtkWKViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp (189093 => 189094)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp        2015-08-28 09:48:41 UTC (rev 189093)
+++ trunk/Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp        2015-08-28 11:16:05 UTC (rev 189094)
</span><span class="lines">@@ -31,15 +31,12 @@
</span><span class="cx"> #include "WKAPICast.h"
</span><span class="cx"> #include "WKViewPrivate.h"
</span><span class="cx"> #include "WebKitWebViewBasePrivate.h"
</span><del>-#include "WebPageGroup.h"
-#include "WebProcessPool.h"
</del><span class="cx">
</span><span class="cx"> using namespace WebKit;
</span><del>-using namespace WebCore;
</del><span class="cx">
</span><del>-WKViewRef WKViewCreate(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKPageRef relatedPage)
</del><ins>+WKViewRef WKViewCreate(WKPageConfigurationRef configuration)
</ins><span class="cx"> {
</span><del>- return toAPI(webkitWebViewBaseCreate(toImpl(contextRef), nullptr, toImpl(pageGroupRef), nullptr, toImpl(relatedPage)));
</del><ins>+ return toAPI(webkitWebViewBaseCreate(*toImpl(configuration)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> WKPageRef WKViewGetPage(WKViewRef viewRef)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICgtkWKViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/C/gtk/WKView.h (189093 => 189094)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/C/gtk/WKView.h        2015-08-28 09:48:41 UTC (rev 189093)
+++ trunk/Source/WebKit2/UIProcess/API/C/gtk/WKView.h        2015-08-28 11:16:05 UTC (rev 189094)
</span><span class="lines">@@ -34,7 +34,7 @@
</span><span class="cx"> extern "C" {
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-WK_EXPORT WKViewRef WKViewCreate(WKContextRef context, WKPageGroupRef pageGroup, WKPageRef relatedPage);
</del><ins>+WK_EXPORT WKViewRef WKViewCreate(WKPageConfigurationRef configuration);
</ins><span class="cx">
</span><span class="cx"> WK_EXPORT WKPageRef WKViewGetPage(WKViewRef view);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp (189093 => 189094)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp        2015-08-28 09:48:41 UTC (rev 189093)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp        2015-08-28 11:16:05 UTC (rev 189094)
</span><span class="lines">@@ -1318,12 +1318,13 @@
</span><span class="cx"> WebKitWebViewBase* webViewBase = WEBKIT_WEB_VIEW_BASE(webView);
</span><span class="cx">
</span><span class="cx"> auto pageConfiguration = API::PageConfiguration::create();
</span><ins>+ pageConfiguration->setProcessPool(context->priv->context.get());
</ins><span class="cx"> pageConfiguration->setPreferences(webkitSettingsGetPreferences(webkit_web_view_get_settings(webView)));
</span><span class="cx"> pageConfiguration->setRelatedPage(relatedView ? webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(relatedView)) : nullptr);
</span><span class="cx"> pageConfiguration->setUserContentController(userContentManager ? webkitUserContentManagerGetUserContentControllerProxy(userContentManager) : nullptr);
</span><span class="cx"> pageConfiguration->setWebsiteDataStore(&webkitWebsiteDataManagerGetDataStore(context->priv->websiteDataManager.get()));
</span><span class="cx"> pageConfiguration->setSessionID(pageConfiguration->websiteDataStore()->websiteDataStore().sessionID());
</span><del>- webkitWebViewBaseCreateWebPage(webViewBase, context->priv->context.get(), WTF::move(pageConfiguration));
</del><ins>+ webkitWebViewBaseCreateWebPage(webViewBase, WTF::move(pageConfiguration));
</ins><span class="cx">
</span><span class="cx"> WebPageProxy* page = webkitWebViewBaseGetPage(webViewBase);
</span><span class="cx"> context->priv->webViews.set(page->pageID(), webView);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp (189093 => 189094)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp        2015-08-28 09:48:41 UTC (rev 189093)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp        2015-08-28 11:16:05 UTC (rev 189094)
</span><span class="lines">@@ -1043,17 +1043,10 @@
</span><span class="cx"> containerClass->forall = webkitWebViewBaseContainerForall;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-WebKitWebViewBase* webkitWebViewBaseCreate(WebProcessPool* context, WebPreferences* preferences, WebPageGroup* pageGroup, WebUserContentControllerProxy* userContentController, WebPageProxy* relatedPage)
</del><ins>+WebKitWebViewBase* webkitWebViewBaseCreate(const API::PageConfiguration& configuration)
</ins><span class="cx"> {
</span><span class="cx"> WebKitWebViewBase* webkitWebViewBase = WEBKIT_WEB_VIEW_BASE(g_object_new(WEBKIT_TYPE_WEB_VIEW_BASE, nullptr));
</span><del>-
- auto pageConfiguration = API::PageConfiguration::create();
- pageConfiguration->setProcessPool(context);
- pageConfiguration->setPreferences(preferences);
- pageConfiguration->setPageGroup(pageGroup);
- pageConfiguration->setRelatedPage(relatedPage);
- pageConfiguration->setUserContentController(userContentController);
- webkitWebViewBaseCreateWebPage(webkitWebViewBase, context, WTF::move(pageConfiguration));
</del><ins>+ webkitWebViewBaseCreateWebPage(webkitWebViewBase, configuration.copy());
</ins><span class="cx"> return webkitWebViewBase;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1074,9 +1067,10 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // HAVE(GTK_SCALE_FACTOR)
</span><span class="cx">
</span><del>-void webkitWebViewBaseCreateWebPage(WebKitWebViewBase* webkitWebViewBase, WebProcessPool* context, Ref<API::PageConfiguration>&& configuration)
</del><ins>+void webkitWebViewBaseCreateWebPage(WebKitWebViewBase* webkitWebViewBase, Ref<API::PageConfiguration>&& configuration)
</ins><span class="cx"> {
</span><span class="cx"> WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
</span><ins>+ WebProcessPool* context = configuration->processPool();
</ins><span class="cx"> priv->pageProxy = context->createWebPage(*priv->pageClient, WTF::move(configuration));
</span><span class="cx"> priv->pageProxy->initializeWebPage();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h (189093 => 189094)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h        2015-08-28 09:48:41 UTC (rev 189093)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h        2015-08-28 11:16:05 UTC (rev 189094)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #ifndef WebKitWebViewBasePrivate_h
</span><span class="cx"> #define WebKitWebViewBasePrivate_h
</span><span class="cx">
</span><ins>+#include "APIPageConfiguration.h"
</ins><span class="cx"> #include "DragAndDropHandler.h"
</span><span class="cx"> #include "GestureController.h"
</span><span class="cx"> #include "WebContextMenuProxyGtk.h"
</span><span class="lines">@@ -36,10 +37,10 @@
</span><span class="cx"> #include "WebKitWebViewBase.h"
</span><span class="cx"> #include "WebPageProxy.h"
</span><span class="cx">
</span><del>-WebKitWebViewBase* webkitWebViewBaseCreate(WebKit::WebProcessPool*, WebKit::WebPreferences*, WebKit::WebPageGroup*, WebKit::WebUserContentControllerProxy*, WebKit::WebPageProxy*);
</del><ins>+WebKitWebViewBase* webkitWebViewBaseCreate(const API::PageConfiguration&);
</ins><span class="cx"> GtkIMContext* webkitWebViewBaseGetIMContext(WebKitWebViewBase*);
</span><span class="cx"> WebKit::WebPageProxy* webkitWebViewBaseGetPage(WebKitWebViewBase*);
</span><del>-void webkitWebViewBaseCreateWebPage(WebKitWebViewBase*, WebKit::WebProcessPool*, Ref<API::PageConfiguration>&&);
</del><ins>+void webkitWebViewBaseCreateWebPage(WebKitWebViewBase*, Ref<API::PageConfiguration>&&);
</ins><span class="cx"> void webkitWebViewBaseSetTooltipText(WebKitWebViewBase*, const char*);
</span><span class="cx"> void webkitWebViewBaseSetTooltipArea(WebKitWebViewBase*, const WebCore::IntRect&);
</span><span class="cx"> void webkitWebViewBaseForwardNextKeyEvent(WebKitWebViewBase*);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessgtkWebInspectorProxyGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp (189093 => 189094)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp        2015-08-28 09:48:41 UTC (rev 189093)
+++ trunk/Source/WebKit2/UIProcess/gtk/WebInspectorProxyGtk.cpp        2015-08-28 11:16:05 UTC (rev 189094)
</span><span class="lines">@@ -77,7 +77,12 @@
</span><span class="cx"> preferences->setJavaScriptRuntimeFlags({
</span><span class="cx"> });
</span><span class="cx"> RefPtr<WebPageGroup> pageGroup = WebPageGroup::create(inspectorPageGroupIdentifier(), false, false);
</span><del>- m_inspectorView = GTK_WIDGET(webkitWebViewBaseCreate(&inspectorProcessPool(), preferences.get(), pageGroup.get(), nullptr, nullptr));
</del><ins>+
+ auto pageConfiguration = API::PageConfiguration::create();
+ pageConfiguration->setProcessPool(&inspectorProcessPool());
+ pageConfiguration->setPreferences(preferences.get());
+ pageConfiguration->setPageGroup(pageGroup.get());
+ m_inspectorView = GTK_WIDGET(webkitWebViewBaseCreate(*pageConfiguration.ptr()));
</ins><span class="cx"> g_object_add_weak_pointer(G_OBJECT(m_inspectorView), reinterpret_cast<void**>(&m_inspectorView));
</span><span class="cx">
</span><span class="cx"> WKPageUIClientV2 uiClient = {
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (189093 => 189094)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-08-28 09:48:41 UTC (rev 189093)
+++ trunk/Tools/ChangeLog        2015-08-28 11:16:05 UTC (rev 189094)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2015-08-28 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Simplify the internal API to create a WebView
+ https://bugs.webkit.org/show_bug.cgi?id=148570
+
+ Reviewed by Žan Doberšek.
+
+ * TestWebKitAPI/PlatformWebView.h: Add initialize method for GTK+ too.
+ * TestWebKitAPI/gtk/PlatformWebViewGtk.cpp:
+ (TestWebKitAPI::PlatformWebView::PlatformWebView): Implement all
+ PlatformWebView constructors that end up calling initialize with a PageConfiguration.
+ (TestWebKitAPI::PlatformWebView::initialize): Create the WebView
+ passing the received PageConfiguration.
+ * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
+ (WTR::PlatformWebView::PlatformWebView): Create the WebView
+ passing the received PageConfiguration.
+
</ins><span class="cx"> 2015-08-27 Aakash Jain <aakash_jain@apple.com>
</span><span class="cx">
</span><span class="cx"> iOS Simulator API tests fails as Simulator is not running
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIPlatformWebViewh"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/PlatformWebView.h (189093 => 189094)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/PlatformWebView.h        2015-08-28 09:48:41 UTC (rev 189093)
+++ trunk/Tools/TestWebKitAPI/PlatformWebView.h        2015-08-28 11:16:05 UTC (rev 189094)
</span><span class="lines">@@ -80,6 +80,8 @@
</span><span class="cx"> private:
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> void initialize(WKPageConfigurationRef, Class wkViewSubclass);
</span><ins>+#elif PLATFORM(GTK)
+ void initialize(WKPageConfigurationRef);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> PlatformWKView m_view;
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPIgtkPlatformWebViewGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/gtk/PlatformWebViewGtk.cpp (189093 => 189094)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/gtk/PlatformWebViewGtk.cpp        2015-08-28 09:48:41 UTC (rev 189093)
+++ trunk/Tools/TestWebKitAPI/gtk/PlatformWebViewGtk.cpp        2015-08-28 11:16:05 UTC (rev 189094)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include "PlatformWebView.h"
</span><span class="cx">
</span><span class="cx"> #include <WebCore/GUniquePtrGtk.h>
</span><ins>+#include <WebKit/WKRetainPtr.h>
</ins><span class="cx"> #include <gtk/gtk.h>
</span><span class="cx"> #include <wtf/glib/GUniquePtr.h>
</span><span class="cx">
</span><span class="lines">@@ -34,18 +35,42 @@
</span><span class="cx">
</span><span class="cx"> PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
</span><span class="cx"> {
</span><del>- m_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- m_view = WKViewCreate(contextRef, pageGroupRef, nullptr);
- gtk_container_add(GTK_CONTAINER(m_window), GTK_WIDGET(m_view));
- gtk_widget_show(GTK_WIDGET(m_view));
- gtk_widget_show(m_window);
</del><ins>+ WKRetainPtr<WKPageConfigurationRef> configuration = adoptWK(WKPageConfigurationCreate());
+ WKPageConfigurationSetContext(configuration.get(), contextRef);
+ WKPageConfigurationSetPageGroup(configuration.get(), pageGroupRef);
+
+ initialize(configuration.get());
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration)
+{
+ initialize(configuration);
+}
+
+PlatformWebView::PlatformWebView(WKPageRef relatedPage)
+{
+ WKRetainPtr<WKPageConfigurationRef> configuration = adoptWK(WKPageConfigurationCreate());
+ WKPageConfigurationSetContext(configuration.get(), WKPageGetContext(relatedPage));
+ WKPageConfigurationSetPageGroup(configuration.get(), WKPageGetPageGroup(relatedPage));
+ WKPageConfigurationSetRelatedPage(configuration.get(), relatedPage);
+
+ initialize(configuration.get());
+}
+
</ins><span class="cx"> PlatformWebView::~PlatformWebView()
</span><span class="cx"> {
</span><span class="cx"> gtk_widget_destroy(m_window);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void PlatformWebView::initialize(WKPageConfigurationRef configuration)
+{
+ m_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ m_view = WKViewCreate(configuration);
+ gtk_container_add(GTK_CONTAINER(m_window), GTK_WIDGET(m_view));
+ gtk_widget_show(GTK_WIDGET(m_view));
+ gtk_widget_show(m_window);
+}
+
</ins><span class="cx"> WKPageRef PlatformWebView::page() const
</span><span class="cx"> {
</span><span class="cx"> return WKViewGetPage(m_view);
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnergtkPlatformWebViewGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp (189093 => 189094)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp        2015-08-28 09:48:41 UTC (rev 189093)
+++ trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp        2015-08-28 11:16:05 UTC (rev 189094)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> namespace WTR {
</span><span class="cx">
</span><span class="cx"> PlatformWebView::PlatformWebView(WKPageConfigurationRef configuration, const ViewOptions& options)
</span><del>- : m_view(WKViewCreate(WKPageConfigurationGetContext(configuration), WKPageConfigurationGetPageGroup(configuration), WKPageConfigurationGetRelatedPage(configuration)))
</del><ins>+ : m_view(WKViewCreate(configuration))
</ins><span class="cx"> , m_window(gtk_window_new(GTK_WINDOW_POPUP))
</span><span class="cx"> , m_windowIsKey(true)
</span><span class="cx"> , m_options(options)
</span></span></pre>
</div>
</div>
</body>
</html>