<!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>[202347] trunk/Source/WebKit2</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/202347">202347</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2016-06-22 13:39:49 -0700 (Wed, 22 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Mail snapshot has black webview in multitasking switcher
https://bugs.webkit.org/show_bug.cgi?id=159036
&lt;rdar://problem/25972938&gt;

Reviewed by Simon Fraser.

There is a window of time between an application going into the background
and SpringBoard's snapshotting mechanism completing where it is possible
(though difficult, timing-wise) for RemoteLayerBackingStoreCollection to
make still-needed surfaces volatile (and, even worse, for them to get emptied).

UIKit suggested instead waiting for the window context teardown notification,
which does indeed seem to fire after the snapshotting is complete.
This may have the convenient side effect of making the volatility timer
repeat fewer times in general, because it is now started closer to the
last time that the surfaces will be in-use.

* UIProcess/ApplicationStateTracker.h:
* UIProcess/ApplicationStateTracker.mm:
(WebKit::ApplicationStateTracker::ApplicationStateTracker):
(WebKit::ApplicationStateTracker::~ApplicationStateTracker):
(WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView didMoveToWindow]):
(-[WKContentView _applicationDidFinishSnapshottingAfterEnteringBackground]):
* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView didMoveToWindow]):
(-[WKPDFView _applicationDidFinishSnapshottingAfterEnteringBackground]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationDidEnterBackground):
(WebKit::WebPage::applicationDidFinishSnapshottingAfterEnteringBackground):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessApplicationStateTrackerh">trunk/Source/WebKit2/UIProcess/ApplicationStateTracker.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessApplicationStateTrackermm">trunk/Source/WebKit2/UIProcess/ApplicationStateTracker.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewmm">trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKPDFViewmm">trunk/Source/WebKit2/UIProcess/ios/WKPDFView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagemessagesin">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (202346 => 202347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-06-22 20:38:15 UTC (rev 202346)
+++ trunk/Source/WebKit2/ChangeLog        2016-06-22 20:39:49 UTC (rev 202347)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2016-06-22  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Mail snapshot has black webview in multitasking switcher
+        https://bugs.webkit.org/show_bug.cgi?id=159036
+        &lt;rdar://problem/25972938&gt;
+
+        Reviewed by Simon Fraser.
+
+        There is a window of time between an application going into the background
+        and SpringBoard's snapshotting mechanism completing where it is possible
+        (though difficult, timing-wise) for RemoteLayerBackingStoreCollection to
+        make still-needed surfaces volatile (and, even worse, for them to get emptied).
+
+        UIKit suggested instead waiting for the window context teardown notification,
+        which does indeed seem to fire after the snapshotting is complete.
+        This may have the convenient side effect of making the volatility timer
+        repeat fewer times in general, because it is now started closer to the
+        last time that the surfaces will be in-use.
+
+        * UIProcess/ApplicationStateTracker.h:
+        * UIProcess/ApplicationStateTracker.mm:
+        (WebKit::ApplicationStateTracker::ApplicationStateTracker):
+        (WebKit::ApplicationStateTracker::~ApplicationStateTracker):
+        (WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/WKContentView.mm:
+        (-[WKContentView didMoveToWindow]):
+        (-[WKContentView _applicationDidFinishSnapshottingAfterEnteringBackground]):
+        * UIProcess/ios/WKPDFView.mm:
+        (-[WKPDFView didMoveToWindow]):
+        (-[WKPDFView _applicationDidFinishSnapshottingAfterEnteringBackground]):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::applicationDidEnterBackground):
+        (WebKit::WebPage::applicationDidFinishSnapshottingAfterEnteringBackground):
+
</ins><span class="cx"> 2016-06-22  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add logging related to process assertions to help debug process suspension issues
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessApplicationStateTrackerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ApplicationStateTracker.h (202346 => 202347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ApplicationStateTracker.h        2016-06-22 20:38:15 UTC (rev 202346)
+++ trunk/Source/WebKit2/UIProcess/ApplicationStateTracker.h        2016-06-22 20:39:49 UTC (rev 202347)
</span><span class="lines">@@ -39,7 +39,7 @@
</span><span class="cx"> 
</span><span class="cx"> class ApplicationStateTracker {
</span><span class="cx"> public:
</span><del>-    ApplicationStateTracker(UIView *, SEL didEnterBackgroundSelector, SEL willEnterForegroundSelector);
</del><ins>+    ApplicationStateTracker(UIView *, SEL didEnterBackgroundSelector, SEL didFinishSnapshottingAfterEnteringBackgroundSelector, SEL willEnterForegroundSelector);
</ins><span class="cx">     ~ApplicationStateTracker();
</span><span class="cx"> 
</span><span class="cx">     bool isInBackground() const { return m_isInBackground; }
</span><span class="lines">@@ -46,10 +46,12 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     void applicationDidEnterBackground();
</span><ins>+    void applicationDidFinishSnapshottingAfterEnteringBackground();
</ins><span class="cx">     void applicationWillEnterForeground();
</span><span class="cx"> 
</span><span class="cx">     WeakObjCPtr&lt;UIView&gt; m_view;
</span><span class="cx">     SEL m_didEnterBackgroundSelector;
</span><ins>+    SEL m_didFinishSnapshottingAfterEnteringBackgroundSelector;
</ins><span class="cx">     SEL m_willEnterForegroundSelector;
</span><span class="cx"> 
</span><span class="cx">     bool m_isInBackground;
</span><span class="lines">@@ -59,6 +61,7 @@
</span><span class="cx">     RetainPtr&lt;BKSApplicationStateMonitor&gt; m_applicationStateMonitor;
</span><span class="cx"> 
</span><span class="cx">     id m_didEnterBackgroundObserver;
</span><ins>+    id m_didFinishSnapshottingAfterEnteringBackgroundObserver;
</ins><span class="cx">     id m_willEnterForegroundObserver;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessApplicationStateTrackermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ApplicationStateTracker.mm (202346 => 202347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ApplicationStateTracker.mm        2016-06-22 20:38:15 UTC (rev 202346)
+++ trunk/Source/WebKit2/UIProcess/ApplicationStateTracker.mm        2016-06-22 20:39:49 UTC (rev 202347)
</span><span class="lines">@@ -73,25 +73,36 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ApplicationStateTracker::ApplicationStateTracker(UIView *view, SEL didEnterBackgroundSelector, SEL willEnterForegroundSelector)
</del><ins>+ApplicationStateTracker::ApplicationStateTracker(UIView *view, SEL didEnterBackgroundSelector, SEL didFinishSnapshottingAfterEnteringBackgroundSelector, SEL willEnterForegroundSelector)
</ins><span class="cx">     : m_view(view)
</span><span class="cx">     , m_didEnterBackgroundSelector(didEnterBackgroundSelector)
</span><ins>+    , m_didFinishSnapshottingAfterEnteringBackgroundSelector(didFinishSnapshottingAfterEnteringBackgroundSelector)
</ins><span class="cx">     , m_willEnterForegroundSelector(willEnterForegroundSelector)
</span><span class="cx">     , m_isInBackground(true)
</span><span class="cx">     , m_weakPtrFactory(this)
</span><span class="cx">     , m_didEnterBackgroundObserver(nullptr)
</span><ins>+    , m_didFinishSnapshottingAfterEnteringBackgroundObserver(nullptr)
</ins><span class="cx">     , m_willEnterForegroundObserver(nullptr)
</span><span class="cx"> {
</span><span class="cx">     ASSERT([m_view.get() respondsToSelector:m_didEnterBackgroundSelector]);
</span><ins>+    ASSERT([m_view.get() respondsToSelector:m_didFinishSnapshottingAfterEnteringBackgroundSelector]);
</ins><span class="cx">     ASSERT([m_view.get() respondsToSelector:m_willEnterForegroundSelector]);
</span><span class="cx"> 
</span><span class="cx">     UIWindow *window = [m_view.get() window];
</span><span class="cx">     ASSERT(window);
</span><span class="cx"> 
</span><ins>+    NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
+    auto weakThis = m_weakPtrFactory.createWeakPtr();
+    m_didFinishSnapshottingAfterEnteringBackgroundObserver = [notificationCenter addObserverForName:@&quot;_UIWindowWillDestroyWindowContextNotification&quot; object:window queue:nil usingBlock:[weakThis](NSNotification *) {
+        auto applicationStateTracker = weakThis.get();
+        if (!applicationStateTracker)
+            return;
+        applicationStateTracker-&gt;applicationDidFinishSnapshottingAfterEnteringBackground();
+    }];
+
</ins><span class="cx">     switch (applicationType(window)) {
</span><span class="cx">     case ApplicationType::Application: {
</span><span class="cx">         UIApplication *application = [UIApplication sharedApplication];
</span><del>-        NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
</del><span class="cx"> 
</span><span class="cx">         m_isInBackground = application.applicationState == UIApplicationStateBackground;
</span><span class="cx"> 
</span><span class="lines">@@ -125,7 +136,6 @@
</span><span class="cx">         auto applicationStateMonitor = adoptNS([[BKSApplicationStateMonitor alloc] init]);
</span><span class="cx">         m_isInBackground = isBackgroundState([m_applicationStateMonitor mostElevatedApplicationStateForPID:applicationPID]);
</span><span class="cx"> 
</span><del>-        NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
</del><span class="cx">         m_didEnterBackgroundObserver = [notificationCenter addObserverForName:@&quot;_UIViewServiceHostDidEnterBackgroundNotification&quot; object:serviceViewController queue:nil usingBlock:[this](NSNotification *) {
</span><span class="cx">             applicationDidEnterBackground();
</span><span class="cx">         }];
</span><span class="lines">@@ -141,7 +151,6 @@
</span><span class="cx"> 
</span><span class="cx">         m_isInBackground = isBackgroundState([m_applicationStateMonitor mostElevatedApplicationStateForPID:getpid()]);
</span><span class="cx"> 
</span><del>-        auto weakThis = m_weakPtrFactory.createWeakPtr();
</del><span class="cx">         [m_applicationStateMonitor setHandler:[weakThis](NSDictionary *userInfo) {
</span><span class="cx">             pid_t pid = [userInfo[BKSApplicationStateProcessIDKey] integerValue];
</span><span class="cx">             if (pid != getpid())
</span><span class="lines">@@ -174,6 +183,7 @@
</span><span class="cx"> 
</span><span class="cx">     NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
</span><span class="cx">     [notificationCenter removeObserver:m_didEnterBackgroundObserver];
</span><ins>+    [notificationCenter removeObserver:m_didFinishSnapshottingAfterEnteringBackgroundObserver];
</ins><span class="cx">     [notificationCenter removeObserver:m_willEnterForegroundObserver];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -185,6 +195,12 @@
</span><span class="cx">         wtfObjcMsgSend&lt;void&gt;(view.get(), m_didEnterBackgroundSelector);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground()
+{
+    if (auto view = m_view.get())
+        wtfObjcMsgSend&lt;void&gt;(view.get(), m_didFinishSnapshottingAfterEnteringBackgroundSelector);
+}
+
</ins><span class="cx"> void ApplicationStateTracker::applicationWillEnterForeground()
</span><span class="cx"> {
</span><span class="cx">     m_isInBackground = false;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (202346 => 202347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-06-22 20:38:15 UTC (rev 202346)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2016-06-22 20:39:49 UTC (rev 202347)
</span><span class="lines">@@ -511,6 +511,7 @@
</span><span class="cx">     void setAssistedNodeValueAsNumber(double);
</span><span class="cx">     void setAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection = false);
</span><span class="cx">     void applicationDidEnterBackground();
</span><ins>+    void applicationDidFinishSnapshottingAfterEnteringBackground();
</ins><span class="cx">     void applicationWillEnterForeground();
</span><span class="cx">     void applicationWillResignActive();
</span><span class="cx">     void applicationDidBecomeActive();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (202346 => 202347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2016-06-22 20:38:15 UTC (rev 202346)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2016-06-22 20:39:49 UTC (rev 202347)
</span><span class="lines">@@ -284,7 +284,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!_applicationStateTracker);
</span><del>-    _applicationStateTracker = std::make_unique&lt;ApplicationStateTracker&gt;(self, @selector(_applicationDidEnterBackground), @selector(_applicationWillEnterForeground));
</del><ins>+    _applicationStateTracker = std::make_unique&lt;ApplicationStateTracker&gt;(self, @selector(_applicationDidEnterBackground), @selector(_applicationDidFinishSnapshottingAfterEnteringBackground), @selector(_applicationWillEnterForeground));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (WKBrowsingContextController *)browsingContextController
</span><span class="lines">@@ -601,6 +601,11 @@
</span><span class="cx">     _page-&gt;viewStateDidChange(ViewState::AllFlags &amp; ~ViewState::IsInWindow);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_applicationDidFinishSnapshottingAfterEnteringBackground
+{
+    _page-&gt;applicationDidFinishSnapshottingAfterEnteringBackground();
+}
+
</ins><span class="cx"> - (void)_applicationWillEnterForeground
</span><span class="cx"> {
</span><span class="cx">     _page-&gt;applicationWillEnterForeground();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKPDFViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKPDFView.mm (202346 => 202347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKPDFView.mm        2016-06-22 20:38:15 UTC (rev 202346)
+++ trunk/Source/WebKit2/UIProcess/ios/WKPDFView.mm        2016-06-22 20:39:49 UTC (rev 202347)
</span><span class="lines">@@ -864,7 +864,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(!_applicationStateTracker);
</span><del>-    _applicationStateTracker = std::make_unique&lt;ApplicationStateTracker&gt;(self, @selector(_applicationDidEnterBackground), @selector(_applicationWillEnterForeground));
</del><ins>+    _applicationStateTracker = std::make_unique&lt;ApplicationStateTracker&gt;(self, @selector(_applicationDidEnterBackground), @selector(_applicationDidFinishSnapshottingAfterEnteringBackground), @selector(_applicationWillEnterForeground));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)isBackground
</span><span class="lines">@@ -881,6 +881,11 @@
</span><span class="cx">     _webView-&gt;_page-&gt;viewStateDidChange(ViewState::AllFlags &amp; ~ViewState::IsInWindow);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_applicationDidFinishSnapshottingAfterEnteringBackground
+{
+    _webView-&gt;_page-&gt;applicationDidFinishSnapshottingAfterEnteringBackground();
+}
+
</ins><span class="cx"> - (void)_applicationWillEnterForeground
</span><span class="cx"> {
</span><span class="cx">     _webView-&gt;_page-&gt;applicationWillEnterForeground();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (202346 => 202347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2016-06-22 20:38:15 UTC (rev 202346)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2016-06-22 20:39:49 UTC (rev 202347)
</span><span class="lines">@@ -640,6 +640,11 @@
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::ApplicationDidEnterBackground(isSuspendedUnderLock), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground()
+{
+    m_process-&gt;send(Messages::WebPage::ApplicationDidFinishSnapshottingAfterEnteringBackground(), m_pageID);
+}
+
</ins><span class="cx"> void WebPageProxy::applicationWillEnterForeground()
</span><span class="cx"> {
</span><span class="cx">     bool isSuspendedUnderLock = [UIApp isSuspendedUnderLock];
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (202346 => 202347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2016-06-22 20:38:15 UTC (rev 202346)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2016-06-22 20:39:49 UTC (rev 202347)
</span><span class="lines">@@ -819,6 +819,7 @@
</span><span class="cx">     void willStartUserTriggeredZooming();
</span><span class="cx">     void applicationWillResignActive();
</span><span class="cx">     void applicationDidEnterBackground(bool isSuspendedUnderLock);
</span><ins>+    void applicationDidFinishSnapshottingAfterEnteringBackground();
</ins><span class="cx">     void applicationWillEnterForeground(bool isSuspendedUnderLock);
</span><span class="cx">     void applicationDidBecomeActive();
</span><span class="cx">     void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (202346 => 202347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2016-06-22 20:38:15 UTC (rev 202346)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2016-06-22 20:39:49 UTC (rev 202347)
</span><span class="lines">@@ -86,6 +86,7 @@
</span><span class="cx">     SetAssistedNodeSelectedIndex(uint32_t index, bool allowMultipleSelection)
</span><span class="cx">     ApplicationWillResignActive()
</span><span class="cx">     ApplicationDidEnterBackground(bool isSuspendedUnderLock)
</span><ins>+    ApplicationDidFinishSnapshottingAfterEnteringBackground()
</ins><span class="cx">     ApplicationWillEnterForeground(bool isSuspendedUnderLock)
</span><span class="cx">     ApplicationDidBecomeActive()
</span><span class="cx">     ContentSizeCategoryDidChange(String contentSizeCategory)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (202346 => 202347)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-06-22 20:38:15 UTC (rev 202346)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2016-06-22 20:39:49 UTC (rev 202347)
</span><span class="lines">@@ -2978,6 +2978,10 @@
</span><span class="cx"> 
</span><span class="cx">     m_isSuspendedUnderLock = isSuspendedUnderLock;
</span><span class="cx">     setLayerTreeStateIsFrozen(true);
</span><ins>+}
+
+void WebPage::applicationDidFinishSnapshottingAfterEnteringBackground()
+{
</ins><span class="cx">     markLayersVolatile();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>