Title: [245297] trunk/Source/WebKit
Revision
245297
Author
[email protected]
Date
2019-05-14 12:32:17 -0700 (Tue, 14 May 2019)

Log Message

The network process tries to take a process assertion when NetworkProcess::processWillSuspendImminently() is called
https://bugs.webkit.org/show_bug.cgi?id=197888

Reviewed by Geoffrey Garen.

When actualPrepareToSuspend() in the Network process is called set the 'IsSuspended' flag on the SQLite database tracker and unset
the flag when the process resume. This is consistent with what we already do in the WebProcess and makes sure that
the network process does not try and take on a new assertion due to locked files when getting notified it is about to get
suspended.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::actualPrepareToSuspend):
(WebKit::NetworkProcess::processWillSuspendImminently):
(WebKit::NetworkProcess::resume):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (245296 => 245297)


--- trunk/Source/WebKit/ChangeLog	2019-05-14 19:30:19 UTC (rev 245296)
+++ trunk/Source/WebKit/ChangeLog	2019-05-14 19:32:17 UTC (rev 245297)
@@ -1,5 +1,22 @@
 2019-05-14  Chris Dumez  <[email protected]>
 
+        The network process tries to take a process assertion when NetworkProcess::processWillSuspendImminently() is called
+        https://bugs.webkit.org/show_bug.cgi?id=197888
+
+        Reviewed by Geoffrey Garen.
+
+        When actualPrepareToSuspend() in the Network process is called set the 'IsSuspended' flag on the SQLite database tracker and unset
+        the flag when the process resume. This is consistent with what we already do in the WebProcess and makes sure that
+        the network process does not try and take on a new assertion due to locked files when getting notified it is about to get
+        suspended.
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::actualPrepareToSuspend):
+        (WebKit::NetworkProcess::processWillSuspendImminently):
+        (WebKit::NetworkProcess::resume):
+
+2019-05-14  Chris Dumez  <[email protected]>
+
         Update TBA macros for API / SPI that has already shipped
         https://bugs.webkit.org/show_bug.cgi?id=197841
         <rdar://problem/50698499>

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (245296 => 245297)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2019-05-14 19:30:19 UTC (rev 245296)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2019-05-14 19:32:17 UTC (rev 245297)
@@ -1922,6 +1922,10 @@
 
 void NetworkProcess::actualPrepareToSuspend(ShouldAcknowledgeWhenReadyToSuspend shouldAcknowledgeWhenReadyToSuspend)
 {
+#if PLATFORM(IOS_FAMILY)
+    m_webSQLiteDatabaseTracker.setIsSuspended(true);
+#endif
+
     lowMemoryHandler(Critical::Yes);
 
     RefPtr<TaskCounter> delayedTaskCounter;
@@ -1947,6 +1951,7 @@
 
 void NetworkProcess::processWillSuspendImminently(CompletionHandler<void(bool)>&& completionHandler)
 {
+    RELEASE_LOG(ProcessSuspension, "%p - NetworkProcess::processWillSuspendImminently()", this);
 #if PLATFORM(IOS_FAMILY) && ENABLE(INDEXED_DATABASE)
     for (auto& server : m_idbServers.values())
         server->tryStop(IDBServer::ShouldForceStop::Yes);
@@ -1994,6 +1999,10 @@
 
 void NetworkProcess::resume()
 {
+#if PLATFORM(IOS_FAMILY)
+    m_webSQLiteDatabaseTracker.setIsSuspended(false);
+#endif
+
     platformProcessDidResume();
     for (auto& connection : m_webProcessConnections)
         connection->endSuspension();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to