<!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>[186075] trunk/Source</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/186075">186075</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2015-06-29 11:56:56 -0700 (Mon, 29 Jun 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use DISPATCH_SOURCE_TYPE_MEMORYPRESSURE instead of DISPATCH_SOURCE_TYPE_MEMORYSTATUS
https://bugs.webkit.org/show_bug.cgi?id=146413
Source/WebCore:

rdar://problem/21295036

Reviewed by Andreas Kling.

Replace SPI with API.

* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::install):
* platform/mac/WebCoreSystemInterface.h:
* platform/spi/cocoa/DispatchSPI.h: Removed.

Source/WebKit/mac:

Reviewed by Andreas Kling.

Replace SPI with API.

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Deleted.
* WebView/WebView.mm:
(+[WebView registerForMemoryNotifications]):

Source/WebKit2:

Reviewed by Andreas Kling.

Replace SPI with API.

* UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
(WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformcocoaMemoryPressureHandlerCocoamm">trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacWebCoreSystemInterfaceh">trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebSystemInterfacemm">trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebMemoryPressureHandlerIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebMemoryPressureHandlerIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportmacWebSystemInterfacemm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformspicocoaDispatchSPIh">trunk/Source/WebCore/platform/spi/cocoa/DispatchSPI.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (186074 => 186075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-06-29 18:46:37 UTC (rev 186074)
+++ trunk/Source/WebCore/ChangeLog        2015-06-29 18:56:56 UTC (rev 186075)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2015-06-29  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Use DISPATCH_SOURCE_TYPE_MEMORYPRESSURE instead of DISPATCH_SOURCE_TYPE_MEMORYSTATUS
+        https://bugs.webkit.org/show_bug.cgi?id=146413
+        rdar://problem/21295036
+
+        Reviewed by Andreas Kling.
+
+        Replace SPI with API.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/cocoa/MemoryPressureHandlerCocoa.mm:
+        (WebCore::MemoryPressureHandler::install):
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/spi/cocoa/DispatchSPI.h: Removed.
+
</ins><span class="cx"> 2015-06-29  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Pausing a media element should discard buffered data immediately if under memory pressure.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (186074 => 186075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-06-29 18:46:37 UTC (rev 186074)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-06-29 18:56:56 UTC (rev 186075)
</span><span class="lines">@@ -5901,7 +5901,6 @@
</span><span class="cx">                 CE1252451A16C22500864480 /* DynamicLinkerSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252441A16C22500864480 /* DynamicLinkerSPI.h */; };
</span><span class="cx">                 CE1252471A16C2C200864480 /* NSPointerFunctionsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252461A16C2C200864480 /* NSPointerFunctionsSPI.h */; };
</span><span class="cx">                 CE1252491A16C3BC00864480 /* MobileGestaltSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252481A16C3BC00864480 /* MobileGestaltSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><del>-                CE12524B1A16C79B00864480 /* DispatchSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE12524A1A16C79B00864480 /* DispatchSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><span class="cx">                 CE12524D1A1A77DE00864480 /* IOPMLibSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE12524C1A1A77DE00864480 /* IOPMLibSPI.h */; };
</span><span class="cx">                 CE12524F1A1A78D200864480 /* MachVMSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE12524E1A1A78D200864480 /* MachVMSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 CE1252511A1BEBD800864480 /* NSCalendarDateSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252501A1BEBD800864480 /* NSCalendarDateSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -13539,7 +13538,6 @@
</span><span class="cx">                 CE1252441A16C22500864480 /* DynamicLinkerSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLinkerSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CE1252461A16C2C200864480 /* NSPointerFunctionsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSPointerFunctionsSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CE1252481A16C3BC00864480 /* MobileGestaltSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MobileGestaltSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                CE12524A1A16C79B00864480 /* DispatchSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DispatchSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 CE12524C1A1A77DE00864480 /* IOPMLibSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IOPMLibSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CE12524E1A1A78D200864480 /* MachVMSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachVMSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 CE1252501A1BEBD800864480 /* NSCalendarDateSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSCalendarDateSPI.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16619,7 +16617,6 @@
</span><span class="cx">                                 CD4097FF1A8C855F004C65E9 /* CFNSURLConnectionSPI.h */,
</span><span class="cx">                                 1C5E980F1A02CEFA002DB55F /* CoreTextSPI.h */,
</span><span class="cx">                                 935E2B4D1AFF06CA00976F9F /* DataDetectorsCoreSPI.h */,
</span><del>-                                CE12524A1A16C79B00864480 /* DispatchSPI.h */,
</del><span class="cx">                                 CE1252441A16C22500864480 /* DynamicLinkerSPI.h */,
</span><span class="cx">                                 CE12524C1A1A77DE00864480 /* IOPMLibSPI.h */,
</span><span class="cx">                                 44DEF6421A6FF92700D45EEC /* IOReturnSPI.h */,
</span><span class="lines">@@ -24318,7 +24315,6 @@
</span><span class="cx">                                 937FF3D51A1012D6008EBA31 /* DictionaryLookup.h in Headers */,
</span><span class="cx">                                 FDAF19991513D131008DB0C3 /* DirectConvolver.h in Headers */,
</span><span class="cx">                                 7EDAAFC919A2CCDC0034DFD1 /* DiskCacheMonitorCocoa.h in Headers */,
</span><del>-                                CE12524B1A16C79B00864480 /* DispatchSPI.h in Headers */,
</del><span class="cx">                                 49AF2D6914435D050016A784 /* DisplayRefreshMonitor.h in Headers */,
</span><span class="cx">                                 2D29ECC6192ECC8300984B78 /* DisplayRefreshMonitorClient.h in Headers */,
</span><span class="cx">                                 2D29ECCA192F1F1D00984B78 /* DisplayRefreshMonitorIOS.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformcocoaMemoryPressureHandlerCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm (186074 => 186075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm        2015-06-29 18:46:37 UTC (rev 186074)
+++ trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm        2015-06-29 18:56:56 UTC (rev 186075)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #import &quot;config.h&quot;
</span><span class="cx"> #import &quot;MemoryPressureHandler.h&quot;
</span><span class="cx"> 
</span><del>-#import &quot;DispatchSPI.h&quot;
</del><span class="cx"> #import &quot;IOSurfacePool.h&quot;
</span><span class="cx"> #import &quot;GCController.h&quot;
</span><span class="cx"> #import &quot;JSDOMWindow.h&quot;
</span><span class="lines">@@ -102,36 +101,33 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     dispatch_async(dispatch_get_main_queue(), ^{
</span><del>-#if PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 80000
-        _cache_event_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYSTATUS, 0, DISPATCH_MEMORYSTATUS_PRESSURE_NORMAL | DISPATCH_MEMORYSTATUS_PRESSURE_WARN | DISPATCH_MEMORYSTATUS_PRESSURE_CRITICAL, dispatch_get_main_queue());
</del><ins>+#if PLATFORM(IOS)
+        _cache_event_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYPRESSURE, 0, DISPATCH_MEMORYPRESSURE_NORMAL | DISPATCH_MEMORYPRESSURE_WARN | DISPATCH_MEMORYPRESSURE_CRITICAL, dispatch_get_main_queue());
</ins><span class="cx"> #elif PLATFORM(MAC)
</span><del>-        _cache_event_source = wkCreateMemoryStatusPressureCriticalDispatchOnMainQueue();
-#else
-        _cache_event_source = wkCreateVMPressureDispatchOnMainQueue();
</del><ins>+        _cache_event_source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYPRESSURE, 0, DISPATCH_MEMORYPRESSURE_CRITICAL, dispatch_get_main_queue());
</ins><span class="cx"> #endif
</span><del>-        if (_cache_event_source) {
-            dispatch_set_context(_cache_event_source, this);
-            dispatch_source_set_event_handler(_cache_event_source, ^{
-                bool critical = true;
-#if PLATFORM(IOS) &amp;&amp; __IPHONE_OS_VERSION_MIN_REQUIRED &gt;= 80000
-                unsigned long status = dispatch_source_get_data(_cache_event_source);
-                critical = status == DISPATCH_MEMORYPRESSURE_CRITICAL;
-                auto&amp; memoryPressureHandler = MemoryPressureHandler::singleton();
-                bool wasCritical = memoryPressureHandler.isUnderMemoryPressure();
-                memoryPressureHandler.setUnderMemoryPressure(critical);
-                if (status == DISPATCH_MEMORYSTATUS_PRESSURE_NORMAL) {
-                    if (ReliefLogger::loggingEnabled())
-                        NSLog(@&quot;System is no longer under (%s) memory pressure.&quot;, wasCritical ? &quot;critical&quot; : &quot;non-critical&quot;);
-                    return;
-                }
</del><span class="cx"> 
</span><ins>+        dispatch_set_context(_cache_event_source, this);
+        dispatch_source_set_event_handler(_cache_event_source, ^{
+            bool critical = true;
+#if PLATFORM(IOS)
+            unsigned long status = dispatch_source_get_data(_cache_event_source);
+            critical = status == DISPATCH_MEMORYPRESSURE_CRITICAL;
+            auto&amp; memoryPressureHandler = MemoryPressureHandler::singleton();
+            bool wasCritical = memoryPressureHandler.isUnderMemoryPressure();
+            memoryPressureHandler.setUnderMemoryPressure(critical);
+            if (status == DISPATCH_MEMORYPRESSURE_NORMAL) {
</ins><span class="cx">                 if (ReliefLogger::loggingEnabled())
</span><del>-                    NSLog(@&quot;Got memory pressure notification (%s)&quot;, critical ? &quot;critical&quot; : &quot;non-critical&quot;);
</del><ins>+                    NSLog(@&quot;System is no longer under (%s) memory pressure.&quot;, wasCritical ? &quot;critical&quot; : &quot;non-critical&quot;);
+                return;
+            }
+
+            if (ReliefLogger::loggingEnabled())
+                NSLog(@&quot;Got memory pressure notification (%s)&quot;, critical ? &quot;critical&quot; : &quot;non-critical&quot;);
</ins><span class="cx"> #endif
</span><del>-                MemoryPressureHandler::singleton().respondToMemoryPressure(critical ? Critical::Yes : Critical::No);
-            });
-            dispatch_resume(_cache_event_source);
-        }
</del><ins>+            MemoryPressureHandler::singleton().respondToMemoryPressure(critical ? Critical::Yes : Critical::No);
+        });
+        dispatch_resume(_cache_event_source);
</ins><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     // Allow simulation of memory pressure with &quot;notifyutil -p org.WebKit.lowMemory&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacWebCoreSystemInterfaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h (186074 => 186075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h        2015-06-29 18:46:37 UTC (rev 186074)
+++ trunk/Source/WebCore/platform/mac/WebCoreSystemInterface.h        2015-06-29 18:56:56 UTC (rev 186075)
</span><span class="lines">@@ -287,16 +287,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><del>-#import &lt;dispatch/dispatch.h&gt;
-
-extern dispatch_source_t (*wkCreateVMPressureDispatchOnMainQueue)(void);
-#endif
-
-#if PLATFORM(MAC)
-extern dispatch_source_t (*wkCreateMemoryStatusPressureCriticalDispatchOnMainQueue)(void);
-#endif
-    
-#if !PLATFORM(IOS)
</del><span class="cx"> extern bool (*wkExecutableWasLinkedOnOrBeforeLion)(void);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspicocoaDispatchSPIh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/spi/cocoa/DispatchSPI.h (186074 => 186075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/cocoa/DispatchSPI.h        2015-06-29 18:46:37 UTC (rev 186074)
+++ trunk/Source/WebCore/platform/spi/cocoa/DispatchSPI.h        2015-06-29 18:56:56 UTC (rev 186075)
</span><span class="lines">@@ -1,58 +0,0 @@
</span><del>-/*
- * Copyright (C) 2014 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 DispatchSPI_h
-#define DispatchSPI_h
-
-#include &lt;dispatch/dispatch.h&gt;
-
-#if USE(APPLE_INTERNAL_SDK)
-
-// FIXME: As a workaround for &lt;rdar://problem/18337182&gt;, we conditionally enclose the header
-// &lt;dispatch/private.h&gt; in an extern &quot;C&quot; linkage block to make it suitable for C++ use.
-#ifdef __cplusplus
-extern &quot;C&quot; {
-#endif
-
-#include &lt;dispatch/private.h&gt;
-
-#ifdef __cplusplus
-}
-#endif
-
-#else // USE(APPLE_INTERNAL_SDK)
-
-enum {
-    DISPATCH_MEMORYSTATUS_PRESSURE_NORMAL = 0x01,
-    DISPATCH_MEMORYSTATUS_PRESSURE_WARN = 0x02,
-    DISPATCH_MEMORYSTATUS_PRESSURE_CRITICAL = 0x04,
-};
-#define DISPATCH_SOURCE_TYPE_MEMORYSTATUS (&amp;_dispatch_source_type_memorystatus)
-
-#endif
-
-EXTERN_C const struct dispatch_source_type_s _dispatch_source_type_memorystatus;
-
-#endif // DispatchSPI_h
</del></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (186074 => 186075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-06-29 18:46:37 UTC (rev 186074)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-06-29 18:56:56 UTC (rev 186075)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-06-29  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Use DISPATCH_SOURCE_TYPE_MEMORYPRESSURE instead of DISPATCH_SOURCE_TYPE_MEMORYSTATUS
+        https://bugs.webkit.org/show_bug.cgi?id=146413
+
+        Reviewed by Andreas Kling.
+
+        Replace SPI with API.
+
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface): Deleted.
+        * WebView/WebView.mm:
+        (+[WebView registerForMemoryNotifications]):
+
</ins><span class="cx"> 2015-06-28  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Mac] Remove redundant call to colorUsingColorSpaceName:
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebSystemInterfacemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm (186074 => 186075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm        2015-06-29 18:46:37 UTC (rev 186074)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm        2015-06-29 18:56:56 UTC (rev 186075)
</span><span class="lines">@@ -178,8 +178,6 @@
</span><span class="cx">     INIT(DestroyRenderingResources);
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(IOS)
</span><del>-    INIT(CreateVMPressureDispatchOnMainQueue);
-    INIT(CreateMemoryStatusPressureCriticalDispatchOnMainQueue);
</del><span class="cx">     INIT(ExecutableWasLinkedOnOrBeforeLion);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (186074 => 186075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2015-06-29 18:46:37 UTC (rev 186074)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2015-06-29 18:56:56 UTC (rev 186075)
</span><span class="lines">@@ -243,7 +243,6 @@
</span><span class="cx"> #import &quot;WebStorageManagerPrivate.h&quot;
</span><span class="cx"> #import &quot;WebUIKitSupport.h&quot;
</span><span class="cx"> #import &quot;WebVisiblePosition.h&quot;
</span><del>-#import &lt;WebCore/DispatchSPI.h&gt;
</del><span class="cx"> #import &lt;WebCore/EventNames.h&gt;
</span><span class="cx"> #import &lt;WebCore/FontCache.h&gt;
</span><span class="cx"> #import &lt;WebCore/GraphicsLayer.h&gt;
</span><span class="lines">@@ -1285,7 +1284,7 @@
</span><span class="cx">         [WebView _handleMemoryWarning];
</span><span class="cx">     }, shouldAutoClearPressureOnMemoryRelease);
</span><span class="cx"> 
</span><del>-    static dispatch_source_t memoryNotificationEventSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYSTATUS, 0, DISPATCH_MEMORYSTATUS_PRESSURE_WARN, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
</del><ins>+    static dispatch_source_t memoryNotificationEventSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYPRESSURE, 0, DISPATCH_MEMORYPRESSURE_WARN, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
</ins><span class="cx">     dispatch_source_set_event_handler(memoryNotificationEventSource, ^{
</span><span class="cx">         // Set memory pressure flag and schedule releasing memory in web thread runloop exit.
</span><span class="cx">         MemoryPressureHandler::singleton().setReceivedMemoryPressure(WebCore::MemoryPressureReasonVMPressure);
</span><span class="lines">@@ -1295,15 +1294,15 @@
</span><span class="cx"> 
</span><span class="cx">     if (!shouldAutoClearPressureOnMemoryRelease) {
</span><span class="cx">         // Listen to memory status notification to reset the memory pressure flag.
</span><del>-        static dispatch_source_t memoryStatusEventSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYSTATUS,
</del><ins>+        static dispatch_source_t memoryStatusEventSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYPRESSURE,
</ins><span class="cx">                                                                                     0,
</span><del>-                                                                                    DISPATCH_MEMORYSTATUS_PRESSURE_WARN | DISPATCH_MEMORYSTATUS_PRESSURE_NORMAL,
</del><ins>+                                                                                    DISPATCH_MEMORYPRESSURE_WARN | DISPATCH_MEMORYPRESSURE_NORMAL,
</ins><span class="cx">                                                                                     dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0));
</span><span class="cx">         dispatch_source_set_event_handler(memoryStatusEventSource, ^{
</span><span class="cx">             unsigned long currentStatus = dispatch_source_get_data(memoryStatusEventSource);
</span><del>-            if (currentStatus == DISPATCH_MEMORYSTATUS_PRESSURE_NORMAL)
</del><ins>+            if (currentStatus == DISPATCH_MEMORYPRESSURE_NORMAL)
</ins><span class="cx">                 MemoryPressureHandler::singleton().clearMemoryPressure();
</span><del>-            else if (currentStatus == DISPATCH_MEMORYSTATUS_PRESSURE_WARN)
</del><ins>+            else if (currentStatus == DISPATCH_MEMORYPRESSURE_WARN)
</ins><span class="cx">                 MemoryPressureHandler::singleton().setReceivedMemoryPressure(WebCore::MemoryPressureReasonVMStatus);
</span><span class="cx">         });
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (186074 => 186075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-06-29 18:46:37 UTC (rev 186074)
+++ trunk/Source/WebKit2/ChangeLog        2015-06-29 18:56:56 UTC (rev 186075)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-06-29  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Use DISPATCH_SOURCE_TYPE_MEMORYPRESSURE instead of DISPATCH_SOURCE_TYPE_MEMORYSTATUS
+        https://bugs.webkit.org/show_bug.cgi?id=146413
+
+        Reviewed by Andreas Kling.
+
+        Replace SPI with API.
+
+        * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
+        (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface): Deleted.
+
</ins><span class="cx"> 2015-06-29  Enrica Casucci  &lt;enrica@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Hardware Keyboard: All combinations of arrow keys and space key do not scroll the view.
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebMemoryPressureHandlerIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebMemoryPressureHandlerIOS.mm (186074 => 186075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebMemoryPressureHandlerIOS.mm        2015-06-29 18:46:37 UTC (rev 186074)
+++ trunk/Source/WebKit2/UIProcess/ios/WebMemoryPressureHandlerIOS.mm        2015-06-29 18:56:56 UTC (rev 186075)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> 
</span><span class="cx"> #import &quot;ViewSnapshotStore.h&quot;
</span><del>-#import &lt;WebCore/DispatchSPI.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="lines">@@ -45,7 +44,7 @@
</span><span class="cx">     // Right now it cannot because WebKit1 and WebKit2 need to be able to coexist in the UI process,
</span><span class="cx">     // and you can only have one WebCore::MemoryPressureHandler.
</span><span class="cx"> 
</span><del>-    _source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYSTATUS, 0, DISPATCH_MEMORYSTATUS_PRESSURE_WARN, dispatch_get_main_queue());
</del><ins>+    _source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MEMORYPRESSURE, 0, DISPATCH_MEMORYPRESSURE_WARN, dispatch_get_main_queue());
</ins><span class="cx">     dispatch_set_context(_source, this);
</span><span class="cx">     dispatch_source_set_event_handler(_source, ^{
</span><span class="cx">         ViewSnapshotStore::singleton().discardSnapshotImages();
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportmacWebSystemInterfacemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm (186074 => 186075)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm        2015-06-29 18:46:37 UTC (rev 186074)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm        2015-06-29 18:56:56 UTC (rev 186075)
</span><span class="lines">@@ -156,15 +156,10 @@
</span><span class="cx">         INIT(CopyCFURLResponseSuggestedFilename);
</span><span class="cx">         INIT(SetCFURLResponseMIMEType);
</span><span class="cx"> 
</span><del>-#if !PLATFORM(IOS)
-        INIT(CreateVMPressureDispatchOnMainQueue);
-#endif
-
</del><span class="cx">         INIT(DestroyRenderingResources);
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">         INIT(ExecutableWasLinkedOnOrBeforeLion);
</span><del>-        INIT(CreateMemoryStatusPressureCriticalDispatchOnMainQueue);
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">         INIT(CGPathAddRoundedRect);
</span></span></pre>
</div>
</div>

</body>
</html>