<!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>[165253] trunk/Source/WebKit/gtk</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/165253">165253</a></dd>
<dt>Author</dt> <dd>zandobersek@gmail.com</dd>
<dt>Date</dt> <dd>2014-03-07 02:00:48 -0800 (Fri, 07 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move GTK WebKit1 code to std::unique_ptr
https://bugs.webkit.org/show_bug.cgi?id=129675

Reviewed by Anders Carlsson.

Replace uses of OwnPtr and PassOwnPtr in GTK-specific WebKit1 code with std::unique_ptr.

* WebCoreSupport/AcceleratedCompositingContext.h:
* WebCoreSupport/NavigatorContentUtilsClientGtk.cpp:
* WebCoreSupport/NavigatorContentUtilsClientGtk.h:
* webkit/webkitfavicondatabase.cpp:
(getIconPixbufCancelled):
(webkit_favicon_database_get_favicon_pixbuf):
* webkit/webkitwebview.cpp:
(webkit_web_view_init):
* webkit/webkitwebviewprivate.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitgtkChangeLog">trunk/Source/WebKit/gtk/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitgtkWebCoreSupportAcceleratedCompositingContexth">trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h</a></li>
<li><a href="#trunkSourceWebKitgtkWebCoreSupportNavigatorContentUtilsClientGtkcpp">trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.cpp</a></li>
<li><a href="#trunkSourceWebKitgtkWebCoreSupportNavigatorContentUtilsClientGtkh">trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.h</a></li>
<li><a href="#trunkSourceWebKitgtkwebkitwebkitfavicondatabasecpp">trunk/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp</a></li>
<li><a href="#trunkSourceWebKitgtkwebkitwebkitwebviewcpp">trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp</a></li>
<li><a href="#trunkSourceWebKitgtkwebkitwebkitwebviewprivateh">trunk/Source/WebKit/gtk/webkit/webkitwebviewprivate.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitgtkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/ChangeLog (165252 => 165253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/ChangeLog        2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/ChangeLog        2014-03-07 10:00:48 UTC (rev 165253)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2014-03-07  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
+
+        Move GTK WebKit1 code to std::unique_ptr
+        https://bugs.webkit.org/show_bug.cgi?id=129675
+
+        Reviewed by Anders Carlsson.
+
+        Replace uses of OwnPtr and PassOwnPtr in GTK-specific WebKit1 code with std::unique_ptr.
+
+        * WebCoreSupport/AcceleratedCompositingContext.h:
+        * WebCoreSupport/NavigatorContentUtilsClientGtk.cpp:
+        * WebCoreSupport/NavigatorContentUtilsClientGtk.h:
+        * webkit/webkitfavicondatabase.cpp:
+        (getIconPixbufCancelled):
+        (webkit_favicon_database_get_favicon_pixbuf):
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_init):
+        * webkit/webkitwebviewprivate.h:
+
</ins><span class="cx"> 2014-03-06  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Expose the console object in JSContexts to interact with Web Inspector
</span></span></pre></div>
<a id="trunkSourceWebKitgtkWebCoreSupportAcceleratedCompositingContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h (165252 => 165253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h        2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/AcceleratedCompositingContext.h        2014-03-07 10:00:48 UTC (rev 165253)
</span><span class="lines">@@ -43,12 +43,9 @@
</span><span class="cx"> class AcceleratedCompositingContext : public WebCore::GraphicsLayerClient {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(AcceleratedCompositingContext);
</span><span class="cx"> public:
</span><del>-    static PassOwnPtr&lt;AcceleratedCompositingContext&gt; create(WebKitWebView* webView)
-    {
-        return adoptPtr(new AcceleratedCompositingContext(webView));
-    }
-
</del><ins>+    explicit AcceleratedCompositingContext(WebKitWebView*);
</ins><span class="cx">     virtual ~AcceleratedCompositingContext();
</span><ins>+
</ins><span class="cx">     void setRootCompositingLayer(WebCore::GraphicsLayer*);
</span><span class="cx">     void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&amp;);
</span><span class="cx">     void scheduleLayerFlush();
</span><span class="lines">@@ -94,8 +91,6 @@
</span><span class="cx">     std::unique_ptr&lt;WebCore::GraphicsLayer&gt; m_rootGraphicsLayer;
</span><span class="cx">     OwnPtr&lt;WebCore::TextureMapper&gt; m_textureMapper;
</span><span class="cx"> #endif
</span><del>-
-    AcceleratedCompositingContext(WebKitWebView*);
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitgtkWebCoreSupportNavigatorContentUtilsClientGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.cpp (165252 => 165253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.cpp        2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.cpp        2014-03-07 10:00:48 UTC (rev 165253)
</span><span class="lines">@@ -26,15 +26,6 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-PassOwnPtr&lt;NavigatorContentUtilsClient&gt; NavigatorContentUtilsClient::create()
-{
-    return adoptPtr(new NavigatorContentUtilsClient);
-}
-
-NavigatorContentUtilsClient::NavigatorContentUtilsClient()
-{
-}
-
</del><span class="cx"> void NavigatorContentUtilsClient::registerProtocolHandler(const String&amp; scheme, const URL&amp; baseURL, const URL&amp; url, const String&amp; title)
</span><span class="cx"> {
</span><span class="cx">     notImplemented();
</span></span></pre></div>
<a id="trunkSourceWebKitgtkWebCoreSupportNavigatorContentUtilsClientGtkh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.h (165252 => 165253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.h        2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/WebCoreSupport/NavigatorContentUtilsClientGtk.h        2014-03-07 10:00:48 UTC (rev 165253)
</span><span class="lines">@@ -28,14 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> class NavigatorContentUtilsClient : public WebCore::NavigatorContentUtilsClient {
</span><span class="cx"> public:
</span><del>-    static PassOwnPtr&lt;NavigatorContentUtilsClient&gt; create();
-
-    ~NavigatorContentUtilsClient() { }
-
</del><span class="cx">     virtual void registerProtocolHandler(const String&amp; scheme, const URL&amp; baseURL, const URL&amp;, const String&amp; title);
</span><del>-
-private:
-    NavigatorContentUtilsClient();
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitgtkwebkitwebkitfavicondatabasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp (165252 => 165253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp        2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/webkit/webkitfavicondatabase.cpp        2014-03-07 10:00:48 UTC (rev 165253)
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx"> 
</span><span class="cx"> G_DEFINE_TYPE(WebKitFaviconDatabase, webkit_favicon_database, G_TYPE_OBJECT)
</span><span class="cx"> 
</span><del>-typedef Vector&lt;OwnPtr&lt;PendingIconRequest&gt; &gt; PendingIconRequestVector;
</del><ins>+typedef Vector&lt;std::unique_ptr&lt;PendingIconRequest&gt;&gt; PendingIconRequestVector;
</ins><span class="cx"> typedef HashMap&lt;String, PendingIconRequestVector*&gt; PendingIconRequestMap;
</span><span class="cx"> 
</span><span class="cx"> struct _WebKitFaviconDatabasePrivate {
</span><span class="lines">@@ -470,9 +470,16 @@
</span><span class="cx">     if (!icons)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    size_t itemIndex = icons-&gt;find(request);
-    if (itemIndex != notFound)
-        icons-&gt;remove(itemIndex);
</del><ins>+    size_t itemIndex = 0;
+    for (auto&amp; item : *icons) {
+        if (item.get() == request) {
+            icons-&gt;remove(itemIndex);
+            break;
+        }
+
+        itemIndex++;
+    }
+
</ins><span class="cx">     if (icons-&gt;isEmpty())
</span><span class="cx">         webkitfavicondatabaseDeleteRequests(database, icons, pageURL);
</span><span class="cx"> }
</span><span class="lines">@@ -536,7 +543,7 @@
</span><span class="cx">     // Register icon request before asking for the icon to avoid race conditions.
</span><span class="cx">     PendingIconRequestVector* icons = webkitFaviconDatabaseGetOrCreateRequests(database, pageURL);
</span><span class="cx">     ASSERT(icons);
</span><del>-    icons-&gt;append(adoptPtr(request));
</del><ins>+    icons-&gt;append(std::unique_ptr&lt;PendingIconRequest&gt;(request));
</ins><span class="cx"> 
</span><span class="cx">     // We ask for the icon directly. If we don't get the icon data now,
</span><span class="cx">     // we'll be notified later (even if the database is still importing icons).
</span></span></pre></div>
<a id="trunkSourceWebKitgtkwebkitwebkitwebviewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp (165252 => 165253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp        2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp        2014-03-07 10:00:48 UTC (rev 165253)
</span><span class="lines">@@ -3853,7 +3853,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(GEOLOCATION)
</span><span class="cx">     if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) {
</span><del>-        priv-&gt;geolocationClientMock = adoptPtr(new GeolocationClientMock);
</del><ins>+        priv-&gt;geolocationClientMock = std::make_unique&lt;GeolocationClientMock&gt;();
</ins><span class="cx">         WebCore::provideGeolocationTo(priv-&gt;corePage, priv-&gt;geolocationClientMock.get());
</span><span class="cx">         priv-&gt;geolocationClientMock.get()-&gt;setController(GeolocationController::from(priv-&gt;corePage));
</span><span class="cx">     } else
</span><span class="lines">@@ -3865,12 +3865,12 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><del>-    priv-&gt;userMediaClient = adoptPtr(new UserMediaClientGtk);
</del><ins>+    priv-&gt;userMediaClient = std::make_unique&lt;UserMediaClientGtk&gt;();
</ins><span class="cx">     WebCore::provideUserMediaTo(priv-&gt;corePage, priv-&gt;userMediaClient.get());
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NAVIGATOR_CONTENT_UTILS)
</span><del>-    priv-&gt;navigatorContentUtilsClient = WebKit::NavigatorContentUtilsClient::create();
</del><ins>+    priv-&gt;navigatorContentUtilsClient = std::make_unique&lt;WebKit::NavigatorContentUtilsClient&gt;();
</ins><span class="cx">     WebCore::provideNavigatorContentUtilsTo(priv-&gt;corePage, priv-&gt;navigatorContentUtilsClient.get());
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -3925,7 +3925,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     priv-&gt;selfScrolling = false;
</span><del>-    priv-&gt;acceleratedCompositingContext = AcceleratedCompositingContext::create(webView);
</del><ins>+    priv-&gt;acceleratedCompositingContext = std::make_unique&lt;AcceleratedCompositingContext&gt;(webView);
</ins><span class="cx"> 
</span><span class="cx">     g_signal_connect(webView, &quot;direction-changed&quot;, G_CALLBACK(webkitWebViewDirectionChanged), 0);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitgtkwebkitwebkitwebviewprivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/gtk/webkit/webkitwebviewprivate.h (165252 => 165253)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/gtk/webkit/webkitwebviewprivate.h        2014-03-07 07:20:51 UTC (rev 165252)
+++ trunk/Source/WebKit/gtk/webkit/webkitwebviewprivate.h        2014-03-07 10:00:48 UTC (rev 165253)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;ResourceResponse.h&quot;
</span><span class="cx"> #include &quot;WebViewInputMethodFilter.h&quot;
</span><span class="cx"> #include &quot;WidgetBackingStore.h&quot;
</span><ins>+#include &lt;memory&gt;
</ins><span class="cx"> #include &lt;webkit/webkitwebview.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><span class="lines">@@ -102,22 +103,22 @@
</span><span class="cx">     bool selfScrolling;
</span><span class="cx">     GRefPtr&lt;GtkTargetList&gt; targetList;
</span><span class="cx"> 
</span><del>-    OwnPtr&lt;WebKit::AcceleratedCompositingContext&gt; acceleratedCompositingContext;
</del><ins>+    std::unique_ptr&lt;WebKit::AcceleratedCompositingContext&gt; acceleratedCompositingContext;
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(ICONDATABASE)
</span><span class="cx">     gulong iconLoadedHandler;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span><del>-    OwnPtr&lt;WebKit::UserMediaClientGtk&gt; userMediaClient;
</del><ins>+    std::unique_ptr&lt;WebKit::UserMediaClientGtk&gt; userMediaClient;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(GEOLOCATION)
</span><del>-    OwnPtr&lt;WebCore::GeolocationClientMock&gt; geolocationClientMock;
</del><ins>+    std::unique_ptr&lt;WebCore::GeolocationClientMock&gt; geolocationClientMock;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NAVIGATOR_CONTENT_UTILS)
</span><del>-    OwnPtr&lt;WebKit::NavigatorContentUtilsClient&gt; navigatorContentUtilsClient;
</del><ins>+    std::unique_ptr&lt;WebKit::NavigatorContentUtilsClient&gt; navigatorContentUtilsClient;
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>