<!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>[201422] 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/201422">201422</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2016-05-26 10:23:02 -0700 (Thu, 26 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement internals.observeGC to get called back when a Javascript object is GC'ed.
https://bugs.webkit.org/show_bug.cgi?id=158093

Reviewed by Geoffrey Garen.

Source/WebCore:

Test: js/test-observegc.html

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:

* testing/GCObservation.cpp: Added.
(WebCore::GCObservation::GCObservation):
* testing/GCObservation.h: Added.
* testing/GCObservation.idl: Added.

* testing/Internals.cpp:
(WebCore::Internals::observeGC):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* js/script-tests/test-observegc.js: Added.
* js/test-observegc-expected.txt: Added.
* js/test-observegc.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsjsscriptteststestobservegcjs">trunk/LayoutTests/js/script-tests/test-observegc.js</a></li>
<li><a href="#trunkLayoutTestsjstestobservegcexpectedtxt">trunk/LayoutTests/js/test-observegc-expected.txt</a></li>
<li><a href="#trunkLayoutTestsjstestobservegchtml">trunk/LayoutTests/js/test-observegc.html</a></li>
<li><a href="#trunkSourceWebCoretestingGCObservationcpp">trunk/Source/WebCore/testing/GCObservation.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingGCObservationh">trunk/Source/WebCore/testing/GCObservation.h</a></li>
<li><a href="#trunkSourceWebCoretestingGCObservationidl">trunk/Source/WebCore/testing/GCObservation.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (201421 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-26 17:08:17 UTC (rev 201421)
+++ trunk/LayoutTests/ChangeLog        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-05-26  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Implement internals.observeGC to get called back when a Javascript object is GC'ed.
+        https://bugs.webkit.org/show_bug.cgi?id=158093
+
+        Reviewed by Geoffrey Garen.
+
+        * js/script-tests/test-observegc.js: Added.
+        * js/test-observegc-expected.txt: Added.
+        * js/test-observegc.html: Added.
+
</ins><span class="cx"> 2016-05-26  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Font Loading] Allow empty strings in FontFace constructor
</span></span></pre></div>
<a id="trunkLayoutTestsjsscriptteststestobservegcjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/script-tests/test-observegc.js (0 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/script-tests/test-observegc.js                                (rev 0)
+++ trunk/LayoutTests/js/script-tests/test-observegc.js        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+description(&quot;Ensures that window.internals.observegc works as expected&quot;);
+
+var testObject = { testProperty : &quot;testValue&quot; };
+
+var observer = internals.observeGC(testObject);
+testObject = null;
+gc();
+
+shouldBe('observer.wasCollected', 'true');
</ins></span></pre></div>
<a id="trunkLayoutTestsjstestobservegcexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/test-observegc-expected.txt (0 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/test-observegc-expected.txt                                (rev 0)
+++ trunk/LayoutTests/js/test-observegc-expected.txt        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+Ensures that window.internals.observegc works as expected
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS observer.wasCollected is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsjstestobservegchtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/js/test-observegc.html (0 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/js/test-observegc.html                                (rev 0)
+++ trunk/LayoutTests/js/test-observegc.html        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script src=&quot;script-tests/test-observegc.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (201421 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-05-26 17:08:17 UTC (rev 201421)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -3408,6 +3408,7 @@
</span><span class="cx"> )
</span><span class="cx"> 
</span><span class="cx"> set(WebCoreTestSupport_IDL_FILES
</span><ins>+    testing/GCObservation.idl
</ins><span class="cx">     testing/InternalSettings.idl
</span><span class="cx">     testing/Internals.idl
</span><span class="cx">     testing/MallocStatistics.idl
</span><span class="lines">@@ -3426,6 +3427,7 @@
</span><span class="cx">     platform/mock/mediasource/MockSourceBufferPrivate.cpp
</span><span class="cx">     platform/mock/mediasource/MockTracks.cpp
</span><span class="cx"> 
</span><ins>+    testing/GCObservation.cpp
</ins><span class="cx">     testing/InternalSettings.cpp
</span><span class="cx">     testing/Internals.cpp
</span><span class="cx">     testing/MockPageOverlay.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201421 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-26 17:08:17 UTC (rev 201421)
+++ trunk/Source/WebCore/ChangeLog        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-05-26  Brady Eidson  &lt;beidson@apple.com&gt;
+
+        Implement internals.observeGC to get called back when a Javascript object is GC'ed.
+        https://bugs.webkit.org/show_bug.cgi?id=158093
+
+        Reviewed by Geoffrey Garen.
+
+        Test: js/test-observegc.html
+
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * WebCore.xcodeproj/project.pbxproj:
+
+        * testing/GCObservation.cpp: Added.
+        (WebCore::GCObservation::GCObservation):
+        * testing/GCObservation.h: Added.
+        * testing/GCObservation.idl: Added.
+
+        * testing/Internals.cpp:
+        (WebCore::Internals::observeGC):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
</ins><span class="cx"> 2016-05-26  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Font Loading] Allow empty strings in FontFace constructor
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (201421 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-05-26 17:08:17 UTC (rev 201421)
+++ trunk/Source/WebCore/DerivedSources.make        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -535,6 +535,7 @@
</span><span class="cx">     $(WebCore)/plugins/DOMPluginArray.idl \
</span><span class="cx">     $(WebCore)/storage/Storage.idl \
</span><span class="cx">     $(WebCore)/storage/StorageEvent.idl \
</span><ins>+    $(WebCore)/testing/GCObservation.idl \
</ins><span class="cx">     $(WebCore)/testing/Internals.idl \
</span><span class="cx">     $(WebCore)/testing/InternalSettings.idl \
</span><span class="cx">     $(WebCore)/testing/MallocStatistics.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (201421 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-05-26 17:08:17 UTC (rev 201421)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -2071,6 +2071,10 @@
</span><span class="cx">                 517139071BF64DEF000D5F01 /* MemoryCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517139011BF64DE3000D5F01 /* MemoryCursor.cpp */; };
</span><span class="cx">                 517139081BF64DEF000D5F01 /* MemoryCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 517139021BF64DE3000D5F01 /* MemoryCursor.h */; };
</span><span class="cx">                 51714EA81CF4E4B1004723C4 /* IDBActiveDOMObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 51714EA71CF4DE87004723C4 /* IDBActiveDOMObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                51714EAC1CF65951004723C4 /* GCObservation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51714EA91CF65899004723C4 /* GCObservation.cpp */; };
+                51714EAD1CF65951004723C4 /* GCObservation.h in Headers */ = {isa = PBXBuildFile; fileRef = 51714EAA1CF65899004723C4 /* GCObservation.h */; };
+                51714EB01CF665CE004723C4 /* JSGCObservation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51714EAE1CF6654A004723C4 /* JSGCObservation.cpp */; };
+                51714EB11CF665CE004723C4 /* JSGCObservation.h in Headers */ = {isa = PBXBuildFile; fileRef = 51714EAF1CF6654A004723C4 /* JSGCObservation.h */; };
</ins><span class="cx">                 51741D0F0B07259A00ED442C /* BackForwardClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51741D0B0B07259A00ED442C /* BackForwardClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 51741D110B07259A00ED442C /* HistoryItem.h in Headers */ = {isa = PBXBuildFile; fileRef = 51741D0D0B07259A00ED442C /* HistoryItem.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 51741D120B07259A00ED442C /* HistoryItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51741D0E0B07259A00ED442C /* HistoryItem.cpp */; };
</span><span class="lines">@@ -9662,6 +9666,11 @@
</span><span class="cx">                 517139031BF64DE3000D5F01 /* MemoryObjectStoreCursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryObjectStoreCursor.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 517139041BF64DE3000D5F01 /* MemoryObjectStoreCursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryObjectStoreCursor.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51714EA71CF4DE87004723C4 /* IDBActiveDOMObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBActiveDOMObject.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                51714EA91CF65899004723C4 /* GCObservation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GCObservation.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                51714EAA1CF65899004723C4 /* GCObservation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GCObservation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                51714EAB1CF65899004723C4 /* GCObservation.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GCObservation.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                51714EAE1CF6654A004723C4 /* JSGCObservation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSGCObservation.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                51714EAF1CF6654A004723C4 /* JSGCObservation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSGCObservation.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 51741D0B0B07259A00ED442C /* BackForwardClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackForwardClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51741D0D0B07259A00ED442C /* HistoryItem.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HistoryItem.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51741D0E0B07259A00ED442C /* HistoryItem.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryItem.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16719,6 +16728,9 @@
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="cx">                                 41815C1B138319630057AAA4 /* js */,
</span><ins>+                                51714EA91CF65899004723C4 /* GCObservation.cpp */,
+                                51714EAA1CF65899004723C4 /* GCObservation.h */,
+                                51714EAB1CF65899004723C4 /* GCObservation.idl */,
</ins><span class="cx">                                 417DA4CF13734326007C57FB /* Internals.cpp */,
</span><span class="cx">                                 417DA4CE13734326007C57FB /* Internals.h */,
</span><span class="cx">                                 41813F9113818AD60057AAA4 /* Internals.idl */,
</span><span class="lines">@@ -16752,6 +16764,8 @@
</span><span class="cx">                 417DA71213735D90007C57FB /* Testing */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                51714EAE1CF6654A004723C4 /* JSGCObservation.cpp */,
+                                51714EAF1CF6654A004723C4 /* JSGCObservation.h */,
</ins><span class="cx">                                 417DA71B13735DFA007C57FB /* JSInternals.cpp */,
</span><span class="cx">                                 417DA71C13735DFA007C57FB /* JSInternals.h */,
</span><span class="cx">                                 A7B4EA7814C9348400C8F5BF /* JSInternalSettings.cpp */,
</span><span class="lines">@@ -24987,6 +25001,7 @@
</span><span class="cx">                                 A7BF7EE014C9175A0014489D /* InternalSettings.h in Headers */,
</span><span class="cx">                                 53E29E5F167A8A1900586D3D /* InternalSettingsGenerated.h in Headers */,
</span><span class="cx">                                 417DA71E13735DFA007C57FB /* JSInternals.h in Headers */,
</span><ins>+                                51714EB11CF665CE004723C4 /* JSGCObservation.h in Headers */,
</ins><span class="cx">                                 A740B5A514C935AB00A77FA4 /* JSInternalSettings.h in Headers */,
</span><span class="cx">                                 53ED3FDF167A88E7006762E6 /* JSInternalSettingsGenerated.h in Headers */,
</span><span class="cx">                                 A740B59514C935AB00A77FA4 /* JSMallocStatistics.h in Headers */,
</span><span class="lines">@@ -24996,6 +25011,7 @@
</span><span class="cx">                                 CDC26B41160A8CCE0026757B /* MockCDM.h in Headers */,
</span><span class="cx">                                 A1BF6B831AA96C7D00AF4A8A /* MockContentFilter.h in Headers */,
</span><span class="cx">                                 A1B5B29F1AAA846F008B6042 /* MockContentFilterSettings.h in Headers */,
</span><ins>+                                51714EAD1CF65951004723C4 /* GCObservation.h in Headers */,
</ins><span class="cx">                                 2D6F3E911C1ECB2F0061DBD4 /* MockPageOverlay.h in Headers */,
</span><span class="cx">                                 2D97F04819DD4140001EE9C3 /* MockPageOverlayClient.h in Headers */,
</span><span class="cx">                                 AA5F3B8D16CC33D100455EB0 /* PlatformSpeechSynthesizerMock.h in Headers */,
</span><span class="lines">@@ -28966,10 +28982,12 @@
</span><span class="cx">                                 53E29E5E167A8A1900586D3D /* InternalSettingsGenerated.cpp in Sources */,
</span><span class="cx">                                 417DA71D13735DFA007C57FB /* JSInternals.cpp in Sources */,
</span><span class="cx">                                 A740B5A714C935AF00A77FA4 /* JSInternalSettings.cpp in Sources */,
</span><ins>+                                51714EAC1CF65951004723C4 /* GCObservation.cpp in Sources */,
</ins><span class="cx">                                 53ED3FDE167A88E7006762E6 /* JSInternalSettingsGenerated.cpp in Sources */,
</span><span class="cx">                                 A740B59714C935AF00A77FA4 /* JSMallocStatistics.cpp in Sources */,
</span><span class="cx">                                 CD5393D3175E018600C07123 /* JSMemoryInfo.cpp in Sources */,
</span><span class="cx">                                 A19AEA221AAA808A00B52B25 /* JSMockContentFilterSettings.cpp in Sources */,
</span><ins>+                                51714EB01CF665CE004723C4 /* JSGCObservation.cpp in Sources */,
</ins><span class="cx">                                 A1E5B31F1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp in Sources */,
</span><span class="cx">                                 2D4150DE1C1F868C000A3BA2 /* JSMockPageOverlay.cpp in Sources */,
</span><span class="cx">                                 EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCoretestingGCObservationcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/testing/GCObservation.cpp (0 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/GCObservation.cpp                                (rev 0)
+++ trunk/Source/WebCore/testing/GCObservation.cpp        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -0,0 +1,36 @@
</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 &quot;GCObservation.h&quot;
+
+namespace WebCore {
+
+GCObservation::GCObservation(JSC::JSObject* object)
+    : m_observedValue(object, nullptr, nullptr)
+{
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingGCObservationh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/testing/GCObservation.h (0 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/GCObservation.h                                (rev 0)
+++ trunk/Source/WebCore/testing/GCObservation.h        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -0,0 +1,51 @@
</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;heap/Weak.h&gt;
+#include &lt;runtime/JSCJSValueInlines.h&gt;
+#include &lt;runtime/JSObject.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+
+namespace WebCore {
+
+class GCObservation final : public RefCounted&lt;GCObservation&gt; {
+public:
+    template&lt;typename... Args&gt; static RefPtr&lt;GCObservation&gt; create(Args&amp;&amp;... args)
+    {
+        return adoptRef(new GCObservation(std::forward&lt;Args&gt;(args)...));
+    }
+
+    bool wasCollected() const { return !m_observedValue; }
+
+private:
+    explicit GCObservation(JSC::JSObject*);
+
+    mutable JSC::Weak&lt;JSC::JSObject&gt; m_observedValue;
+};
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingGCObservationidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/testing/GCObservation.idl (0 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/GCObservation.idl                                (rev 0)
+++ trunk/Source/WebCore/testing/GCObservation.idl        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ * 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; 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 THE COPYRIGHT
+ * OWNER OR 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.
+ */
+
+[
+    NoInterfaceObject,
+    ImplementationLacksVTable,
+    ExportMacro=WEBCORE_TESTSUPPORT_EXPORT,
+] interface GCObservation {
+    readonly attribute boolean wasCollected;
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (201421 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-05-26 17:08:17 UTC (rev 201421)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -59,6 +59,7 @@
</span><span class="cx"> #include &quot;FormController.h&quot;
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><span class="cx"> #include &quot;FrameView.h&quot;
</span><ins>+#include &quot;GCObservation.h&quot;
</ins><span class="cx"> #include &quot;HTMLCanvasElement.h&quot;
</span><span class="cx"> #include &quot;HTMLIFrameElement.h&quot;
</span><span class="cx"> #include &quot;HTMLImageElement.h&quot;
</span><span class="lines">@@ -3321,4 +3322,12 @@
</span><span class="cx">     return UserGestureIndicator::processingUserGesture();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr&lt;GCObservation&gt; Internals::observeGC(JSC::JSValue value)
+{
+    if (!value || value.isNull() || value.isUndefined() || !value.getObject())
+        return nullptr;
+
+    return GCObservation::create(value.getObject());
</ins><span class="cx"> }
</span><ins>+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (201421 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2016-05-26 17:08:17 UTC (rev 201421)
+++ trunk/Source/WebCore/testing/Internals.h        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> class Element;
</span><span class="cx"> class File;
</span><span class="cx"> class Frame;
</span><ins>+class GCObservation;
</ins><span class="cx"> class HTMLImageElement;
</span><span class="cx"> class HTMLInputElement;
</span><span class="cx"> class HTMLLinkElement;
</span><span class="lines">@@ -482,6 +483,8 @@
</span><span class="cx"> 
</span><span class="cx">     bool isProcessingUserGesture();
</span><span class="cx"> 
</span><ins>+    RefPtr&lt;GCObservation&gt; observeGC(JSC::JSValue);
+
</ins><span class="cx"> private:
</span><span class="cx">     explicit Internals(Document&amp;);
</span><span class="cx">     Document* contextDocument() const;
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (201421 => 201422)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2016-05-26 17:08:17 UTC (rev 201421)
+++ trunk/Source/WebCore/testing/Internals.idl        2016-05-26 17:23:02 UTC (rev 201422)
</span><span class="lines">@@ -455,4 +455,6 @@
</span><span class="cx">     void setResourceTimingSupport(boolean scalable);
</span><span class="cx">     
</span><span class="cx">     boolean isProcessingUserGesture();
</span><ins>+
+    GCObservation observeGC(any observed);
</ins><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>