<!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>[190660] 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/190660">190660</a></dd>
<dt>Author</dt> <dd>mcatanzaro@igalia.com</dd>
<dt>Date</dt> <dd>2015-10-06 21:08:25 -0700 (Tue, 06 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Add autocleanups
https://bugs.webkit.org/show_bug.cgi?id=149588

Reviewed by Darin Adler.

Source/WebCore:

* PlatformGTK.cmake:
* bindings/scripts/gobject-generate-headers.pl:

Source/WebKit2:

* PlatformGTK.cmake:
* UIProcess/API/gtk/WebKitAutocleanups.h: Added.
* UIProcess/API/gtk/webkit2.h:
* WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h: Added.
* WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:

Tools:

* TestWebKitAPI/Tests/WebKit2Gtk/AutocleanupsTest.cpp: Added.
(AutocleanupsTest::create):
(AutocleanupsTest::testWebProcessAutocleanups):
(registerTests):
* TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt:
* TestWebKitAPI/Tests/WebKit2Gtk/TestAutocleanups.cpp: Added.
(testUIProcessAutocleanups):
(testWebProcessAutocleanups):
(beforeAll):
(afterAll):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsgobjectgenerateheaderspl">trunk/Source/WebCore/bindings/scripts/gobject-generate-headers.pl</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2PlatformGTKcmake">trunk/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkwebkit2h">trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkwebkitwebextensionh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkCMakeListstxt">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitAutocleanupsh">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitAutocleanups.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebExtensionAutocleanupsh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkAutocleanupsTestcpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/AutocleanupsTest.cpp</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWebKit2GtkTestAutocleanupscpp">trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestAutocleanups.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (190659 => 190660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-07 03:35:26 UTC (rev 190659)
+++ trunk/Source/WebCore/ChangeLog        2015-10-07 04:08:25 UTC (rev 190660)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-10-06  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
+
+        [GTK] Add autocleanups
+        https://bugs.webkit.org/show_bug.cgi?id=149588
+
+        Reviewed by Darin Adler.
+
+        * PlatformGTK.cmake:
+        * bindings/scripts/gobject-generate-headers.pl:
+
</ins><span class="cx"> 2015-10-06  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Paint artifacts when hovering on http://jsfiddle.net/Sherbrow/T87Mn/
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (190659 => 190660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2015-10-07 03:35:26 UTC (rev 190659)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2015-10-07 04:08:25 UTC (rev 190660)
</span><span class="lines">@@ -559,6 +559,8 @@
</span><span class="cx">     bindings/gobject/WebKitDOMObject.cpp
</span><span class="cx">     bindings/gobject/WebKitDOMPrivate.cpp
</span><span class="cx">     bindings/gobject/WebKitDOMXPathNSResolver.cpp
</span><ins>+    ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups.h
+    ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups-unstable.h
</ins><span class="cx">     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
</span><span class="cx">     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
</span><span class="cx">     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
</span><span class="lines">@@ -774,6 +776,7 @@
</span><span class="cx"> 
</span><span class="cx"> set(GObjectDOMBindingsStable_CLASS_LIST ${GObjectDOMBindings_STATIC_CLASS_LIST})
</span><span class="cx"> set(GObjectDOMBindingsStable_INSTALLED_HEADERS
</span><ins>+     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups.h
</ins><span class="cx">      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines.h
</span><span class="cx">      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
</span><span class="cx">      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMCustom.h
</span><span class="lines">@@ -785,6 +788,7 @@
</span><span class="cx"> )
</span><span class="cx"> 
</span><span class="cx"> set(GObjectDOMBindingsUnstable_INSTALLED_HEADERS
</span><ins>+     ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups-unstable.h
</ins><span class="cx">      ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomdefines-unstable.h
</span><span class="cx">      ${WEBCORE_DIR}/bindings/gobject/WebKitDOMCustomUnstable.h
</span><span class="cx"> )
</span><span class="lines">@@ -826,6 +830,18 @@
</span><span class="cx">     COMMAND echo ${GObjectDOMBindingsStable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl gdom &gt; ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdom.h
</span><span class="cx"> )
</span><span class="cx"> 
</span><ins>+add_custom_command(
+    OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups.h
+    DEPENDS ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl
+    COMMAND echo ${GObjectDOMBindingsStable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl autocleanups &gt; ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups.h
+)
+
+add_custom_command(
+    OUTPUT ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups-unstable.h
+    DEPENDS ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl
+    COMMAND echo ${GObjectDOMBindingsUnstable_CLASS_LIST} | ${PERL_EXECUTABLE} ${WEBCORE_DIR}/bindings/scripts/gobject-generate-headers.pl autocleanups &gt; ${DERIVED_SOURCES_GOBJECT_DOM_BINDINGS_DIR}/webkitdomautocleanups-unstable.h
+)
+
</ins><span class="cx"> # Some of the static headers are included by generated public headers with include &lt;webkitdom/WebKitDOMFoo.h&gt;.
</span><span class="cx"> # We need those headers in the derived sources to be in webkitdom directory.
</span><span class="cx"> set(GObjectDOMBindings_STATIC_HEADER_NAMES ${GObjectDOMBindings_STATIC_CLASS_LIST} CustomUnstable)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsgobjectgenerateheaderspl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/gobject-generate-headers.pl (190659 => 190660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/gobject-generate-headers.pl        2015-10-07 03:35:26 UTC (rev 190659)
+++ trunk/Source/WebCore/bindings/scripts/gobject-generate-headers.pl        2015-10-07 04:08:25 UTC (rev 190660)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> #!/usr/bin/perl -w
</span><span class="cx"> #
</span><span class="cx"> # Copyright (C) 2009 Adam Dingle &lt;adam@yorba.org&gt;
</span><ins>+# Copyright (C) 2015 Igalia S.L.
</ins><span class="cx"> #
</span><span class="cx"> # This file is part of WebKit
</span><span class="cx"> # 
</span><span class="lines">@@ -55,6 +56,8 @@
</span><span class="cx">     $header = &quot;webkitdomdefines_unstable_h&quot;;
</span><span class="cx"> } elsif ($outType eq &quot;gdom&quot;) {
</span><span class="cx">     $header = &quot;webkitdom_h&quot;;
</span><ins>+} elsif ($outType eq &quot;autocleanups&quot;) {
+    $header = &quot;webkitdomautocleanups_h&quot;;
</ins><span class="cx"> } else {
</span><span class="cx">     die &quot;unknown output type&quot;;
</span><span class="cx"> }
</span><span class="lines">@@ -92,6 +95,7 @@
</span><span class="cx">             print &quot;\n&quot;;
</span><span class="cx">         }
</span><span class="cx">     }
</span><ins>+    print &quot;#include &lt;webkitdom/webkitdomautocleanups.h&gt;\n&quot;;
</ins><span class="cx"> } elsif ($outType eq &quot;defines-unstable&quot;) {
</span><span class="cx">     print &quot;#include &lt;webkitdom/webkitdomdefines.h&gt;\n\n&quot;;
</span><span class="cx">     print &quot;#ifdef WEBKIT_DOM_USE_UNSTABLE_API\n\n&quot;;
</span><span class="lines">@@ -102,6 +106,7 @@
</span><span class="cx">         print &quot;\n&quot;;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    print &quot;#include &lt;webkitdom/webkitdomautocleanups-unstable.h&gt;\n\n&quot;;
</ins><span class="cx">     print &quot;#endif /* WEBKIT_DOM_USE_UNSTABLE_API */\n\n&quot;;
</span><span class="cx"> } elsif ($outType eq &quot;gdom&quot;) {
</span><span class="cx">     print &quot;#define __WEBKITDOM_H_INSIDE__\n\n&quot;;
</span><span class="lines">@@ -109,6 +114,17 @@
</span><span class="cx">         print &quot;#include &lt;webkitdom/WebKitDOM${class}.h&gt;\n&quot;;
</span><span class="cx">     }
</span><span class="cx">     print &quot;\n#undef __WEBKITDOM_H_INSIDE__\n&quot;;
</span><ins>+} elsif ($outType eq &quot;autocleanups&quot;) {
+    print &quot;#include &lt;glib-object.h&gt;\n\n&quot;;
+    print &quot;#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC\n&quot;;
+    print &quot;#ifndef __GI_SCANNER__\n\n&quot;;
+    foreach my $class (@classes) {
+        if ($class ne &quot;Deprecated&quot; &amp;&amp; $class ne &quot;Custom&quot;) {
+            print &quot;G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitDOM${class}, g_object_unref)\n&quot;;
+        }
+    }
+    print &quot;\n#endif\n&quot;;
+    print &quot;#endif\n&quot;;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> print &quot;\n&quot;;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (190659 => 190660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-07 03:35:26 UTC (rev 190659)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-07 04:08:25 UTC (rev 190660)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2015-10-06  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
+
+        [GTK] Add autocleanups
+        https://bugs.webkit.org/show_bug.cgi?id=149588
+
+        Reviewed by Darin Adler.
+
+        * PlatformGTK.cmake:
+        * UIProcess/API/gtk/WebKitAutocleanups.h: Added.
+        * UIProcess/API/gtk/webkit2.h:
+        * WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h: Added.
+        * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
+
</ins><span class="cx"> 2015-10-06  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Try to fix the 32-bit build.
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformGTK.cmake (190659 => 190660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformGTK.cmake        2015-10-07 03:35:26 UTC (rev 190659)
+++ trunk/Source/WebKit2/PlatformGTK.cmake        2015-10-07 04:08:25 UTC (rev 190660)
</span><span class="lines">@@ -108,6 +108,7 @@
</span><span class="cx">     UIProcess/API/gtk/WebKitAuthenticationDialog.h
</span><span class="cx">     UIProcess/API/gtk/WebKitAuthenticationRequest.cpp
</span><span class="cx">     UIProcess/API/gtk/WebKitAuthenticationRequest.h
</span><ins>+    UIProcess/API/gtk/WebKitAutocleanups.h
</ins><span class="cx">     UIProcess/API/gtk/WebKitBackForwardList.cpp
</span><span class="cx">     UIProcess/API/gtk/WebKitBackForwardList.h
</span><span class="cx">     UIProcess/API/gtk/WebKitBackForwardListItem.cpp
</span><span class="lines">@@ -375,6 +376,7 @@
</span><span class="cx">     ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitEnumTypes.h
</span><span class="cx">     ${DERIVED_SOURCES_WEBKIT2GTK_API_DIR}/WebKitVersion.h
</span><span class="cx">     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitAuthenticationRequest.h
</span><ins>+    ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitAutocleanups.h
</ins><span class="cx">     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitBackForwardList.h
</span><span class="cx">     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitBackForwardListItem.h
</span><span class="cx">     ${WEBKIT2_DIR}/UIProcess/API/gtk/WebKitColorChooserRequest.h
</span><span class="lines">@@ -431,6 +433,7 @@
</span><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitScriptWorld.h
</span><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h
</span><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.h
</span><ins>+    ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h
</ins><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.h
</span><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h
</span><span class="cx">     ${WEBKIT2_DIR}/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitAutocleanupsh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitAutocleanups.h (0 => 190660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitAutocleanups.h                                (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitAutocleanups.h        2015-10-07 04:08:25 UTC (rev 190660)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if !defined(__WEBKIT2_H_INSIDE__) &amp;&amp; !defined(WEBKIT2_COMPILATION)
+#error &quot;Only &lt;webkit2/webkit2.h&gt; can be included directly.&quot;
+#endif
+
+#ifndef WebKitAutocleanups_h
+#define WebKitAutocleanups_h
+
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+#ifndef __GI_SCANNER__
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitAuthenticationRequest, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitBackForwardList, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitBackForwardListItem, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitColorChooserRequest, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitContextMenu, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitContextMenuItem, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitCookieManager, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitDownload, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitEditorState, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitFaviconDatabase, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitFileChooserRequest, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitFindController, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitFormSubmissionRequest, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitGeolocationPermissionRequest, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitHitTestResult, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitInstallMissingMediaPluginsPermissionRequest, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitNavigationPolicyDecision, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitNotification, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitNotificationPermissionRequest, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitPermissionRequest, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitPlugin, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitPolicyDecision, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitPrintOperation, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitResponsePolicyDecision, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitSecurityManager, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitSettings, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitURIRequest, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitURIResponse, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitURISchemeRequest, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitUserContentManager, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitUserMediaPermissionRequest, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitWebContext, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitWebInspector, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitWebResource, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitWebView, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitWebsiteDataManager, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitWindowProperties, g_object_unref)
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitCredential, webkit_credential_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitJavascriptResult, webkit_javascript_result_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitMimeInfo, webkit_mime_info_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitNavigationAction, webkit_navigation_action_free)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitUserScript, webkit_user_script_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitUserStyleSheet, webkit_user_style_sheet_unref)
+
+#endif // __GI_SCANNER__
+#endif // G_DEFINE_AUTOPTR_CLEANUP_FUNC
+
+#endif // WebKitAutocleanups_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkwebkit2h"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h (190659 => 190660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h        2015-10-07 03:35:26 UTC (rev 190659)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h        2015-10-07 04:08:25 UTC (rev 190660)
</span><span class="lines">@@ -77,6 +77,8 @@
</span><span class="cx"> #include &lt;webkit2/WebKitWebsiteDataManager.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitWindowProperties.h&gt;
</span><span class="cx"> 
</span><ins>+#include &lt;webkit2/WebKitAutocleanups.h&gt;
+
</ins><span class="cx"> #undef __WEBKIT2_H_INSIDE__
</span><span class="cx"> 
</span><span class="cx"> #endif /* __WEBKIT2_H__ */
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkWebKitWebExtensionAutocleanupsh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h (0 => 190660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h                                (rev 0)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/WebKitWebExtensionAutocleanups.h        2015-10-07 04:08:25 UTC (rev 190660)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#if !defined(__WEBKIT_WEB_EXTENSION_H_INSIDE__) &amp;&amp; !defined(WEBKIT2_COMPILATION)
+#error &quot;Only &lt;webkit2/webkit-web-extension.h&gt; can be included directly.&quot;
+#endif
+
+#ifndef WebKitWebExtensionAutocleanups_h
+#define WebKitWebExtensionAutocleanups_h
+
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+#ifndef __GI_SCANNER__
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitFrame, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitScriptWorld, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitWebEditor, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitWebExtension, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitWebHitTestResult, g_object_unref)
+G_DEFINE_AUTOPTR_CLEANUP_FUNC (WebKitWebPage, g_object_unref)
+
+#endif // __GI_SCANNER__
+#endif // G_DEFINE_AUTOPTR_CLEANUP_FUNC
+
+#endif // WebKitWebExtensionAutocleanups_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIgtkwebkitwebextensionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h (190659 => 190660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h        2015-10-07 03:35:26 UTC (rev 190659)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h        2015-10-07 04:08:25 UTC (rev 190660)
</span><span class="lines">@@ -39,6 +39,8 @@
</span><span class="cx"> #include &lt;webkit2/WebKitWebHitTestResult.h&gt;
</span><span class="cx"> #include &lt;webkit2/WebKitWebPage.h&gt;
</span><span class="cx"> 
</span><ins>+#include &lt;webkit2/WebKitWebExtensionAutocleanups.h&gt;
+
</ins><span class="cx"> #undef __WEBKIT_WEB_EXTENSION_H_INSIDE__
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (190659 => 190660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2015-10-07 03:35:26 UTC (rev 190659)
+++ trunk/Tools/ChangeLog        2015-10-07 04:08:25 UTC (rev 190660)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-10-06  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
+
+        [GTK] Add autocleanups
+        https://bugs.webkit.org/show_bug.cgi?id=149588
+
+        Reviewed by Darin Adler.
+
+        * TestWebKitAPI/Tests/WebKit2Gtk/AutocleanupsTest.cpp: Added.
+        (AutocleanupsTest::create):
+        (AutocleanupsTest::testWebProcessAutocleanups):
+        (registerTests):
+        * TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt:
+        * TestWebKitAPI/Tests/WebKit2Gtk/TestAutocleanups.cpp: Added.
+        (testUIProcessAutocleanups):
+        (testWebProcessAutocleanups):
+        (beforeAll):
+        (afterAll):
+
</ins><span class="cx"> 2015-10-06  Brian Burg  &lt;bburg@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, try to fix the iOS 8 build after r190368.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkAutocleanupsTestcpp"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/AutocleanupsTest.cpp (0 => 190660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/AutocleanupsTest.cpp                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/AutocleanupsTest.cpp        2015-10-07 04:08:25 UTC (rev 190660)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2013 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include &quot;config.h&quot;
+
+#include &quot;WebProcessTest.h&quot;
+#include &lt;webkit2/webkit-web-extension.h&gt;
+
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+
+class AutocleanupsTest : public WebProcessTest {
+public:
+    static std::unique_ptr&lt;WebProcessTest&gt; create() { return std::unique_ptr&lt;WebProcessTest&gt;(new AutocleanupsTest()); }
+
+private:
+    bool testWebProcessAutocleanups(WebKitWebPage* webPage)
+    {
+        // Transfer none
+        g_autoptr(WebKitWebPage) page = WEBKIT_WEB_PAGE(g_object_ref(G_OBJECT(webPage)));
+        g_assert(WEBKIT_IS_WEB_PAGE(page));
+        assertObjectIsDeletedWhenTestFinishes(G_OBJECT(page));
+
+        // Transfer none
+        g_autoptr(WebKitDOMDocument) document = WEBKIT_DOM_DOCUMENT(g_object_ref(G_OBJECT(webkit_web_page_get_dom_document(page))));
+        g_assert(WEBKIT_DOM_IS_DOCUMENT(document));
+        assertObjectIsDeletedWhenTestFinishes(G_OBJECT(document));
+
+        // Transfer full
+        g_autoptr(WebKitDOMDOMWindow) window = webkit_dom_document_get_default_view(document);
+        g_assert(WEBKIT_DOM_IS_DOM_WINDOW(window));
+        assertObjectIsDeletedWhenTestFinishes(G_OBJECT(window));
+
+        // Transfer full
+        g_autoptr(WebKitDOMRange) range = webkit_dom_document_create_range(document);
+        g_assert(WEBKIT_DOM_IS_RANGE(range));
+        assertObjectIsDeletedWhenTestFinishes(G_OBJECT(range));
+
+        return true;
+    }
+
+    bool runTest(const char* testName, WebKitWebPage* page) override
+    {
+        if (!strcmp(testName, &quot;web-process-autocleanups&quot;))
+            return testWebProcessAutocleanups(page);
+
+        g_assert_not_reached();
+        return false;
+    }
+};
+
+static void __attribute__((constructor)) registerTests()
+{
+    REGISTER_TEST(AutocleanupsTest, &quot;Autocleanups/web-process-autocleanups&quot;);
+}
+
+#endif // G_DEFINE_AUTOPTR_CLEANUP_FUNC
</ins></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt (190659 => 190660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt        2015-10-07 03:35:26 UTC (rev 190659)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/CMakeLists.txt        2015-10-07 04:08:25 UTC (rev 190660)
</span><span class="lines">@@ -90,10 +90,11 @@
</span><span class="cx"> endmacro()
</span><span class="cx"> 
</span><span class="cx"> ADD_WK2_TEST_WEB_EXTENSION(WebExtensionTest WebExtensionTest.cpp)
</span><del>-ADD_WK2_TEST_WEB_EXTENSION(WebProcessTest DOMNodeTest.cpp DOMNodeFilterTest.cpp DOMXPathNSResolverTest.cpp FrameTest.cpp WebProcessTest.cpp EditorTest.cpp)
</del><ins>+ADD_WK2_TEST_WEB_EXTENSION(WebProcessTest AutocleanupsTest.cpp DOMNodeTest.cpp DOMNodeFilterTest.cpp DOMXPathNSResolverTest.cpp FrameTest.cpp WebProcessTest.cpp EditorTest.cpp)
</ins><span class="cx"> 
</span><span class="cx"> ADD_WK2_TEST(InspectorTestServer InspectorTestServer.cpp)
</span><span class="cx"> ADD_WK2_TEST(TestAuthentication TestAuthentication.cpp)
</span><ins>+ADD_WK2_TEST(TestAutocleanups TestAutocleanups.cpp)
</ins><span class="cx"> ADD_WK2_TEST(TestBackForwardList TestBackForwardList.cpp)
</span><span class="cx"> ADD_WK2_TEST(TestContextMenu TestContextMenu.cpp)
</span><span class="cx"> ADD_WK2_TEST(TestCookieManager TestCookieManager.cpp)
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWebKit2GtkTestAutocleanupscpp"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestAutocleanups.cpp (0 => 190660)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestAutocleanups.cpp                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestAutocleanups.cpp        2015-10-07 04:08:25 UTC (rev 190660)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include &quot;config.h&quot;
+
+#include &quot;WebViewTest.h&quot;
+#include &lt;webkit2/webkit2.h&gt;
+
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+
+static void testUIProcessAutocleanups(WebViewTest* test, gconstpointer)
+{
+    // Sanity-check a couple UI process API autocleanups that are easy to test....
+    g_autoptr(WebKitWebContext) context = webkit_web_context_new();
+    g_assert(WEBKIT_IS_WEB_CONTEXT(context));
+    test-&gt;assertObjectIsDeletedWhenTestFinishes(G_OBJECT(context));
+
+    g_autoptr(WebKitWebsiteDataManager) manager = webkit_website_data_manager_new(nullptr);
+    g_assert(WEBKIT_IS_WEBSITE_DATA_MANAGER(manager));
+    test-&gt;assertObjectIsDeletedWhenTestFinishes(G_OBJECT(context));
+
+    g_autoptr(WebKitUserScript) userScript = webkit_user_script_new(&quot;&quot;,
+        WEBKIT_USER_CONTENT_INJECT_ALL_FRAMES, WEBKIT_USER_SCRIPT_INJECT_AT_DOCUMENT_START,
+        nullptr, nullptr);
+    g_assert(userScript);
+    // Not a GObject, so just checking that this doesn't crash....
+}
+
+static void testWebProcessAutocleanups(WebViewTest* test, gconstpointer)
+{
+    static const char* testHTML = &quot;&lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;&quot;;
+    test-&gt;loadHtml(testHTML, nullptr);
+    test-&gt;waitUntilLoadFinished();
+
+    g_assert(test-&gt;runWebProcessTest(&quot;Autocleanups&quot;, &quot;web-process-autocleanups&quot;));
+}
+
+void beforeAll()
+{
+    WebViewTest::add(&quot;Autocleanups&quot;, &quot;ui-process-autocleanups&quot;, testUIProcessAutocleanups);
+    WebViewTest::add(&quot;Autocleanups&quot;, &quot;web-process-autocleanups&quot;, testWebProcessAutocleanups);
+}
+
+void afterAll()
+{
+}
+
+#endif // G_DEFINE_AUTOPTR_CLEANUP_FUNC
</ins></span></pre>
</div>
</div>

</body>
</html>