Title: [242230] trunk/Source/WebKit
Revision
242230
Author
sihui_...@apple.com
Date
2019-02-28 14:45:06 -0800 (Thu, 28 Feb 2019)

Log Message

Revert r232263: it caused processes to crash because process was suspended with locked file
https://bugs.webkit.org/show_bug.cgi?id=195122
<rdar://problem/48444599>

Reviewed by Geoffrey Garen.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess):
* NetworkProcess/NetworkProcess.h:
* Shared/WebSQLiteDatabaseTracker.cpp:
(WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
(WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
* Shared/WebSQLiteDatabaseTracker.h:
* WebProcess/WebProcess.cpp:
(WebKit::m_webSQLiteDatabaseTracker):
(WebKit::m_nonVisibleProcessCleanupTimer): Deleted.
* WebProcess/WebProcess.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (242229 => 242230)


--- trunk/Source/WebKit/ChangeLog	2019-02-28 22:34:29 UTC (rev 242229)
+++ trunk/Source/WebKit/ChangeLog	2019-02-28 22:45:06 UTC (rev 242230)
@@ -1,3 +1,23 @@
+2019-02-28  Sihui Liu  <sihui_...@apple.com>
+
+        Revert r232263: it caused processes to crash because process was suspended with locked file
+        https://bugs.webkit.org/show_bug.cgi?id=195122
+        <rdar://problem/48444599>
+
+        Reviewed by Geoffrey Garen.
+
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::NetworkProcess):
+        * NetworkProcess/NetworkProcess.h:
+        * Shared/WebSQLiteDatabaseTracker.cpp:
+        (WebKit::WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker):
+        (WebKit::WebSQLiteDatabaseTracker::hysteresisUpdated):
+        * Shared/WebSQLiteDatabaseTracker.h:
+        * WebProcess/WebProcess.cpp:
+        (WebKit::m_webSQLiteDatabaseTracker):
+        (WebKit::m_nonVisibleProcessCleanupTimer): Deleted.
+        * WebProcess/WebProcess.h:
+
 2019-02-28  Per Arne Vollan  <pvol...@apple.com>
 
         [iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process.

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (242229 => 242230)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2019-02-28 22:34:29 UTC (rev 242229)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2019-02-28 22:45:06 UTC (rev 242230)
@@ -128,6 +128,9 @@
 #if ENABLE(CONTENT_EXTENSIONS)
     , m_networkContentRuleListManager(*this)
 #endif
+#if PLATFORM(IOS_FAMILY)
+    , m_webSQLiteDatabaseTracker(*this)
+#endif
 {
     NetworkProcessPlatformStrategies::initialize();
 

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (242229 => 242230)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h	2019-02-28 22:34:29 UTC (rev 242229)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h	2019-02-28 22:45:06 UTC (rev 242230)
@@ -49,6 +49,10 @@
 #include <wtf/RetainPtr.h>
 #include <wtf/WeakPtr.h>
 
+#if PLATFORM(IOS_FAMILY)
+#include "WebSQLiteDatabaseTracker.h"
+#endif
+
 #if PLATFORM(COCOA)
 typedef struct OpaqueCFHTTPCookieStorage*  CFHTTPCookieStorageRef;
 #endif
@@ -489,6 +493,10 @@
     NetworkContentRuleListManager m_networkContentRuleListManager;
 #endif
 
+#if PLATFORM(IOS_FAMILY)
+    WebSQLiteDatabaseTracker m_webSQLiteDatabaseTracker;
+#endif
+
     Ref<WorkQueue> m_storageTaskQueue { WorkQueue::create("com.apple.WebKit.StorageTask") };
 
 #if ENABLE(INDEXED_DATABASE)

Modified: trunk/Source/WebKit/Shared/WebSQLiteDatabaseTracker.cpp (242229 => 242230)


--- trunk/Source/WebKit/Shared/WebSQLiteDatabaseTracker.cpp	2019-02-28 22:34:29 UTC (rev 242229)
+++ trunk/Source/WebKit/Shared/WebSQLiteDatabaseTracker.cpp	2019-02-28 22:45:06 UTC (rev 242230)
@@ -36,8 +36,17 @@
 namespace WebKit {
 using namespace WebCore;
 
+WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker(WebProcess& process)
+    : m_process(process)
+    , m_processType(AuxiliaryProcess::ProcessType::WebContent)
+    , m_hysteresis([this](PAL::HysteresisState state) { hysteresisUpdated(state); })
+{
+    SQLiteDatabaseTracker::setClient(this);
+}
+
 WebSQLiteDatabaseTracker::WebSQLiteDatabaseTracker(NetworkProcess& process)
     : m_process(process)
+    , m_processType(AuxiliaryProcess::ProcessType::Network)
     , m_hysteresis([this](PAL::HysteresisState state) { hysteresisUpdated(state); })
 {
     SQLiteDatabaseTracker::setClient(this);
@@ -59,7 +68,16 @@
 
 void WebSQLiteDatabaseTracker::hysteresisUpdated(PAL::HysteresisState state)
 {
-    m_process.parentProcessConnection()->send(Messages::NetworkProcessProxy::SetIsHoldingLockedFiles(state == PAL::HysteresisState::Started), 0);
+    switch (m_processType) {
+    case AuxiliaryProcess::ProcessType::WebContent:
+        m_process.parentProcessConnection()->send(Messages::WebProcessProxy::SetIsHoldingLockedFiles(state == PAL::HysteresisState::Started), 0);
+        break;
+    case AuxiliaryProcess::ProcessType::Network:
+        m_process.parentProcessConnection()->send(Messages::NetworkProcessProxy::SetIsHoldingLockedFiles(state == PAL::HysteresisState::Started), 0);
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+    }
 }
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/Shared/WebSQLiteDatabaseTracker.h (242229 => 242230)


--- trunk/Source/WebKit/Shared/WebSQLiteDatabaseTracker.h	2019-02-28 22:34:29 UTC (rev 242229)
+++ trunk/Source/WebKit/Shared/WebSQLiteDatabaseTracker.h	2019-02-28 22:45:06 UTC (rev 242230)
@@ -32,10 +32,12 @@
 namespace WebKit {
 
 class NetworkProcess;
+class WebProcess;
 
 class WebSQLiteDatabaseTracker : public WebCore::SQLiteDatabaseTrackerClient {
     WTF_MAKE_NONCOPYABLE(WebSQLiteDatabaseTracker)
 public:
+    explicit WebSQLiteDatabaseTracker(WebProcess&);
     explicit WebSQLiteDatabaseTracker(NetworkProcess&);
 
     // WebCore::SQLiteDatabaseTrackerClient
@@ -45,7 +47,8 @@
 private:
     void hysteresisUpdated(PAL::HysteresisState);
 
-    NetworkProcess& m_process;
+    AuxiliaryProcess& m_process;
+    AuxiliaryProcess::ProcessType m_processType;
     PAL::HysteresisActivity m_hysteresis;
 };
 

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (242229 => 242230)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2019-02-28 22:34:29 UTC (rev 242229)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2019-02-28 22:45:06 UTC (rev 242230)
@@ -182,6 +182,9 @@
     , m_pluginProcessConnectionManager(PluginProcessConnectionManager::create())
 #endif
     , m_nonVisibleProcessCleanupTimer(*this, &WebProcess::nonVisibleProcessCleanupTimerFired)
+#if PLATFORM(IOS_FAMILY)
+    , m_webSQLiteDatabaseTracker(*this)
+#endif
 {
     // Initialize our platform strategies.
     WebPlatformStrategies::initialize();

Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (242229 => 242230)


--- trunk/Source/WebKit/WebProcess/WebProcess.h	2019-02-28 22:34:29 UTC (rev 242229)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h	2019-02-28 22:45:06 UTC (rev 242230)
@@ -55,6 +55,10 @@
 #include <wtf/MachSendRight.h>
 #endif
 
+#if PLATFORM(IOS_FAMILY)
+#include "WebSQLiteDatabaseTracker.h"
+#endif
+
 namespace API {
 class Object;
 }
@@ -471,6 +475,10 @@
 
     RefPtr<WebCore::ApplicationCacheStorage> m_applicationCacheStorage;
 
+#if PLATFORM(IOS_FAMILY)
+    WebSQLiteDatabaseTracker m_webSQLiteDatabaseTracker;
+#endif
+
     enum PageMarkingLayersAsVolatileCounterType { };
     using PageMarkingLayersAsVolatileCounter = RefCounter<PageMarkingLayersAsVolatileCounterType>;
     std::unique_ptr<PageMarkingLayersAsVolatileCounter> m_pageMarkingLayersAsVolatileCounter;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to