<!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>[203379] 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/203379">203379</a></dd>
<dt>Author</dt> <dd>akling@apple.com</dd>
<dt>Date</dt> <dd>2016-07-18 16:16:24 -0700 (Mon, 18 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>There should be a way to simulate memory pressure in layout tests
&lt;https://webkit.org/b/159743&gt;

Reviewed by Simon Fraser.

Source/WebCore:

Add three window.internal APIs:

    - boolean isUnderMemoryPressure (readonly attribute)
    - void beginSimulatedMemoryPressure()
    - void endSimulatedMemoryPressure()

These make it possible to write tests that exercise behaviors that only
occur during memory pressure situations.

I also implemented the &quot;org.WebKit.lowMemory&quot; notification handler using the new API.

Test: memory/memory-pressure-simulation.html

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::beginSimulatedMemoryPressure):
(WebCore::MemoryPressureHandler::endSimulatedMemoryPressure):
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::isUnderMemoryPressure):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::platformReleaseMemory):
(WebCore::MemoryPressureHandler::install):
* testing/Internals.cpp:
(WebCore::Internals::isUnderMemoryPressure):
(WebCore::Internals::beginSimulatedMemoryPressure):
(WebCore::Internals::endSimulatedMemoryPressure):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Add a basic test for the new APIs.

* memory/memory-pressure-simulation-expected.txt: Added.
* memory/memory-pressure-simulation.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformMemoryPressureHandlercpp">trunk/Source/WebCore/platform/MemoryPressureHandler.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformMemoryPressureHandlerh">trunk/Source/WebCore/platform/MemoryPressureHandler.h</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaMemoryPressureHandlerCocoamm">trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm</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>trunk/LayoutTests/memory/</li>
<li><a href="#trunkLayoutTestsmemorymemorypressuresimulationexpectedtxt">trunk/LayoutTests/memory/memory-pressure-simulation-expected.txt</a></li>
<li><a href="#trunkLayoutTestsmemorymemorypressuresimulationhtml">trunk/LayoutTests/memory/memory-pressure-simulation.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203378 => 203379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-18 22:46:37 UTC (rev 203378)
+++ trunk/LayoutTests/ChangeLog        2016-07-18 23:16:24 UTC (rev 203379)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-07-18  Andreas Kling  &lt;akling@apple.com&gt;
+
+        There should be a way to simulate memory pressure in layout tests
+        &lt;https://webkit.org/b/159743&gt;
+
+        Reviewed by Simon Fraser.
+
+        Add a basic test for the new APIs.
+
+        * memory/memory-pressure-simulation-expected.txt: Added.
+        * memory/memory-pressure-simulation.html: Added.
+
</ins><span class="cx"> 2016-07-18  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] PDFDocumentImage should cache only a sub image of the PDF when caching the whole image is expensive
</span></span></pre></div>
<a id="trunkLayoutTestsmemorymemorypressuresimulationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/memory/memory-pressure-simulation-expected.txt (0 => 203379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/memory/memory-pressure-simulation-expected.txt                                (rev 0)
+++ trunk/LayoutTests/memory/memory-pressure-simulation-expected.txt        2016-07-18 23:16:24 UTC (rev 203379)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+Basic test for the memory pressure simulation mechanism.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Verify that we're not running under memory pressure from the beginning.
+PASS internals.isUnderMemoryPressure is false
+Begin simulated memory pressure.
+PASS internals.isUnderMemoryPressure is true
+End simulated memory pressure.
+PASS internals.isUnderMemoryPressure is false
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsmemorymemorypressuresimulationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/memory/memory-pressure-simulation.html (0 => 203379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/memory/memory-pressure-simulation.html                                (rev 0)
+++ trunk/LayoutTests/memory/memory-pressure-simulation.html        2016-07-18 23:16:24 UTC (rev 203379)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;script src=&quot;../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+
+description(&quot;Basic test for the memory pressure simulation mechanism.&quot;);
+
+debug(&quot;Verify that we're not running under memory pressure from the beginning.&quot;);
+shouldBe(&quot;internals.isUnderMemoryPressure&quot;, &quot;false&quot;);
+
+debug(&quot;Begin simulated memory pressure.&quot;);
+internals.beginSimulatedMemoryPressure();
+
+shouldBe(&quot;internals.isUnderMemoryPressure&quot;, &quot;true&quot;);
+
+debug(&quot;End simulated memory pressure.&quot;);
+internals.endSimulatedMemoryPressure();
+
+shouldBe(&quot;internals.isUnderMemoryPressure&quot;, &quot;false&quot;);
+
+&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="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203378 => 203379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-18 22:46:37 UTC (rev 203378)
+++ trunk/Source/WebCore/ChangeLog        2016-07-18 23:16:24 UTC (rev 203379)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2016-07-18  Andreas Kling  &lt;akling@apple.com&gt;
+
+        There should be a way to simulate memory pressure in layout tests
+        &lt;https://webkit.org/b/159743&gt;
+
+        Reviewed by Simon Fraser.
+
+        Add three window.internal APIs:
+
+            - boolean isUnderMemoryPressure (readonly attribute)
+            - void beginSimulatedMemoryPressure()
+            - void endSimulatedMemoryPressure()
+
+        These make it possible to write tests that exercise behaviors that only
+        occur during memory pressure situations.
+
+        I also implemented the &quot;org.WebKit.lowMemory&quot; notification handler using the new API.
+
+        Test: memory/memory-pressure-simulation.html
+
+        * platform/MemoryPressureHandler.cpp:
+        (WebCore::MemoryPressureHandler::beginSimulatedMemoryPressure):
+        (WebCore::MemoryPressureHandler::endSimulatedMemoryPressure):
+        * platform/MemoryPressureHandler.h:
+        (WebCore::MemoryPressureHandler::isUnderMemoryPressure):
+        * platform/cocoa/MemoryPressureHandlerCocoa.mm:
+        (WebCore::MemoryPressureHandler::platformReleaseMemory):
+        (WebCore::MemoryPressureHandler::install):
+        * testing/Internals.cpp:
+        (WebCore::Internals::isUnderMemoryPressure):
+        (WebCore::Internals::beginSimulatedMemoryPressure):
+        (WebCore::Internals::endSimulatedMemoryPressure):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+
</ins><span class="cx"> 2016-07-18  Said Abou-Hallawa  &lt;sabouhallawa@apple,com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] PDFDocumentImage should cache only a sub image of the PDF when caching the whole image is expensive
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMemoryPressureHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.cpp (203378 => 203379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2016-07-18 22:46:37 UTC (rev 203378)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2016-07-18 23:16:24 UTC (rev 203379)
</span><span class="lines">@@ -177,6 +177,17 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void MemoryPressureHandler::beginSimulatedMemoryPressure()
+{
+    m_isSimulatingMemoryPressure = true;
+    MemoryPressureHandler::singleton().respondToMemoryPressure(Critical::Yes, Synchronous::Yes);
+}
+
+void MemoryPressureHandler::endSimulatedMemoryPressure()
+{
+    m_isSimulatingMemoryPressure = false;
+}
+
</ins><span class="cx"> void MemoryPressureHandler::releaseMemory(Critical critical, Synchronous synchronous)
</span><span class="cx"> {
</span><span class="cx">     if (critical == Critical::Yes)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMemoryPressureHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.h (203378 => 203379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MemoryPressureHandler.h        2016-07-18 22:46:37 UTC (rev 203378)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.h        2016-07-18 23:16:24 UTC (rev 203379)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx"> 
</span><span class="cx">     void jettisonExpensiveObjectsOnTopLevelNavigation();
</span><span class="cx"> 
</span><del>-    bool isUnderMemoryPressure() const { return m_underMemoryPressure; }
</del><ins>+    bool isUnderMemoryPressure() const { return m_underMemoryPressure || m_isSimulatingMemoryPressure; }
</ins><span class="cx">     void setUnderMemoryPressure(bool b) { m_underMemoryPressure = b; }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -126,6 +126,9 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void releaseMemory(Critical, Synchronous = Synchronous::No);
</span><span class="cx"> 
</span><ins>+    WEBCORE_EXPORT void beginSimulatedMemoryPressure();
+    WEBCORE_EXPORT void endSimulatedMemoryPressure();
+
</ins><span class="cx"> private:
</span><span class="cx">     void platformInitialize();
</span><span class="cx">     void releaseNoncriticalMemory();
</span><span class="lines">@@ -166,7 +169,7 @@
</span><span class="cx">     LowMemoryHandler m_lowMemoryHandler;
</span><span class="cx"> 
</span><span class="cx">     std::atomic&lt;bool&gt; m_underMemoryPressure;
</span><del>-    bool m_isSimulatedMemoryPressure { false };
</del><ins>+    bool m_isSimulatingMemoryPressure { false };
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     uint32_t m_memoryPressureReason;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaMemoryPressureHandlerCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm (203378 => 203379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm        2016-07-18 22:46:37 UTC (rev 203378)
+++ trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm        2016-07-18 23:16:24 UTC (rev 203379)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (critical == Critical::Yes &amp;&amp; (!isUnderMemoryPressure() || m_isSimulatedMemoryPressure)) {
</del><ins>+    if (critical == Critical::Yes &amp;&amp; (!isUnderMemoryPressure() || m_isSimulatingMemoryPressure)) {
</ins><span class="cx">         // libcache listens to OS memory notifications, but for process suspension
</span><span class="cx">         // or memory pressure simulation, we need to prod it manually:
</span><span class="cx">         ReliefLogger log(&quot;Purging libcache caches&quot;);
</span><span class="lines">@@ -139,19 +139,12 @@
</span><span class="cx"> 
</span><span class="cx">     // Allow simulation of memory pressure with &quot;notifyutil -p org.WebKit.lowMemory&quot;
</span><span class="cx">     notify_register_dispatch(&quot;org.WebKit.lowMemory&quot;, &amp;_notifyToken, dispatch_get_main_queue(), ^(int) {
</span><del>-        m_isSimulatedMemoryPressure = true;
-
</del><span class="cx"> #if ENABLE(FMW_FOOTPRINT_COMPARISON)
</span><span class="cx">         auto footprintBefore = pagesPerVMTag();
</span><span class="cx"> #endif
</span><ins>+        beginSimulatedMemoryPressure();
</ins><span class="cx"> 
</span><del>-        bool wasUnderMemoryPressure = m_underMemoryPressure;
-        m_underMemoryPressure = true;
-
-        MemoryPressureHandler::singleton().respondToMemoryPressure(Critical::Yes, Synchronous::Yes);
-
</del><span class="cx">         WTF::releaseFastMallocFreeMemory();
</span><del>-
</del><span class="cx">         malloc_zone_pressure_relief(nullptr, 0);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(FMW_FOOTPRINT_COMPARISON)
</span><span class="lines">@@ -159,10 +152,8 @@
</span><span class="cx">         logFootprintComparison(footprintBefore, footprintAfter);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-        // Since this is a simulation, unset the &quot;under memory pressure&quot; flag on next runloop.
</del><span class="cx">         dispatch_async(dispatch_get_main_queue(), ^{
</span><del>-            MemoryPressureHandler::singleton().setUnderMemoryPressure(wasUnderMemoryPressure);
-            m_isSimulatedMemoryPressure = false;
</del><ins>+            endSimulatedMemoryPressure();
</ins><span class="cx">         });
</span><span class="cx">     });
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (203378 => 203379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-07-18 22:46:37 UTC (rev 203378)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-07-18 23:16:24 UTC (rev 203379)
</span><span class="lines">@@ -88,6 +88,7 @@
</span><span class="cx"> #include &quot;MediaPlayer.h&quot;
</span><span class="cx"> #include &quot;MemoryCache.h&quot;
</span><span class="cx"> #include &quot;MemoryInfo.h&quot;
</span><ins>+#include &quot;MemoryPressureHandler.h&quot;
</ins><span class="cx"> #include &quot;MockPageOverlay.h&quot;
</span><span class="cx"> #include &quot;MockPageOverlayClient.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="lines">@@ -2031,6 +2032,21 @@
</span><span class="cx">     document-&gt;cachedResourceLoader().garbageCollectDocumentResources();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool Internals::isUnderMemoryPressure()
+{
+    return MemoryPressureHandler::singleton().isUnderMemoryPressure();
+}
+
+void Internals::beginSimulatedMemoryPressure()
+{
+    MemoryPressureHandler::singleton().beginSimulatedMemoryPressure();
+}
+
+void Internals::endSimulatedMemoryPressure()
+{
+    MemoryPressureHandler::singleton().endSimulatedMemoryPressure();
+}
+
</ins><span class="cx"> void Internals::insertAuthorCSS(const String&amp; css, ExceptionCode&amp; ec) const
</span><span class="cx"> {
</span><span class="cx">     Document* document = contextDocument();
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (203378 => 203379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2016-07-18 22:46:37 UTC (rev 203378)
+++ trunk/Source/WebCore/testing/Internals.h        2016-07-18 23:16:24 UTC (rev 203379)
</span><span class="lines">@@ -266,6 +266,10 @@
</span><span class="cx"> 
</span><span class="cx">     void garbageCollectDocumentResources(ExceptionCode&amp;) const;
</span><span class="cx"> 
</span><ins>+    void beginSimulatedMemoryPressure();
+    void endSimulatedMemoryPressure();
+    bool isUnderMemoryPressure();
+
</ins><span class="cx">     void insertAuthorCSS(const String&amp;, ExceptionCode&amp;) const;
</span><span class="cx">     void insertUserCSS(const String&amp;, ExceptionCode&amp;) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (203378 => 203379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2016-07-18 22:46:37 UTC (rev 203378)
+++ trunk/Source/WebCore/testing/Internals.idl        2016-07-18 23:16:24 UTC (rev 203379)
</span><span class="lines">@@ -258,6 +258,10 @@
</span><span class="cx">     [RaisesException] void insertAuthorCSS(DOMString css);
</span><span class="cx">     [RaisesException] void insertUserCSS(DOMString css);
</span><span class="cx"> 
</span><ins>+    readonly attribute boolean isUnderMemoryPressure;
+    void beginSimulatedMemoryPressure();
+    void endSimulatedMemoryPressure();
+
</ins><span class="cx"> #if defined(ENABLE_BATTERY_STATUS) &amp;&amp; ENABLE_BATTERY_STATUS
</span><span class="cx">     [RaisesException] void setBatteryStatus(DOMString eventType, boolean charging, unrestricted double chargingTime, unrestricted double dischargingTime, unrestricted double level);
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>