<!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>[201406] 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/201406">201406</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2016-05-25 15:56:58 -0700 (Wed, 25 May 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Get rid of WTF/Functional.h
https://bugs.webkit.org/show_bug.cgi?id=158081
Reviewed by Chris Dumez.
Source/WebCore:
* Modules/mediastream/MediaStreamTrack.cpp:
Source/WTF:
This is no longer used, and removing it will free up the name for a new Functional.h implementation.
* WTF.xcodeproj/project.pbxproj:
* wtf/Functional.h: Removed.
(WTF::RefAndDeref::ref): Deleted.
(WTF::RefAndDeref::deref): Deleted.
(WTF::ParamStorageTraits::wrap): Deleted.
(WTF::ParamStorageTraits::unwrap): Deleted.
(WTF::ParamStorageTraits<PassRefPtr<T>>::wrap): Deleted.
(WTF::ParamStorageTraits<PassRefPtr<T>>::unwrap): Deleted.
(WTF::ParamStorageTraits<RefPtr<T>>::wrap): Deleted.
(WTF::ParamStorageTraits<RefPtr<T>>::unwrap): Deleted.
(WTF::ParamStorageTraits<RetainPtr<T>>::wrap): Deleted.
(WTF::ParamStorageTraits<RetainPtr<T>>::unwrap): Deleted.
(WTF::FunctionImplBase::~FunctionImplBase): Deleted.
(WTF::FunctionBase::isNull): Deleted.
(WTF::FunctionBase::FunctionBase): Deleted.
(WTF::FunctionBase::impl): Deleted.
(WTF::bind): Deleted.
* wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
Tools:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/Functional.cpp: Removed.
(TestWebKitAPI::returnFortyTwo): Deleted.
(TestWebKitAPI::TEST): Deleted.
(TestWebKitAPI::multiplyByTwo): Deleted.
(TestWebKitAPI::multiplyByOneAndAHalf): Deleted.
(TestWebKitAPI::multiply): Deleted.
(TestWebKitAPI::subtract): Deleted.
(TestWebKitAPI::A::A): Deleted.
(TestWebKitAPI::A::f): Deleted.
(TestWebKitAPI::A::addF): Deleted.
(TestWebKitAPI::B::B): Deleted.
(TestWebKitAPI::B::~B): Deleted.
(TestWebKitAPI::B::ref): Deleted.
(TestWebKitAPI::B::deref): Deleted.
(TestWebKitAPI::B::f): Deleted.
(TestWebKitAPI::B::g): Deleted.
(TestWebKitAPI::Number::create): Deleted.
(TestWebKitAPI::Number::~Number): Deleted.
(TestWebKitAPI::Number::value): Deleted.
(TestWebKitAPI::Number::Number): Deleted.
(TestWebKitAPI::multiplyNumberByTwo): Deleted.</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="#trunkSourceWTFwtfmacDeprecatedSymbolsUsedBySafarimm">trunk/Source/WTF/wtf/mac/DeprecatedSymbolsUsedBySafari.mm</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamMediaStreamTrackcpp">trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.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>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWTFwtfFunctionalh">trunk/Source/WTF/wtf/Functional.h</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWTFFunctionalcpp">trunk/Tools/TestWebKitAPI/Tests/WTF/Functional.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (201405 => 201406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-05-25 22:07:17 UTC (rev 201405)
+++ trunk/Source/WTF/ChangeLog        2016-05-25 22:56:58 UTC (rev 201406)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2016-05-25 Anders Carlsson <andersca@apple.com>
+
+ Get rid of WTF/Functional.h
+ https://bugs.webkit.org/show_bug.cgi?id=158081
+
+ Reviewed by Chris Dumez.
+
+ This is no longer used, and removing it will free up the name for a new Functional.h implementation.
+
+ * WTF.xcodeproj/project.pbxproj:
+ * wtf/Functional.h: Removed.
+ (WTF::RefAndDeref::ref): Deleted.
+ (WTF::RefAndDeref::deref): Deleted.
+ (WTF::ParamStorageTraits::wrap): Deleted.
+ (WTF::ParamStorageTraits::unwrap): Deleted.
+ (WTF::ParamStorageTraits<PassRefPtr<T>>::wrap): Deleted.
+ (WTF::ParamStorageTraits<PassRefPtr<T>>::unwrap): Deleted.
+ (WTF::ParamStorageTraits<RefPtr<T>>::wrap): Deleted.
+ (WTF::ParamStorageTraits<RefPtr<T>>::unwrap): Deleted.
+ (WTF::ParamStorageTraits<RetainPtr<T>>::wrap): Deleted.
+ (WTF::ParamStorageTraits<RetainPtr<T>>::unwrap): Deleted.
+ (WTF::FunctionImplBase::~FunctionImplBase): Deleted.
+ (WTF::FunctionBase::isNull): Deleted.
+ (WTF::FunctionBase::FunctionBase): Deleted.
+ (WTF::FunctionBase::impl): Deleted.
+ (WTF::bind): Deleted.
+ * wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
+
</ins><span class="cx"> 2016-05-24 Keith Miller <keith_miller@apple.com>
</span><span class="cx">
</span><span class="cx"> LLInt should be able to cache prototype loads for values in GetById
</span></span></pre></div>
<a id="trunkSourceWTFWTFxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (201405 => 201406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj        2016-05-25 22:07:17 UTC (rev 201405)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj        2016-05-25 22:56:58 UTC (rev 201406)
</span><span class="lines">@@ -187,7 +187,6 @@
</span><span class="cx">                 A8A473C3151A825B004123FF /* FastMalloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8A472A1151A825A004123FF /* FastMalloc.cpp */; };
</span><span class="cx">                 A8A473C4151A825B004123FF /* FastMalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A2151A825A004123FF /* FastMalloc.h */; };
</span><span class="cx">                 A8A473C8151A825B004123FF /* Forward.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A6151A825A004123FF /* Forward.h */; };
</span><del>-                A8A473C9151A825B004123FF /* Functional.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A7151A825A004123FF /* Functional.h */; };
</del><span class="cx">                 A8A473CA151A825B004123FF /* GetPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472A8151A825A004123FF /* GetPtr.h */; };
</span><span class="cx">                 A8A473D3151A825B004123FF /* HashCountedSet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B3151A825A004123FF /* HashCountedSet.h */; };
</span><span class="cx">                 A8A473D4151A825B004123FF /* HashFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A472B4151A825A004123FF /* HashFunctions.h */; };
</span><span class="lines">@@ -301,12 +300,12 @@
</span><span class="cx">                 CD5497AD15857D0300B5BC30 /* MediaTime.h in Headers */ = {isa = PBXBuildFile; fileRef = CD5497AB15857D0300B5BC30 /* MediaTime.h */; };
</span><span class="cx">                 CE46516E19DB1FB4003ECA05 /* NSMapTableSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE46516D19DB1FB4003ECA05 /* NSMapTableSPI.h */; };
</span><span class="cx">                 CE73E02519DCB7AB00580D5C /* XPCSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE73E02419DCB7AB00580D5C /* XPCSPI.h */; };
</span><del>-                DCEE22051CEB9869000C2396 /* BackwardsGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = DCEE22041CEB9869000C2396 /* BackwardsGraph.h */; };
</del><span class="cx">                 DCEE21FB1CEA7538000C2396 /* CFBundleSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = DCEE21FA1CEA7538000C2396 /* CFBundleSPI.h */; };
</span><span class="cx">                 DCEE22001CEA7551000C2396 /* BlockObjCExceptions.h in Headers */ = {isa = PBXBuildFile; fileRef = DCEE21FC1CEA7551000C2396 /* BlockObjCExceptions.h */; };
</span><span class="cx">                 DCEE22011CEA7551000C2396 /* BlockObjCExceptions.mm in Sources */ = {isa = PBXBuildFile; fileRef = DCEE21FD1CEA7551000C2396 /* BlockObjCExceptions.mm */; };
</span><span class="cx">                 DCEE22021CEA7551000C2396 /* PlatformUserPreferredLanguages.h in Headers */ = {isa = PBXBuildFile; fileRef = DCEE21FE1CEA7551000C2396 /* PlatformUserPreferredLanguages.h */; };
</span><span class="cx">                 DCEE22031CEA7551000C2396 /* PlatformUserPreferredLanguagesMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = DCEE21FF1CEA7551000C2396 /* PlatformUserPreferredLanguagesMac.mm */; };
</span><ins>+                DCEE22051CEB9869000C2396 /* BackwardsGraph.h in Headers */ = {isa = PBXBuildFile; fileRef = DCEE22041CEB9869000C2396 /* BackwardsGraph.h */; };
</ins><span class="cx">                 DE5A09FC1BA36992003D4424 /* CommonCryptoSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = DE5A09FB1BA36992003D4424 /* CommonCryptoSPI.h */; };
</span><span class="cx">                 E15556F518A0CC18006F48FB /* CryptographicUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E15556F318A0CC18006F48FB /* CryptographicUtilities.cpp */; };
</span><span class="cx">                 E15556F618A0CC18006F48FB /* CryptographicUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = E15556F418A0CC18006F48FB /* CryptographicUtilities.h */; };
</span><span class="lines">@@ -514,7 +513,6 @@
</span><span class="cx">                 A8A472A1151A825A004123FF /* FastMalloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FastMalloc.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 A8A472A2151A825A004123FF /* FastMalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FastMalloc.h; sourceTree = "<group>"; };
</span><span class="cx">                 A8A472A6151A825A004123FF /* Forward.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Forward.h; sourceTree = "<group>"; };
</span><del>-                A8A472A7151A825A004123FF /* Functional.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Functional.h; sourceTree = "<group>"; };
</del><span class="cx">                 A8A472A8151A825A004123FF /* GetPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GetPtr.h; sourceTree = "<group>"; };
</span><span class="cx">                 A8A472B3151A825A004123FF /* HashCountedSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashCountedSet.h; sourceTree = "<group>"; };
</span><span class="cx">                 A8A472B4151A825A004123FF /* HashFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashFunctions.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -628,12 +626,12 @@
</span><span class="cx">                 CD5497AB15857D0300B5BC30 /* MediaTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaTime.h; sourceTree = "<group>"; };
</span><span class="cx">                 CE46516D19DB1FB4003ECA05 /* NSMapTableSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSMapTableSPI.h; sourceTree = "<group>"; };
</span><span class="cx">                 CE73E02419DCB7AB00580D5C /* XPCSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPCSPI.h; sourceTree = "<group>"; };
</span><del>-                DCEE22041CEB9869000C2396 /* BackwardsGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackwardsGraph.h; sourceTree = "<group>"; };
</del><span class="cx">                 DCEE21FA1CEA7538000C2396 /* CFBundleSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFBundleSPI.h; path = cf/CFBundleSPI.h; sourceTree = "<group>"; };
</span><span class="cx">                 DCEE21FC1CEA7551000C2396 /* BlockObjCExceptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockObjCExceptions.h; sourceTree = "<group>"; };
</span><span class="cx">                 DCEE21FD1CEA7551000C2396 /* BlockObjCExceptions.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BlockObjCExceptions.mm; sourceTree = "<group>"; };
</span><span class="cx">                 DCEE21FE1CEA7551000C2396 /* PlatformUserPreferredLanguages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformUserPreferredLanguages.h; sourceTree = "<group>"; };
</span><span class="cx">                 DCEE21FF1CEA7551000C2396 /* PlatformUserPreferredLanguagesMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformUserPreferredLanguagesMac.mm; sourceTree = "<group>"; };
</span><ins>+                DCEE22041CEB9869000C2396 /* BackwardsGraph.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackwardsGraph.h; sourceTree = "<group>"; };
</ins><span class="cx">                 DE5A09FB1BA36992003D4424 /* CommonCryptoSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonCryptoSPI.h; sourceTree = "<group>"; };
</span><span class="cx">                 E15556F318A0CC18006F48FB /* CryptographicUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptographicUtilities.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 E15556F418A0CC18006F48FB /* CryptographicUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptographicUtilities.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -826,7 +824,6 @@
</span><span class="cx">                                 0F9D335C165DBA73005AD387 /* FilePrintStream.h */,
</span><span class="cx">                                 0F2B66A517B6B4F700A7AE3F /* FlipBytes.h */,
</span><span class="cx">                                 A8A472A6151A825A004123FF /* Forward.h */,
</span><del>-                                A8A472A7151A825A004123FF /* Functional.h */,
</del><span class="cx">                                 1A1D8B9D1731879800141DA4 /* FunctionDispatcher.cpp */,
</span><span class="cx">                                 1A1D8B9B173186CE00141DA4 /* FunctionDispatcher.h */,
</span><span class="cx">                                 A8A472A8151A825A004123FF /* GetPtr.h */,
</span><span class="lines">@@ -1221,7 +1218,6 @@
</span><span class="cx">                                 A8A473B6151A825B004123FF /* fixed-dtoa.h in Headers */,
</span><span class="cx">                                 0F2B66A717B6B4FD00A7AE3F /* FlipBytes.h in Headers */,
</span><span class="cx">                                 A8A473C8151A825B004123FF /* Forward.h in Headers */,
</span><del>-                                A8A473C9151A825B004123FF /* Functional.h in Headers */,
</del><span class="cx">                                 1A1D8B9C173186CE00141DA4 /* FunctionDispatcher.h in Headers */,
</span><span class="cx">                                 A8A473CA151A825B004123FF /* GetPtr.h in Headers */,
</span><span class="cx">                                 0FEC84AF1BD825310080FF74 /* GraphNodeWorklist.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWTFwtfCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/CMakeLists.txt (201405 => 201406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/CMakeLists.txt        2016-05-25 22:07:17 UTC (rev 201405)
+++ trunk/Source/WTF/wtf/CMakeLists.txt        2016-05-25 22:56:58 UTC (rev 201406)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> FlipBytes.h
</span><span class="cx"> Forward.h
</span><span class="cx"> FunctionDispatcher.h
</span><del>- Functional.h
</del><span class="cx"> GetPtr.h
</span><span class="cx"> GraphNodeWorklist.h
</span><span class="cx"> GregorianDateTime.h
</span></span></pre></div>
<a id="trunkSourceWTFwtfFunctionalh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WTF/wtf/Functional.h (201405 => 201406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/Functional.h        2016-05-25 22:07:17 UTC (rev 201405)
+++ trunk/Source/WTF/wtf/Functional.h        2016-05-25 22:56:58 UTC (rev 201406)
</span><span class="lines">@@ -1,782 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 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.
- */
-
-#ifndef WTF_Functional_h
-#define WTF_Functional_h
-
-#include <wtf/Assertions.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
-#include <wtf/ThreadSafeRefCounted.h>
-#include <wtf/WeakPtr.h>
-
-#if OS(DARWIN) && COMPILER_SUPPORTS(BLOCKS)
-#include <Block.h>
-#include <wtf/ObjcRuntimeExtras.h>
-#endif
-
-namespace WTF {
-
-// Functional.h provides a very simple way to bind a function pointer and arguments together into a function object
-// that can be stored, copied and invoked, similar to how boost::bind and std::bind in C++11.
-
-// Helper class template to determine whether a given type has ref and deref member functions
-// with the right type signature.
-template<typename T>
-class HasRefAndDeref {
- typedef char YesType;
- struct NoType {
- char padding[8];
- };
-
- struct BaseMixin {
- void deref();
- void ref();
- };
-
- struct Base : public T, public BaseMixin { };
-
- template<typename U, U> struct
- TypeChecker { };
-
- template<typename U>
- static NoType refCheck(U*, TypeChecker<void (BaseMixin::*)(), &U::ref>* = 0);
- static YesType refCheck(...);
-
- template<typename U>
- static NoType derefCheck(U*, TypeChecker<void (BaseMixin::*)(), &U::deref>* = 0);
- static YesType derefCheck(...);
-
-public:
- static const bool value = sizeof(refCheck(static_cast<Base*>(0))) == sizeof(YesType) && sizeof(derefCheck(static_cast<Base*>(0))) == sizeof(YesType);
-};
-
-// A FunctionWrapper is a class template that can wrap a function pointer or a member function pointer and
-// provide a unified interface for calling that function.
-template<typename>
-class FunctionWrapper;
-
-// Bound static functions:
-
-template<typename R>
-class FunctionWrapper<R (*)()> {
-public:
- typedef R ResultType;
- static const bool shouldRefFirstParameter = false;
-
- explicit FunctionWrapper(R (*function)())
- : m_function(function)
- {
- }
-
- R operator()()
- {
- return m_function();
- }
-
-private:
- R (*m_function)();
-};
-
-template<typename R, typename P1>
-class FunctionWrapper<R (*)(P1)> {
-public:
- typedef R ResultType;
- static const bool shouldRefFirstParameter = false;
-
- explicit FunctionWrapper(R (*function)(P1))
- : m_function(function)
- {
- }
-
- R operator()(P1 p1)
- {
- return m_function(p1);
- }
-
-private:
- R (*m_function)(P1);
-};
-
-template<typename R, typename P1, typename P2>
-class FunctionWrapper<R (*)(P1, P2)> {
-public:
- typedef R ResultType;
- static const bool shouldRefFirstParameter = false;
-
- explicit FunctionWrapper(R (*function)(P1, P2))
- : m_function(function)
- {
- }
-
- R operator()(P1 p1, P2 p2)
- {
- return m_function(p1, p2);
- }
-
-private:
- R (*m_function)(P1, P2);
-};
-
-template<typename R, typename P1, typename P2, typename P3>
-class FunctionWrapper<R (*)(P1, P2, P3)> {
-public:
- typedef R ResultType;
- static const bool shouldRefFirstParameter = false;
-
- explicit FunctionWrapper(R (*function)(P1, P2, P3))
- : m_function(function)
- {
- }
-
- R operator()(P1 p1, P2 p2, P3 p3)
- {
- return m_function(p1, p2, p3);
- }
-
-private:
- R (*m_function)(P1, P2, P3);
-};
-
-template<typename R, typename P1, typename P2, typename P3, typename P4>
-class FunctionWrapper<R (*)(P1, P2, P3, P4)> {
-public:
- typedef R ResultType;
- static const bool shouldRefFirstParameter = false;
-
- explicit FunctionWrapper(R (*function)(P1, P2, P3, P4))
- : m_function(function)
- {
- }
-
- R operator()(P1 p1, P2 p2, P3 p3, P4 p4)
- {
- return m_function(p1, p2, p3, p4);
- }
-
-private:
- R (*m_function)(P1, P2, P3, P4);
-};
-
-template<typename R, typename P1, typename P2, typename P3, typename P4, typename P5>
-class FunctionWrapper<R (*)(P1, P2, P3, P4, P5)> {
-public:
- typedef R ResultType;
- static const bool shouldRefFirstParameter = false;
-
- explicit FunctionWrapper(R (*function)(P1, P2, P3, P4, P5))
- : m_function(function)
- {
- }
-
- R operator()(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
- {
- return m_function(p1, p2, p3, p4, p5);
- }
-
-private:
- R (*m_function)(P1, P2, P3, P4, P5);
-};
-
-// Bound member functions:
-
-template<typename R, typename C>
-class FunctionWrapper<R (C::*)()> {
-public:
- typedef R ResultType;
- static const bool shouldRefFirstParameter = HasRefAndDeref<C>::value;
-
- explicit FunctionWrapper(R (C::*function)())
- : m_function(function)
- {
- }
-
- R operator()(C* c)
- {
- return (c->*m_function)();
- }
-
- R operator()(const WeakPtr<C>& c)
- {
- C* obj = c.get();
- if (!obj)
- return R();
- return (obj->*m_function)();
- }
-
-private:
- R (C::*m_function)();
-};
-
-template<typename R, typename C, typename P1>
-class FunctionWrapper<R (C::*)(P1)> {
-public:
- typedef R ResultType;
- static const bool shouldRefFirstParameter = HasRefAndDeref<C>::value;
-
- explicit FunctionWrapper(R (C::*function)(P1))
- : m_function(function)
- {
- }
-
- R operator()(C* c, P1 p1)
- {
- return (c->*m_function)(p1);
- }
-
- R operator()(const WeakPtr<C>& c, P1 p1)
- {
- C* obj = c.get();
- if (!obj)
- return R();
- return (obj->*m_function)(p1);
- }
-
-private:
- R (C::*m_function)(P1);
-};
-
-template<typename R, typename C, typename P1, typename P2>
-class FunctionWrapper<R (C::*)(P1, P2)> {
-public:
- typedef R ResultType;
- static const bool shouldRefFirstParameter = HasRefAndDeref<C>::value;
-
- explicit FunctionWrapper(R (C::*function)(P1, P2))
- : m_function(function)
- {
- }
-
- R operator()(C* c, P1 p1, P2 p2)
- {
- return (c->*m_function)(p1, p2);
- }
-
- R operator()(const WeakPtr<C>& c, P1 p1, P2 p2)
- {
- C* obj = c.get();
- if (!obj)
- return R();
- return (obj->*m_function)(p1, p2);
- }
-
-private:
- R (C::*m_function)(P1, P2);
-};
-
-template<typename R, typename C, typename P1, typename P2, typename P3>
-class FunctionWrapper<R (C::*)(P1, P2, P3)> {
-public:
- typedef R ResultType;
- static const bool shouldRefFirstParameter = HasRefAndDeref<C>::value;
-
- explicit FunctionWrapper(R (C::*function)(P1, P2, P3))
- : m_function(function)
- {
- }
-
- R operator()(C* c, P1 p1, P2 p2, P3 p3)
- {
- return (c->*m_function)(p1, p2, p3);
- }
-
- R operator()(const WeakPtr<C>& c, P1 p1, P2 p2, P3 p3)
- {
- C* obj = c.get();
- if (!obj)
- return R();
- return (obj->*m_function)(p1, p2, p3);
- }
-
-private:
- R (C::*m_function)(P1, P2, P3);
-};
-
-template<typename R, typename C, typename P1, typename P2, typename P3, typename P4>
-class FunctionWrapper<R (C::*)(P1, P2, P3, P4)> {
-public:
- typedef R ResultType;
- static const bool shouldRefFirstParameter = HasRefAndDeref<C>::value;
-
- explicit FunctionWrapper(R (C::*function)(P1, P2, P3, P4))
- : m_function(function)
- {
- }
-
- R operator()(C* c, P1 p1, P2 p2, P3 p3, P4 p4)
- {
- return (c->*m_function)(p1, p2, p3, p4);
- }
-
- R operator()(const WeakPtr<C>& c, P1 p1, P2 p2, P3 p3, P4 p4)
- {
- C* obj = c.get();
- if (!obj)
- return R();
- return (obj->*m_function)(p1, p2, p3, p4);
- }
-
-private:
- R (C::*m_function)(P1, P2, P3, P4);
-};
-
-template<typename R, typename C, typename P1, typename P2, typename P3, typename P4, typename P5>
-class FunctionWrapper<R (C::*)(P1, P2, P3, P4, P5)> {
-public:
- typedef R ResultType;
- static const bool shouldRefFirstParameter = HasRefAndDeref<C>::value;
-
- explicit FunctionWrapper(R (C::*function)(P1, P2, P3, P4, P5))
- : m_function(function)
- {
- }
-
- R operator()(C* c, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
- {
- return (c->*m_function)(p1, p2, p3, p4, p5);
- }
-
- R operator()(const WeakPtr<C>& c, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5)
- {
- C* obj = c.get();
- if (!obj)
- return R();
- return (obj->*m_function)(p1, p2, p3, p4, p5);
- }
-
-private:
- R (C::*m_function)(P1, P2, P3, P4, P5);
-};
-
-#if OS(DARWIN) && COMPILER_SUPPORTS(BLOCKS)
-template<typename R>
-class FunctionWrapper<R (^)()> {
-public:
- typedef R ResultType;
- static const bool shouldRefFirstParameter = false;
-
- explicit FunctionWrapper(R (^block)())
- : m_block(Block_copy(block))
- {
- }
-
- FunctionWrapper(const FunctionWrapper& other)
- : m_block(Block_copy(other.m_block))
- {
- }
-
- ~FunctionWrapper()
- {
- Block_release(m_block);
- }
-
- R operator()()
- {
- return m_block();
- }
-
-private:
- R (^m_block)();
-};
-#endif
-
-template<typename T, bool shouldRefAndDeref> struct RefAndDeref {
- static void ref(T) { }
- static void deref(T) { }
-};
-
-template<typename T> struct RefAndDeref<T*, true> {
- static void ref(T* t) { t->ref(); }
- static void deref(T* t) { t->deref(); }
-};
-
-template<typename T> struct ParamStorageTraits {
- typedef T StorageType;
-
- static StorageType wrap(const T& value) { return value; }
- static const T& unwrap(const StorageType& value) { return value; }
-};
-
-template<typename T> struct ParamStorageTraits<PassRefPtr<T>> {
- typedef RefPtr<T> StorageType;
-
- static StorageType wrap(PassRefPtr<T> value) { return value; }
- static T* unwrap(const StorageType& value) { return value.get(); }
-};
-
-template<typename T> struct ParamStorageTraits<RefPtr<T>> {
- typedef RefPtr<T> StorageType;
-
- static StorageType wrap(RefPtr<T> value) { return value.release(); }
- static T* unwrap(const StorageType& value) { return value.get(); }
-};
-
-template<typename> class RetainPtr;
-
-template<typename T> struct ParamStorageTraits<RetainPtr<T>> {
- typedef RetainPtr<T> StorageType;
-
- static StorageType wrap(const RetainPtr<T>& value) { return value; }
- static typename RetainPtr<T>::PtrType unwrap(const StorageType& value) { return value.get(); }
-};
-
-class FunctionImplBase : public ThreadSafeRefCounted<FunctionImplBase> {
-public:
- virtual ~FunctionImplBase() { }
-};
-
-template<typename>
-class FunctionImpl;
-
-template<typename R>
-class FunctionImpl<R ()> : public FunctionImplBase {
-public:
- virtual R operator()() = 0;
-};
-
-template<typename FunctionWrapper, typename FunctionType>
-class BoundFunctionImpl;
-
-template<typename FunctionWrapper, typename R>
-class BoundFunctionImpl<FunctionWrapper, R ()> : public FunctionImpl<typename FunctionWrapper::ResultType ()> {
-public:
- explicit BoundFunctionImpl(FunctionWrapper functionWrapper)
- : m_functionWrapper(functionWrapper)
- {
- }
-
- virtual typename FunctionWrapper::ResultType operator()()
- {
- return m_functionWrapper();
- }
-
-private:
- FunctionWrapper m_functionWrapper;
-};
-
-template<typename FunctionWrapper, typename R, typename P1>
-class BoundFunctionImpl<FunctionWrapper, R (P1)> : public FunctionImpl<typename FunctionWrapper::ResultType ()> {
-public:
- BoundFunctionImpl(FunctionWrapper functionWrapper, const P1& p1)
- : m_functionWrapper(functionWrapper)
- , m_p1(ParamStorageTraits<P1>::wrap(p1))
- {
- RefAndDeref<P1, FunctionWrapper::shouldRefFirstParameter>::ref(m_p1);
- }
-
- ~BoundFunctionImpl()
- {
- RefAndDeref<P1, FunctionWrapper::shouldRefFirstParameter>::deref(m_p1);
- }
-
- virtual typename FunctionWrapper::ResultType operator()()
- {
- return m_functionWrapper(ParamStorageTraits<P1>::unwrap(m_p1));
- }
-
-private:
- FunctionWrapper m_functionWrapper;
- typename ParamStorageTraits<P1>::StorageType m_p1;
-};
-
-template<typename FunctionWrapper, typename R, typename P1, typename P2>
-class BoundFunctionImpl<FunctionWrapper, R (P1, P2)> : public FunctionImpl<typename FunctionWrapper::ResultType ()> {
-public:
- BoundFunctionImpl(FunctionWrapper functionWrapper, const P1& p1, const P2& p2)
- : m_functionWrapper(functionWrapper)
- , m_p1(ParamStorageTraits<P1>::wrap(p1))
- , m_p2(ParamStorageTraits<P2>::wrap(p2))
- {
- RefAndDeref<P1, FunctionWrapper::shouldRefFirstParameter>::ref(m_p1);
- }
-
- ~BoundFunctionImpl()
- {
- RefAndDeref<P1, FunctionWrapper::shouldRefFirstParameter>::deref(m_p1);
- }
-
- virtual typename FunctionWrapper::ResultType operator()()
- {
- return m_functionWrapper(ParamStorageTraits<P1>::unwrap(m_p1), ParamStorageTraits<P2>::unwrap(m_p2));
- }
-
-private:
- FunctionWrapper m_functionWrapper;
- typename ParamStorageTraits<P1>::StorageType m_p1;
- typename ParamStorageTraits<P2>::StorageType m_p2;
-};
-
-template<typename FunctionWrapper, typename R, typename P1, typename P2, typename P3>
-class BoundFunctionImpl<FunctionWrapper, R (P1, P2, P3)> : public FunctionImpl<typename FunctionWrapper::ResultType ()> {
-public:
- BoundFunctionImpl(FunctionWrapper functionWrapper, const P1& p1, const P2& p2, const P3& p3)
- : m_functionWrapper(functionWrapper)
- , m_p1(ParamStorageTraits<P1>::wrap(p1))
- , m_p2(ParamStorageTraits<P2>::wrap(p2))
- , m_p3(ParamStorageTraits<P3>::wrap(p3))
- {
- RefAndDeref<P1, FunctionWrapper::shouldRefFirstParameter>::ref(m_p1);
- }
-
- ~BoundFunctionImpl()
- {
- RefAndDeref<P1, FunctionWrapper::shouldRefFirstParameter>::deref(m_p1);
- }
-
- virtual typename FunctionWrapper::ResultType operator()()
- {
- return m_functionWrapper(ParamStorageTraits<P1>::unwrap(m_p1), ParamStorageTraits<P2>::unwrap(m_p2), ParamStorageTraits<P3>::unwrap(m_p3));
- }
-
-private:
- FunctionWrapper m_functionWrapper;
- typename ParamStorageTraits<P1>::StorageType m_p1;
- typename ParamStorageTraits<P2>::StorageType m_p2;
- typename ParamStorageTraits<P3>::StorageType m_p3;
-};
-
-template<typename FunctionWrapper, typename R, typename P1, typename P2, typename P3, typename P4>
-class BoundFunctionImpl<FunctionWrapper, R (P1, P2, P3, P4)> : public FunctionImpl<typename FunctionWrapper::ResultType ()> {
-public:
- BoundFunctionImpl(FunctionWrapper functionWrapper, const P1& p1, const P2& p2, const P3& p3, const P4& p4)
- : m_functionWrapper(functionWrapper)
- , m_p1(ParamStorageTraits<P1>::wrap(p1))
- , m_p2(ParamStorageTraits<P2>::wrap(p2))
- , m_p3(ParamStorageTraits<P3>::wrap(p3))
- , m_p4(ParamStorageTraits<P4>::wrap(p4))
- {
- RefAndDeref<P1, FunctionWrapper::shouldRefFirstParameter>::ref(m_p1);
- }
-
- ~BoundFunctionImpl()
- {
- RefAndDeref<P1, FunctionWrapper::shouldRefFirstParameter>::deref(m_p1);
- }
-
- virtual typename FunctionWrapper::ResultType operator()()
- {
- return m_functionWrapper(ParamStorageTraits<P1>::unwrap(m_p1), ParamStorageTraits<P2>::unwrap(m_p2), ParamStorageTraits<P3>::unwrap(m_p3), ParamStorageTraits<P4>::unwrap(m_p4));
- }
-
-private:
- FunctionWrapper m_functionWrapper;
- typename ParamStorageTraits<P1>::StorageType m_p1;
- typename ParamStorageTraits<P2>::StorageType m_p2;
- typename ParamStorageTraits<P3>::StorageType m_p3;
- typename ParamStorageTraits<P4>::StorageType m_p4;
-};
-
-template<typename FunctionWrapper, typename R, typename P1, typename P2, typename P3, typename P4, typename P5>
-class BoundFunctionImpl<FunctionWrapper, R (P1, P2, P3, P4, P5)> : public FunctionImpl<typename FunctionWrapper::ResultType ()> {
-public:
- BoundFunctionImpl(FunctionWrapper functionWrapper, const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5)
- : m_functionWrapper(functionWrapper)
- , m_p1(ParamStorageTraits<P1>::wrap(p1))
- , m_p2(ParamStorageTraits<P2>::wrap(p2))
- , m_p3(ParamStorageTraits<P3>::wrap(p3))
- , m_p4(ParamStorageTraits<P4>::wrap(p4))
- , m_p5(ParamStorageTraits<P5>::wrap(p5))
- {
- RefAndDeref<P1, FunctionWrapper::shouldRefFirstParameter>::ref(m_p1);
- }
-
- ~BoundFunctionImpl()
- {
- RefAndDeref<P1, FunctionWrapper::shouldRefFirstParameter>::deref(m_p1);
- }
-
- virtual typename FunctionWrapper::ResultType operator()()
- {
- return m_functionWrapper(ParamStorageTraits<P1>::unwrap(m_p1), ParamStorageTraits<P2>::unwrap(m_p2), ParamStorageTraits<P3>::unwrap(m_p3), ParamStorageTraits<P4>::unwrap(m_p4), ParamStorageTraits<P5>::unwrap(m_p5));
- }
-
-private:
- FunctionWrapper m_functionWrapper;
- typename ParamStorageTraits<P1>::StorageType m_p1;
- typename ParamStorageTraits<P2>::StorageType m_p2;
- typename ParamStorageTraits<P3>::StorageType m_p3;
- typename ParamStorageTraits<P4>::StorageType m_p4;
- typename ParamStorageTraits<P5>::StorageType m_p5;
-};
-
-template<typename FunctionWrapper, typename R, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6>
-class BoundFunctionImpl<FunctionWrapper, R (P1, P2, P3, P4, P5, P6)> : public FunctionImpl<typename FunctionWrapper::ResultType ()> {
-public:
- BoundFunctionImpl(FunctionWrapper functionWrapper, const P1& p1, const P2& p2, const P3& p3, const P4& p4, const P5& p5, const P6& p6)
- : m_functionWrapper(functionWrapper)
- , m_p1(ParamStorageTraits<P1>::wrap(p1))
- , m_p2(ParamStorageTraits<P2>::wrap(p2))
- , m_p3(ParamStorageTraits<P3>::wrap(p3))
- , m_p4(ParamStorageTraits<P4>::wrap(p4))
- , m_p5(ParamStorageTraits<P5>::wrap(p5))
- , m_p6(ParamStorageTraits<P6>::wrap(p6))
- {
- RefAndDeref<P1, FunctionWrapper::shouldRefFirstParameter>::ref(m_p1);
- }
-
- ~BoundFunctionImpl()
- {
- RefAndDeref<P1, FunctionWrapper::shouldRefFirstParameter>::deref(m_p1);
- }
-
- virtual typename FunctionWrapper::ResultType operator()()
- {
- return m_functionWrapper(ParamStorageTraits<P1>::unwrap(m_p1), ParamStorageTraits<P2>::unwrap(m_p2), ParamStorageTraits<P3>::unwrap(m_p3), ParamStorageTraits<P4>::unwrap(m_p4), ParamStorageTraits<P5>::unwrap(m_p5), ParamStorageTraits<P6>::unwrap(m_p6));
- }
-
-private:
- FunctionWrapper m_functionWrapper;
- typename ParamStorageTraits<P1>::StorageType m_p1;
- typename ParamStorageTraits<P2>::StorageType m_p2;
- typename ParamStorageTraits<P3>::StorageType m_p3;
- typename ParamStorageTraits<P4>::StorageType m_p4;
- typename ParamStorageTraits<P5>::StorageType m_p5;
- typename ParamStorageTraits<P6>::StorageType m_p6;
-};
-
-class FunctionBase {
-public:
- bool isNull() const
- {
- return !m_impl;
- }
-
-protected:
- FunctionBase()
- {
- }
-
- explicit FunctionBase(PassRefPtr<FunctionImplBase> impl)
- : m_impl(impl)
- {
- }
-
- template<typename FunctionType> FunctionImpl<FunctionType>* impl() const
- {
- return static_cast<FunctionImpl<FunctionType>*>(m_impl.get());
- }
-
-private:
- RefPtr<FunctionImplBase> m_impl;
-};
-
-template<typename>
-class Function;
-
-template<typename R>
-class Function<R ()> : public FunctionBase {
-public:
- Function()
- {
- }
-
- Function(PassRefPtr<FunctionImpl<R ()>> impl)
- : FunctionBase(impl)
- {
- }
-
- R operator()() const
- {
- ASSERT(!isNull());
-
- return impl<R ()>()->operator()();
- }
-
-#if OS(DARWIN) && COMPILER_SUPPORTS(BLOCKS)
- typedef void (^BlockType)();
- operator BlockType() const
- {
- // Declare a RefPtr here so we'll be sure that the underlying FunctionImpl object's
- // lifecycle is managed correctly.
- RefPtr<FunctionImpl<R ()>> functionImpl = impl<R ()>();
- BlockType block = ^{
- functionImpl->operator()();
- };
-
- // This is equivalent to:
- //
- // return [[block copy] autorelease];
- //
- // We're using manual objc_msgSend calls here because we don't want to make the entire
- // file Objective-C. It's useful to be able to implicitly convert a Function to
- // a block even in C++ code, since that allows us to do things like:
- //
- // dispatch_async(queue, bind(...));
- //
- id copiedBlock = wtfObjcMsgSend<id>((id)block, sel_registerName("copy"));
- id autoreleasedBlock = wtfObjcMsgSend<id>(copiedBlock, sel_registerName("autorelease"));
- return (BlockType)autoreleasedBlock;
- }
-#endif
-};
-
-template<typename FunctionType>
-Function<typename FunctionWrapper<FunctionType>::ResultType ()> bind(FunctionType function)
-{
- return Function<typename FunctionWrapper<FunctionType>::ResultType ()>(adoptRef(new BoundFunctionImpl<FunctionWrapper<FunctionType>, typename FunctionWrapper<FunctionType>::ResultType ()>(FunctionWrapper<FunctionType>(function))));
-}
-
-template<typename FunctionType, typename A1>
-Function<typename FunctionWrapper<FunctionType>::ResultType ()> bind(FunctionType function, const A1& a1)
-{
- return Function<typename FunctionWrapper<FunctionType>::ResultType ()>(adoptRef(new BoundFunctionImpl<FunctionWrapper<FunctionType>, typename FunctionWrapper<FunctionType>::ResultType (A1)>(FunctionWrapper<FunctionType>(function), a1)));
-}
-
-template<typename FunctionType, typename A1, typename A2>
-Function<typename FunctionWrapper<FunctionType>::ResultType ()> bind(FunctionType function, const A1& a1, const A2& a2)
-{
- return Function<typename FunctionWrapper<FunctionType>::ResultType ()>(adoptRef(new BoundFunctionImpl<FunctionWrapper<FunctionType>, typename FunctionWrapper<FunctionType>::ResultType (A1, A2)>(FunctionWrapper<FunctionType>(function), a1, a2)));
-}
-
-template<typename FunctionType, typename A1, typename A2, typename A3>
-Function<typename FunctionWrapper<FunctionType>::ResultType ()> bind(FunctionType function, const A1& a1, const A2& a2, const A3& a3)
-{
- return Function<typename FunctionWrapper<FunctionType>::ResultType ()>(adoptRef(new BoundFunctionImpl<FunctionWrapper<FunctionType>, typename FunctionWrapper<FunctionType>::ResultType (A1, A2, A3)>(FunctionWrapper<FunctionType>(function), a1, a2, a3)));
-}
-
-template<typename FunctionType, typename A1, typename A2, typename A3, typename A4>
-Function<typename FunctionWrapper<FunctionType>::ResultType ()> bind(FunctionType function, const A1& a1, const A2& a2, const A3& a3, const A4& a4)
-{
- return Function<typename FunctionWrapper<FunctionType>::ResultType ()>(adoptRef(new BoundFunctionImpl<FunctionWrapper<FunctionType>, typename FunctionWrapper<FunctionType>::ResultType (A1, A2, A3, A4)>(FunctionWrapper<FunctionType>(function), a1, a2, a3, a4)));
-}
-
-template<typename FunctionType, typename A1, typename A2, typename A3, typename A4, typename A5>
-Function<typename FunctionWrapper<FunctionType>::ResultType ()> bind(FunctionType function, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5)
-{
- return Function<typename FunctionWrapper<FunctionType>::ResultType ()>(adoptRef(new BoundFunctionImpl<FunctionWrapper<FunctionType>, typename FunctionWrapper<FunctionType>::ResultType (A1, A2, A3, A4, A5)>(FunctionWrapper<FunctionType>(function), a1, a2, a3, a4, a5)));
-}
-
-template<typename FunctionType, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6>
-Function<typename FunctionWrapper<FunctionType>::ResultType ()> bind(FunctionType function, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6)
-{
- return Function<typename FunctionWrapper<FunctionType>::ResultType ()>(adoptRef(new BoundFunctionImpl<FunctionWrapper<FunctionType>, typename FunctionWrapper<FunctionType>::ResultType (A1, A2, A3, A4, A5, A6)>(FunctionWrapper<FunctionType>(function), a1, a2, a3, a4, a5, a6)));
-}
-
-}
-
-using WTF::Function;
-using WTF::bind;
-
-#endif // WTF_Functional_h
</del></span></pre></div>
<a id="trunkSourceWTFwtfmacDeprecatedSymbolsUsedBySafarimm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/mac/DeprecatedSymbolsUsedBySafari.mm (201405 => 201406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/mac/DeprecatedSymbolsUsedBySafari.mm        2016-05-25 22:07:17 UTC (rev 201405)
+++ trunk/Source/WTF/wtf/mac/DeprecatedSymbolsUsedBySafari.mm        2016-05-25 22:56:58 UTC (rev 201406)
</span><span class="lines">@@ -25,7 +25,6 @@
</span><span class="cx">
</span><span class="cx"> #include "config.h"
</span><span class="cx">
</span><del>-#include "Functional.h"
</del><span class="cx"> #include "HashMap.h"
</span><span class="cx"> #include "HashSet.h"
</span><span class="cx"> #include "Lock.h"
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201405 => 201406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-25 22:07:17 UTC (rev 201405)
+++ trunk/Source/WebCore/ChangeLog        2016-05-25 22:56:58 UTC (rev 201406)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2016-05-25 Anders Carlsson <andersca@apple.com>
+
+ Get rid of WTF/Functional.h
+ https://bugs.webkit.org/show_bug.cgi?id=158081
+
+ Reviewed by Chris Dumez.
+
+ * Modules/mediastream/MediaStreamTrack.cpp:
+
</ins><span class="cx"> 2016-05-25 Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> [WebSockets] No infrastructure for testing secure web sockets (wss)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamMediaStreamTrackcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp (201405 => 201406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp        2016-05-25 22:07:17 UTC (rev 201405)
+++ trunk/Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp        2016-05-25 22:56:58 UTC (rev 201406)
</span><span class="lines">@@ -41,7 +41,6 @@
</span><span class="cx"> #include "MediaTrackConstraints.h"
</span><span class="cx"> #include "NotImplemented.h"
</span><span class="cx"> #include "ScriptExecutionContext.h"
</span><del>-#include <wtf/Functional.h>
</del><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (201405 => 201406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-05-25 22:07:17 UTC (rev 201405)
+++ trunk/Tools/ChangeLog        2016-05-25 22:56:58 UTC (rev 201406)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2016-05-25 Anders Carlsson <andersca@apple.com>
+
+ Get rid of WTF/Functional.h
+ https://bugs.webkit.org/show_bug.cgi?id=158081
+
+ Reviewed by Chris Dumez.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WTF/Functional.cpp: Removed.
+ (TestWebKitAPI::returnFortyTwo): Deleted.
+ (TestWebKitAPI::TEST): Deleted.
+ (TestWebKitAPI::multiplyByTwo): Deleted.
+ (TestWebKitAPI::multiplyByOneAndAHalf): Deleted.
+ (TestWebKitAPI::multiply): Deleted.
+ (TestWebKitAPI::subtract): Deleted.
+ (TestWebKitAPI::A::A): Deleted.
+ (TestWebKitAPI::A::f): Deleted.
+ (TestWebKitAPI::A::addF): Deleted.
+ (TestWebKitAPI::B::B): Deleted.
+ (TestWebKitAPI::B::~B): Deleted.
+ (TestWebKitAPI::B::ref): Deleted.
+ (TestWebKitAPI::B::deref): Deleted.
+ (TestWebKitAPI::B::f): Deleted.
+ (TestWebKitAPI::B::g): Deleted.
+ (TestWebKitAPI::Number::create): Deleted.
+ (TestWebKitAPI::Number::~Number): Deleted.
+ (TestWebKitAPI::Number::value): Deleted.
+ (TestWebKitAPI::Number::Number): Deleted.
+ (TestWebKitAPI::multiplyNumberByTwo): Deleted.
+
</ins><span class="cx"> 2016-05-25 Daniel Bates <dabates@apple.com> and Brent Fulgham <bfulgham@apple.com>
</span><span class="cx">
</span><span class="cx"> [WebSockets] No infrastructure for testing secure web sockets (wss)
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPICMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/CMakeLists.txt (201405 => 201406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/CMakeLists.txt        2016-05-25 22:07:17 UTC (rev 201405)
+++ trunk/Tools/TestWebKitAPI/CMakeLists.txt        2016-05-25 22:56:58 UTC (rev 201406)
</span><span class="lines">@@ -47,7 +47,6 @@
</span><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WTF/Condition.cpp
</span><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WTF/DateMath.cpp
</span><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WTF/Deque.cpp
</span><del>- ${TESTWEBKITAPI_DIR}/Tests/WTF/Functional.cpp
</del><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WTF/HashCountedSet.cpp
</span><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WTF/HashMap.cpp
</span><span class="cx"> ${TESTWEBKITAPI_DIR}/Tests/WTF/HashSet.cpp
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestWebKitAPIxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (201405 => 201406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-05-25 22:07:17 UTC (rev 201405)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj        2016-05-25 22:56:58 UTC (rev 201406)
</span><span class="lines">@@ -260,7 +260,6 @@
</span><span class="cx">                 7CCE7F311A411B8E00447C4C /* CheckedArithmeticOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7A966DA140ECCC8005EF9B4 /* CheckedArithmeticOperations.cpp */; };
</span><span class="cx">                 7CCE7F321A411B8E00447C4C /* CString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A2C72E15E2E73C005B1A14 /* CString.cpp */; };
</span><span class="cx">                 7CCE7F331A411B8E00447C4C /* Deque.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4A757D3178AEA5B00B5D7A4 /* Deque.cpp */; };
</span><del>-                7CCE7F341A411B8E00447C4C /* Functional.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AA9E55714980A9900001A8A /* Functional.cpp */; };
</del><span class="cx">                 7CCE7F351A411B8E00447C4C /* HashMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0BCD833414857CE400EA2003 /* HashMap.cpp */; };
</span><span class="cx">                 7CCE7F361A411B8E00447C4C /* HashSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B2DFF815BDE599004F691D /* HashSet.cpp */; };
</span><span class="cx">                 7CCE7F371A411B8E00447C4C /* IntegerToStringConversion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266FAFD215E5775200F61D5B /* IntegerToStringConversion.cpp */; };
</span><span class="lines">@@ -547,7 +546,6 @@
</span><span class="cx">                 1A7E8B33181208DE00AEB74A /* FragmentNavigation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FragmentNavigation.mm; sourceTree = "<group>"; };
</span><span class="cx">                 1A7E8B351812093600AEB74A /* FragmentNavigation.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = FragmentNavigation.html; sourceTree = "<group>"; };
</span><span class="cx">                 1A9FB6CC1CA34BE500966124 /* EarlyKVOCrash.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EarlyKVOCrash.mm; sourceTree = "<group>"; };
</span><del>-                1AA9E55714980A9900001A8A /* Functional.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Functional.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 1AAD19F51C7CE20300831E47 /* Coding.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Coding.mm; sourceTree = "<group>"; };
</span><span class="cx">                 1ABC3DED1899BE6D004F0626 /* Navigation.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Navigation.mm; sourceTree = "<group>"; };
</span><span class="cx">                 1ADBEFAD130C689C00D61D19 /* ForceRepaint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ForceRepaint.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -1351,7 +1349,6 @@
</span><span class="cx">                                 E40019301ACE9B5C001B0A2A /* BloomFilter.cpp */,
</span><span class="cx">                                 7AA021BA1AB09EA70052953F /* DateMath.cpp */,
</span><span class="cx">                                 E4A757D3178AEA5B00B5D7A4 /* Deque.cpp */,
</span><del>-                                1AA9E55714980A9900001A8A /* Functional.cpp */,
</del><span class="cx">                                 7A38D7E51C752D5F004F157D /* HashCountedSet.cpp */,
</span><span class="cx">                                 0BCD833414857CE400EA2003 /* HashMap.cpp */,
</span><span class="cx">                                 26B2DFF815BDE599004F691D /* HashSet.cpp */,
</span><span class="lines">@@ -1839,7 +1836,6 @@
</span><span class="cx">                                 7CCE7EC01A411A7E00447C4C /* FragmentNavigation.mm in Sources */,
</span><span class="cx">                                 7CCE7EF61A411AE600447C4C /* FrameMIMETypeHTML.cpp in Sources */,
</span><span class="cx">                                 7CCE7EF71A411AE600447C4C /* FrameMIMETypePNG.cpp in Sources */,
</span><del>-                                7CCE7F341A411B8E00447C4C /* Functional.cpp in Sources */,
</del><span class="cx">                                 7CCE7EF81A411AE600447C4C /* Geolocation.cpp in Sources */,
</span><span class="cx">                                 7CCE7EE11A411A9A00447C4C /* GetBackingScaleFactor.mm in Sources */,
</span><span class="cx">                                 CDBFCC451A9FF45300A7B691 /* FullscreenZoomInitialFrame.mm in Sources */,
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWTFFunctionalcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Tools/TestWebKitAPI/Tests/WTF/Functional.cpp (201405 => 201406)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WTF/Functional.cpp        2016-05-25 22:07:17 UTC (rev 201405)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/Functional.cpp        2016-05-25 22:56:58 UTC (rev 201406)
</span><span class="lines">@@ -1,218 +0,0 @@
</span><del>-/*
- * Copyright (C) 2011 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 "config.h"
-#include <wtf/RefCounted.h>
-#include <wtf/Functional.h>
-
-namespace TestWebKitAPI {
-
-static int returnFortyTwo()
-{
- return 42;
-}
-
-TEST(FunctionalTest, Basic)
-{
- Function<int ()> emptyFunction;
- ASSERT_TRUE(emptyFunction.isNull());
-
- Function<int ()> returnFortyTwoFunction = bind(returnFortyTwo);
- ASSERT_FALSE(returnFortyTwoFunction.isNull());
- ASSERT_EQ(42, returnFortyTwoFunction());
-}
-
-static int multiplyByTwo(int n)
-{
- return n * 2;
-}
-
-static double multiplyByOneAndAHalf(double d)
-{
- return d * 1.5;
-}
-
-TEST(FunctionalTest, UnaryBind)
-{
- Function<int ()> multiplyFourByTwoFunction = bind(multiplyByTwo, 4);
- ASSERT_EQ(8, multiplyFourByTwoFunction());
-
- Function<double ()> multiplyByOneAndAHalfFunction = bind(multiplyByOneAndAHalf, 3);
- ASSERT_EQ(4.5, multiplyByOneAndAHalfFunction());
-}
-
-static int multiply(int x, int y)
-{
- return x * y;
-}
-
-static int subtract(int x, int y)
-{
- return x - y;
-}
-
-TEST(FunctionalTest, BinaryBind)
-{
- Function<int ()> multiplyFourByTwoFunction = bind(multiply, 4, 2);
- ASSERT_EQ(8, multiplyFourByTwoFunction());
-
- Function<int ()> subtractTwoFromFourFunction = bind(subtract, 4, 2);
- ASSERT_EQ(2, subtractTwoFromFourFunction());
-}
-
-class A {
-public:
- explicit A(int i)
- : m_i(i)
- {
- }
-
- int f() { return m_i; }
- int addF(int j) { return m_i + j; }
-
-private:
- int m_i;
-};
-
-TEST(FunctionalTest, MemberFunctionBind)
-{
- A a(10);
- Function<int ()> function1 = bind(&A::f, &a);
- ASSERT_EQ(10, function1());
-
- Function<int ()> function2 = bind(&A::addF, &a, 15);
- ASSERT_EQ(25, function2());
-}
-
-class B {
-public:
- B()
- : m_numRefCalls(0)
- , m_numDerefCalls(0)
- {
- }
-
- ~B()
- {
- }
-
- void ref()
- {
- m_numRefCalls++;
- }
-
- void deref()
- {
- m_numDerefCalls++;
- }
-
- void f() { ASSERT_GT(m_numRefCalls, 0); }
- void g(int) { ASSERT_GT(m_numRefCalls, 0); }
-
- int m_numRefCalls;
- int m_numDerefCalls;
-};
-
-TEST(FunctionalTest, MemberFunctionBindRefDeref)
-{
- B b;
-
- {
- Function<void ()> function1 = bind(&B::f, &b);
- function1();
-
- Function<void ()> function2 = bind(&B::g, &b, 10);
- function2();
- }
-
- ASSERT_TRUE(b.m_numRefCalls == b.m_numDerefCalls);
- ASSERT_GT(b.m_numRefCalls, 0);
-
-}
-
-class Number : public RefCounted<Number> {
-public:
- static PassRefPtr<Number> create(int value)
- {
- return adoptRef(new Number(value));
- }
-
- ~Number()
- {
- m_value = 0;
- }
-
- int value() const { return m_value; }
-
-private:
- explicit Number(int value)
- : m_value(value)
- {
- }
-
- int m_value;
-};
-
-static int multiplyNumberByTwo(Number* number)
-{
- return number->value() * 2;
-}
-
-TEST(FunctionalTest, RefCountedStorage)
-{
- RefPtr<Number> five = Number::create(5);
- Function<int ()> multiplyFiveByTwoFunction = bind(multiplyNumberByTwo, five);
- ASSERT_EQ(10, multiplyFiveByTwoFunction());
-
- Function<int ()> multiplyFourByTwoFunction = bind(multiplyNumberByTwo, Number::create(4));
- ASSERT_EQ(8, multiplyFourByTwoFunction());
-
- RefPtr<Number> six = Number::create(6);
- Function<int ()> multiplySixByTwoFunction = bind(multiplyNumberByTwo, six.release());
- ASSERT_FALSE(six);
- ASSERT_EQ(12, multiplySixByTwoFunction());
-}
-
-namespace RefAndDerefTests {
-
- template<typename T> struct RefCounted {
- void ref();
- void deref();
- };
- struct Connection : RefCounted<Connection> { };
- COMPILE_ASSERT(WTF::HasRefAndDeref<Connection>::value, class_has_ref_and_deref);
-
- struct NoRefOrDeref { };
- COMPILE_ASSERT(!WTF::HasRefAndDeref<NoRefOrDeref>::value, class_has_no_ref_or_deref);
-
- struct RefOnly { void ref(); };
- COMPILE_ASSERT(!WTF::HasRefAndDeref<RefOnly>::value, class_has_ref_only);
-
- struct DerefOnly { void deref(); };
- COMPILE_ASSERT(!WTF::HasRefAndDeref<DerefOnly>::value, class_has_deref_only);
-
-}
-
-} // namespace TestWebKitAPI
</del></span></pre>
</div>
</div>
</body>
</html>