<!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>[201941] 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/201941">201941</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2016-06-10 14:26:00 -0700 (Fri, 10 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Introduce WTF::UniqueRef
https://bugs.webkit.org/show_bug.cgi?id=158596

Reviewed by Brady Eidson.

Source/WebCore:

No new tests.  No change in behavior.

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage):
* loader/EmptyClients.cpp:
(WebCore::fillWithEmptyClients):
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::canStartMedia):
(WebCore::Page::editorClient):
(WebCore::Page::plugInClient):
(WebCore::Page::mainFrame):
(WebCore::Page::groupPtr): Deleted.
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* page/PageConfiguration.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):

Source/WebKit/win:

* WebView.cpp:
(WebView::initWithFrame):

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_shouldDispatchFakeMouseMoveEvents):

Source/WTF:

WTF::UniqueRef is like a std::unique_ptr that is guaranteed to be non-null.
std::make_unique returns a non-null value that is put into a std::unique_ptr, a type
that could contain null values.  To be able to pass such values around and store them
without wondering if they are null, we now have WTF::UniqueRef which cannot be null.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/UniqueRef.h: Added.
(WTF::makeUniqueRef):
(WTF::UniqueRef::UniqueRef):
(WTF::UniqueRef::get):
(WTF::UniqueRef::operator&amp;):
(WTF::UniqueRef::operator-&gt;):

Tools:

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/UniqueRef.cpp: Added.
(TestWebKitAPI::B::B):
(TestWebKitAPI::C::C):
(TestWebKitAPI::function):
(TestWebKitAPI::TEST):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFWTFxcodeprojprojectpbxproj">trunk/Source/WTF/WTF.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWTFwtfCMakeListstxt">trunk/Source/WTF/wtf/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorOverlaycpp">trunk/Source/WebCore/inspector/InspectorOverlay.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientscpp">trunk/Source/WebCore/loader/EmptyClients.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageh">trunk/Source/WebCore/page/Page.h</a></li>
<li><a href="#trunkSourceWebCorepagePageConfigurationcpp">trunk/Source/WebCore/page/PageConfiguration.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageConfigurationh">trunk/Source/WebCore/page/PageConfiguration.h</a></li>
<li><a href="#trunkSourceWebCoresvggraphicsSVGImagecpp">trunk/Source/WebCore/svg/graphics/SVGImage.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPICMakeListstxt">trunk/Tools/TestWebKitAPI/CMakeLists.txt</a></li>
<li><a href="#trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj">trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWTFwtfUniqueRefh">trunk/Source/WTF/wtf/UniqueRef.h</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWTFUniqueRefcpp">trunk/Tools/TestWebKitAPI/Tests/WTF/UniqueRef.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WTF/ChangeLog        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2016-06-10  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Introduce WTF::UniqueRef
+        https://bugs.webkit.org/show_bug.cgi?id=158596
+
+        Reviewed by Brady Eidson.
+
+        WTF::UniqueRef is like a std::unique_ptr that is guaranteed to be non-null.
+        std::make_unique returns a non-null value that is put into a std::unique_ptr, a type
+        that could contain null values.  To be able to pass such values around and store them
+        without wondering if they are null, we now have WTF::UniqueRef which cannot be null.
+
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/CMakeLists.txt:
+        * wtf/UniqueRef.h: Added.
+        (WTF::makeUniqueRef):
+        (WTF::UniqueRef::UniqueRef):
+        (WTF::UniqueRef::get):
+        (WTF::UniqueRef::operator&amp;):
+        (WTF::UniqueRef::operator-&gt;):
+
</ins><span class="cx"> 2016-06-09  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unaddressed review feedback from r201872
</span></span></pre></div>
<a id="trunkSourceWTFWTFxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -106,6 +106,7 @@
</span><span class="cx">                 515F79501CFC9F4A00CCED93 /* CrossThreadTask.h in Headers */ = {isa = PBXBuildFile; fileRef = 515F794D1CFC9F4A00CCED93 /* CrossThreadTask.h */; };
</span><span class="cx">                 515F79561CFD3A6900CCED93 /* CrossThreadQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 515F79551CFD3A6900CCED93 /* CrossThreadQueue.h */; };
</span><span class="cx">                 553071CA1C40427200384898 /* TinyLRUCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 553071C91C40427200384898 /* TinyLRUCache.h */; };
</span><ins>+                5C7C88D41D0A3A0A009D2F6D /* UniqueRef.h in Headers */ = {isa = PBXBuildFile; fileRef = 5C7C88D31D0A3A0A009D2F6D /* UniqueRef.h */; };
</ins><span class="cx">                 70A993FE1AD7151300FA615B /* SymbolRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70A993FC1AD7151300FA615B /* SymbolRegistry.cpp */; };
</span><span class="cx">                 70A993FF1AD7151300FA615B /* SymbolRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 70A993FD1AD7151300FA615B /* SymbolRegistry.h */; };
</span><span class="cx">                 70ECA60D1B02426800449739 /* AtomicStringImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 70ECA60A1B02426800449739 /* AtomicStringImpl.cpp */; };
</span><span class="lines">@@ -430,6 +431,7 @@
</span><span class="cx">                 515F794D1CFC9F4A00CCED93 /* CrossThreadTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossThreadTask.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 515F79551CFD3A6900CCED93 /* CrossThreadQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrossThreadQueue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 553071C91C40427200384898 /* TinyLRUCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TinyLRUCache.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                5C7C88D31D0A3A0A009D2F6D /* UniqueRef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniqueRef.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 5D247B6214689B8600E78B76 /* libWTF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWTF.a; sourceTree = BUILT_PRODUCTS_DIR; };
</span><span class="cx">                 5D247B6E14689C4700E78B76 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5D247B7014689C4700E78B76 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -770,6 +772,7 @@
</span><span class="cx">                 A876DBD6151816E500DADB95 /* wtf */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                5C7C88D31D0A3A0A009D2F6D /* UniqueRef.h */,
</ins><span class="cx">                                 2CDED0F018115C3F004DBA70 /* cf */,
</span><span class="cx">                                 E4A0AD3B1A96251900536DF6 /* cocoa */,
</span><span class="cx">                                 A8A47281151A825A004123FF /* dtoa */,
</span><span class="lines">@@ -1171,6 +1174,7 @@
</span><span class="cx">                         buildActionMask = 2147483647;
</span><span class="cx">                         files = (
</span><span class="cx">                                 A8A47385151A825B004123FF /* ASCIICType.h in Headers */,
</span><ins>+                                5C7C88D41D0A3A0A009D2F6D /* UniqueRef.h in Headers */,
</ins><span class="cx">                                 A8A47434151A825B004123FF /* ASCIIFastPath.h in Headers */,
</span><span class="cx">                                 A8A47387151A825B004123FF /* Assertions.h in Headers */,
</span><span class="cx">                                 A8A47388151A825B004123FF /* Atomics.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWTFwtfCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/CMakeLists.txt (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/CMakeLists.txt        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WTF/wtf/CMakeLists.txt        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -111,6 +111,7 @@
</span><span class="cx">     Threading.h
</span><span class="cx">     ThreadingPrimitives.h
</span><span class="cx">     TinyPtrSet.h
</span><ins>+    UniqueRef.h
</ins><span class="cx">     VMTags.h
</span><span class="cx">     ValueCheck.h
</span><span class="cx">     Vector.h
</span></span></pre></div>
<a id="trunkSourceWTFwtfUniqueRefh"></a>
<div class="addfile"><h4>Added: trunk/Source/WTF/wtf/UniqueRef.h (0 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/UniqueRef.h                                (rev 0)
+++ trunk/Source/WTF/wtf/UniqueRef.h        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include &lt;memory&gt;
+#include &lt;wtf/Assertions.h&gt;
+
+namespace WTF {
+
+template&lt;typename T&gt; class UniqueRef;
+
+template&lt;typename T, class... Args&gt;
+UniqueRef&lt;T&gt; makeUniqueRef(Args&amp;&amp;... args)
+{
+    return UniqueRef&lt;T&gt;(*new T(std::forward&lt;Args&gt;(args)...));
+}
+
+template&lt;typename T&gt;
+class UniqueRef {
+public:
+    template &lt;typename U&gt;
+    UniqueRef(UniqueRef&lt;U&gt;&amp;&amp; other)
+        : m_ref(WTFMove(other.m_ref))
+    {
+        ASSERT(m_ref);
+    }
+
+    T&amp; get() { ASSERT(m_ref); return *m_ref; }
+    const T&amp; get() const { ASSERT(m_ref); return *m_ref; }
+
+    T* operator&amp;() { ASSERT(m_ref); return m_ref.get(); }
+    const T* operator&amp;() const { ASSERT(m_ref); return m_ref.get(); }
+
+    T* operator-&gt;() { ASSERT(m_ref); return m_ref.get(); }
+    const T* operator-&gt;() const { ASSERT(m_ref); return m_ref.get(); }
+
+private:
+    template&lt;class U, class... Args&gt; friend UniqueRef&lt;U&gt; makeUniqueRef(Args&amp;&amp;...);
+    template&lt;class U&gt; friend class UniqueRef;
+
+    UniqueRef(T&amp; other)
+        : m_ref(&amp;other)
+    {
+        ASSERT(m_ref);
+    }
+
+    std::unique_ptr&lt;T&gt; m_ref;
+};
+
+} // namespace WTF
+
+using WTF::UniqueRef;
+using WTF::makeUniqueRef;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebCore/ChangeLog        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2016-06-10  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Introduce WTF::UniqueRef
+        https://bugs.webkit.org/show_bug.cgi?id=158596
+
+        Reviewed by Brady Eidson.
+
+        No new tests.  No change in behavior.
+
+        * inspector/InspectorOverlay.cpp:
+        (WebCore::InspectorOverlay::overlayPage):
+        * loader/EmptyClients.cpp:
+        (WebCore::fillWithEmptyClients):
+        * page/Page.cpp:
+        (WebCore::Page::Page):
+        * page/Page.h:
+        (WebCore::Page::canStartMedia):
+        (WebCore::Page::editorClient):
+        (WebCore::Page::plugInClient):
+        (WebCore::Page::mainFrame):
+        (WebCore::Page::groupPtr): Deleted.
+        * page/PageConfiguration.cpp:
+        (WebCore::PageConfiguration::PageConfiguration):
+        * page/PageConfiguration.h:
+        * svg/graphics/SVGImage.cpp:
+        (WebCore::SVGImage::dataChanged):
+
</ins><span class="cx"> 2016-06-10  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: Cleanup InspectorIndexedDBAgent a bit
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorOverlaycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorOverlay.cpp (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebCore/inspector/InspectorOverlay.cpp        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -864,7 +864,7 @@
</span><span class="cx">     if (m_overlayPage)
</span><span class="cx">         return m_overlayPage.get();
</span><span class="cx"> 
</span><del>-    PageConfiguration pageConfiguration;
</del><ins>+    PageConfiguration pageConfiguration(makeUniqueRef&lt;EmptyEditorClient&gt;());
</ins><span class="cx">     fillWithEmptyClients(pageConfiguration);
</span><span class="cx">     m_overlayPage = std::make_unique&lt;Page&gt;(WTFMove(pageConfiguration));
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.cpp        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -129,8 +129,6 @@
</span><span class="cx">     pageConfiguration.dragClient = &amp;dummyDragClient.get();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    pageConfiguration.editorClient = std::make_unique&lt;EmptyEditorClient&gt;();
-    
</del><span class="cx">     static NeverDestroyed&lt;EmptyInspectorClient&gt; dummyInspectorClient;
</span><span class="cx">     pageConfiguration.inspectorClient = &amp;dummyInspectorClient.get();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebCore/page/Page.cpp        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -238,7 +238,6 @@
</span><span class="cx">     , m_sessionID(SessionID::defaultSessionID())
</span><span class="cx">     , m_isClosing(false)
</span><span class="cx"> {
</span><del>-    ASSERT(m_editorClient);
</del><span class="cx">     updateTimerThrottlingState();
</span><span class="cx"> 
</span><span class="cx">     m_storageNamespaceProvider-&gt;addPage(*this);
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebCore/page/Page.h        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> #include &lt;wtf/Optional.h&gt;
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><ins>+#include &lt;wtf/UniqueRef.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if OS(SOLARIS)
</span><span class="lines">@@ -157,7 +158,7 @@
</span><span class="cx">     WEBCORE_EXPORT void setCanStartMedia(bool);
</span><span class="cx">     bool canStartMedia() const { return m_canStartMedia; }
</span><span class="cx"> 
</span><del>-    EditorClient&amp; editorClient() const { return *m_editorClient; }
</del><ins>+    EditorClient&amp; editorClient() { return m_editorClient.get(); }
</ins><span class="cx">     PlugInClient* plugInClient() const { return m_plugInClient; }
</span><span class="cx"> 
</span><span class="cx">     MainFrame&amp; mainFrame() { return m_mainFrame.get(); }
</span><span class="lines">@@ -174,7 +175,6 @@
</span><span class="cx">     WEBCORE_EXPORT const String&amp; groupName() const;
</span><span class="cx"> 
</span><span class="cx">     PageGroup&amp; group();
</span><del>-    PageGroup* groupPtr() { return m_group; } // can return 0
</del><span class="cx"> 
</span><span class="cx">     static void forEachPage(std::function&lt;void(Page&amp;)&gt;);
</span><span class="cx"> 
</span><span class="lines">@@ -583,7 +583,7 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;RenderTheme&gt; m_theme;
</span><span class="cx"> 
</span><del>-    std::unique_ptr&lt;EditorClient&gt; m_editorClient;
</del><ins>+    UniqueRef&lt;EditorClient&gt; m_editorClient;
</ins><span class="cx">     PlugInClient* m_plugInClient;
</span><span class="cx">     ValidationMessageClient* m_validationMessageClient;
</span><span class="cx">     std::unique_ptr&lt;DiagnosticLoggingClient&gt; m_diagnosticLoggingClient;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageConfiguration.cpp (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageConfiguration.cpp        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebCore/page/PageConfiguration.cpp        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -37,7 +37,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-PageConfiguration::PageConfiguration()
</del><ins>+PageConfiguration::PageConfiguration(UniqueRef&lt;EditorClient&gt;&amp;&amp; editorClient)
+    : editorClient(WTFMove(editorClient))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageConfiguration.h (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageConfiguration.h        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebCore/page/PageConfiguration.h        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -23,11 +23,11 @@
</span><span class="cx">  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
</span><span class="cx">  */
</span><span class="cx"> 
</span><del>-#ifndef PageConfiguration_h
-#define PageConfiguration_h
</del><ins>+#pragma once
</ins><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><ins>+#include &lt;wtf/UniqueRef.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if USE(APPLE_INTERNAL_SDK)
</span><span class="cx"> #include &lt;WebKitAdditions/PageConfigurationIncludes.h&gt;
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> class PageConfiguration {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(PageConfiguration); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    WEBCORE_EXPORT PageConfiguration();
</del><ins>+    WEBCORE_EXPORT PageConfiguration(UniqueRef&lt;EditorClient&gt;&amp;&amp;);
</ins><span class="cx">     WEBCORE_EXPORT ~PageConfiguration();
</span><span class="cx"> 
</span><span class="cx">     AlternativeTextClient* alternativeTextClient { nullptr };
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span><span class="cx">     ContextMenuClient* contextMenuClient { nullptr };
</span><span class="cx"> #endif
</span><del>-    std::unique_ptr&lt;EditorClient&gt; editorClient;
</del><ins>+    UniqueRef&lt;EditorClient&gt; editorClient;
</ins><span class="cx">     DragClient* dragClient { nullptr };
</span><span class="cx">     InspectorClient* inspectorClient { nullptr };
</span><span class="cx">     PlugInClient* plugInClient { nullptr };
</span><span class="lines">@@ -89,5 +89,3 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> }
</span><del>-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebCoresvggraphicsSVGImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/graphics/SVGImage.cpp (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/graphics/SVGImage.cpp        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebCore/svg/graphics/SVGImage.cpp        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -379,7 +379,7 @@
</span><span class="cx">         return true;
</span><span class="cx"> 
</span><span class="cx">     if (allDataReceived) {
</span><del>-        PageConfiguration pageConfiguration;
</del><ins>+        PageConfiguration pageConfiguration(makeUniqueRef&lt;EmptyEditorClient&gt;());
</ins><span class="cx">         fillWithEmptyClients(pageConfiguration);
</span><span class="cx">         m_chromeClient = std::make_unique&lt;SVGImageChromeClient&gt;(this);
</span><span class="cx">         pageConfiguration.chromeClient = m_chromeClient.get();
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-06-10  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Introduce WTF::UniqueRef
+        https://bugs.webkit.org/show_bug.cgi?id=158596
+
+        Reviewed by Brady Eidson.
+
+        * WebView/WebView.mm:
+        (-[WebView _commonInitializationWithFrameName:groupName:]):
+        (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
+
</ins><span class="cx"> 2016-06-09  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Clean up EditorClient lifetime
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -987,7 +987,7 @@
</span><span class="cx">     _private-&gt;group = WebViewGroup::getOrCreate(groupName, _private-&gt;preferences._localStorageDatabasePath);
</span><span class="cx">     _private-&gt;group-&gt;addWebView(self);
</span><span class="cx"> 
</span><del>-    PageConfiguration pageConfiguration;
</del><ins>+    PageConfiguration pageConfiguration(makeUniqueRef&lt;WebEditorClient&gt;(self));
</ins><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     pageConfiguration.chromeClient = new WebChromeClient(self);
</span><span class="cx">     pageConfiguration.contextMenuClient = new WebContextMenuClient(self);
</span><span class="lines">@@ -1004,7 +1004,6 @@
</span><span class="cx"> #import &lt;WebKitAdditions/WebViewInitialization.mm&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    pageConfiguration.editorClient = std::make_unique&lt;WebEditorClient&gt;(self);
</del><span class="cx">     pageConfiguration.alternativeTextClient = new WebAlternativeTextClient(self);
</span><span class="cx">     pageConfiguration.loaderClientForMainFrame = new WebFrameLoaderClient;
</span><span class="cx">     pageConfiguration.progressTrackerClient = new WebProgressTrackerClient(self);
</span><span class="lines">@@ -1238,7 +1237,7 @@
</span><span class="cx">     _private-&gt;group = WebViewGroup::getOrCreate(groupName, _private-&gt;preferences._localStorageDatabasePath);
</span><span class="cx">     _private-&gt;group-&gt;addWebView(self);
</span><span class="cx"> 
</span><del>-    PageConfiguration pageConfiguration;
</del><ins>+    PageConfiguration pageConfiguration(makeUniqueRef&lt;WebEditorClient&gt;(self));
</ins><span class="cx">     pageConfiguration.chromeClient = new WebChromeClientIOS(self);
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="cx">     pageConfiguration.dragClient = new WebDragClient(self);
</span><span class="lines">@@ -1248,7 +1247,6 @@
</span><span class="cx"> #import &lt;WebKitAdditions/WebViewInitialization.mm&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    pageConfiguration.editorClient = std::make_unique&lt;WebEditorClient&gt;(self);
</del><span class="cx">     pageConfiguration.inspectorClient = new WebInspectorClient(self);
</span><span class="cx">     pageConfiguration.loaderClientForMainFrame = new WebFrameLoaderClient;
</span><span class="cx">     pageConfiguration.progressTrackerClient = new WebProgressTrackerClient(self);
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebKit/win/ChangeLog        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-06-10  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Introduce WTF::UniqueRef
+        https://bugs.webkit.org/show_bug.cgi?id=158596
+
+        Reviewed by Brady Eidson.
+
+        * WebView.cpp:
+        (WebView::initWithFrame):
+
</ins><span class="cx"> 2016-06-09  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix Windows build.
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebKit/win/WebView.cpp        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -164,6 +164,7 @@
</span><span class="cx"> #include &lt;bindings/ScriptValue.h&gt;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/RAMSize.h&gt;
</span><ins>+#include &lt;wtf/UniqueRef.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> #include &lt;CoreGraphics/CGContext.h&gt;
</span><span class="lines">@@ -2908,10 +2909,9 @@
</span><span class="cx"> 
</span><span class="cx">     m_inspectorClient = new WebInspectorClient(this);
</span><span class="cx"> 
</span><del>-    PageConfiguration configuration;
</del><ins>+    PageConfiguration configuration(makeUniqueRef&lt;WebEditorClient&gt;(this));
</ins><span class="cx">     configuration.chromeClient = new WebChromeClient(this);
</span><span class="cx">     configuration.contextMenuClient = new WebContextMenuClient(this);
</span><del>-    configuration.editorClient = std::make_unique&lt;WebEditorClient&gt;(this);
</del><span class="cx">     configuration.dragClient = new WebDragClient(this);
</span><span class="cx">     configuration.inspectorClient = m_inspectorClient;
</span><span class="cx">     configuration.loaderClientForMainFrame = new WebFrameLoaderClient;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebKit2/ChangeLog        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-06-10  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Introduce WTF::UniqueRef
+        https://bugs.webkit.org/show_bug.cgi?id=158596
+
+        Reviewed by Brady Eidson.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::m_shouldDispatchFakeMouseMoveEvents):
+
</ins><span class="cx"> 2016-06-10  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove CommandLine class
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -384,12 +384,11 @@
</span><span class="cx">     Settings::setShouldManageAudioSessionCategory(true);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    PageConfiguration pageConfiguration;
</del><ins>+    PageConfiguration pageConfiguration(makeUniqueRef&lt;WebEditorClient&gt;(this));
</ins><span class="cx">     pageConfiguration.chromeClient = new WebChromeClient(this);
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span><span class="cx">     pageConfiguration.contextMenuClient = new WebContextMenuClient(this);
</span><span class="cx"> #endif
</span><del>-    pageConfiguration.editorClient = std::make_unique&lt;WebEditorClient&gt;(this);
</del><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="cx">     pageConfiguration.dragClient = new WebDragClient(this);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Tools/ChangeLog        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-06-10  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Introduce WTF::UniqueRef
+        https://bugs.webkit.org/show_bug.cgi?id=158596
+
+        Reviewed by Brady Eidson.
+
+        * TestWebKitAPI/CMakeLists.txt:
+        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+        * TestWebKitAPI/Tests/WTF/UniqueRef.cpp: Added.
+        (TestWebKitAPI::B::B):
+        (TestWebKitAPI::C::C):
+        (TestWebKitAPI::function):
+        (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2016-06-10  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Refactor TestWebKitAPI to allow just testing WTF
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPICMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/CMakeLists.txt (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/CMakeLists.txt        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Tools/TestWebKitAPI/CMakeLists.txt        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -75,6 +75,7 @@
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WTF/StringOperators.cpp
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WTF/StringView.cpp
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WTF/TemporaryChange.cpp
</span><ins>+    ${TESTWEBKITAPI_DIR}/Tests/WTF/UniqueRef.cpp
</ins><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WTF/Vector.cpp
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WTF/WTFString.cpp
</span><span class="cx">     ${TESTWEBKITAPI_DIR}/Tests/WTF/WeakPtr.cpp
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (201940 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-06-10 21:01:55 UTC (rev 201940)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -731,6 +731,7 @@
</span><span class="cx">                 5798E2AF1CAF5C2800C5CBA0 /* ProvisionalURLNotChange.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProvisionalURLNotChange.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 57F10D921C7E7B3800ECDF30 /* IsNavigationActionTrusted.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = IsNavigationActionTrusted.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 57F56A5B1C7F8A4000F31D7E /* IsNavigationActionTrusted.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = IsNavigationActionTrusted.html; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                5C5E633D1D0B67940085A025 /* UniqueRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueRef.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7560917719259C59009EF06E /* MemoryCacheAddImageToCacheIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MemoryCacheAddImageToCacheIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 75F3133F18C171B70041CAEC /* EphemeralSessionPushStateNoHistoryCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EphemeralSessionPushStateNoHistoryCallback.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 764322D51B61CCA40024F801 /* WordBoundaryTypingAttributes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WordBoundaryTypingAttributes.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1431,6 +1432,7 @@
</span><span class="cx">                 BC9096461255618900083756 /* WTF */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                5C5E633D1D0B67940085A025 /* UniqueRef.cpp */,
</ins><span class="cx">                                 C0991C4F143C7D68007998F2 /* cf */,
</span><span class="cx">                                 7CBBA07519BB8A0900BBF025 /* darwin */,
</span><span class="cx">                                 BC029B1A1486B23800817DA9 /* ns */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWTFUniqueRefcpp"></a>
<div class="addfile"><h4>Added: trunk/Tools/TestWebKitAPI/Tests/WTF/UniqueRef.cpp (0 => 201941)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WTF/UniqueRef.cpp                                (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/UniqueRef.cpp        2016-06-10 21:26:00 UTC (rev 201941)
</span><span class="lines">@@ -0,0 +1,94 @@
</span><ins>+/*
+ * Copyright (C) 2016 Apple Inc. All rights reserved.
+ *
+ * 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.
+ */
+
+#include &quot;config.h&quot;
+
+#include &lt;wtf/UniqueRef.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace TestWebKitAPI {
+    
+class A { };
+class B {
+public:
+    B(int a, int b, int c)
+        : a(a)
+        , b(b)
+        , c(c)
+    { };
+    int a;
+    int b;
+    int c;
+};
+class C {
+public:
+    C(UniqueRef&lt;A&gt;&amp;&amp; a)
+        : a(WTFMove(a))
+    { }
+    UniqueRef&lt;A&gt; a;
+};
+class D : public A { };
+
+void function(const UniqueRef&lt;A&gt; a)
+{
+    const A&amp; b = a.get();
+    const A* c = &amp;a;
+    UNUSED_PARAM(b);
+    UNUSED_PARAM(c);
+}
+
+TEST(WTF, UniqueRef)
+{
+    UniqueRef&lt;A&gt; a = makeUniqueRef&lt;A&gt;();
+    UniqueRef&lt;B&gt; b = makeUniqueRef&lt;B&gt;(1, 2, 3);
+    B&amp; c = b.get();
+    const B&amp; d = b.get();
+    B* e = &amp;b;
+    const B* f = &amp;b;
+    UniqueRef&lt;A&gt; j = WTFMove(a);
+    
+    Vector&lt;UniqueRef&lt;B&gt;&gt; v;
+    v.append(makeUniqueRef&lt;B&gt;(4, 5, 6));
+    v.append(makeUniqueRef&lt;B&gt;(7, 8, 9));
+    UniqueRef&lt;B&gt; g = v.takeLast();
+    ASSERT_EQ(g-&gt;b, 8);
+    ASSERT_EQ(v.last()-&gt;b, 5);
+    
+    C h(makeUniqueRef&lt;A&gt;());
+    C i(makeUniqueRef&lt;D&gt;());
+    
+    UNUSED_PARAM(a);
+    UNUSED_PARAM(b);
+    UNUSED_PARAM(c);
+    UNUSED_PARAM(d);
+    UNUSED_PARAM(e);
+    UNUSED_PARAM(f);
+    UNUSED_PARAM(g);
+    UNUSED_PARAM(h);
+    UNUSED_PARAM(i);
+    UNUSED_PARAM(j);
+}
+
+} // namespace TestWebKitAPI
</ins></span></pre>
</div>
</div>

</body>
</html>