Skip to content
Permalink
Browse files
Revert r232263: it caused processes to crash because process was susp…
…ended 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:


Canonical link: https://commits.webkit.org/209512@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
szewai committed Feb 28, 2019
1 parent 0097fcf commit 5c1f7255d8dbf6ef6feaf888e64c28434855b9dd
Showing 7 changed files with 65 additions and 2 deletions.
@@ -1,3 +1,23 @@
2019-02-28 Sihui Liu <sihui_liu@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 <pvollan@apple.com>

[iOS] Move calls to [UIKeyboard isInHardwareKeyboardMode] to the UI process.
@@ -128,6 +128,9 @@ NetworkProcess::NetworkProcess(AuxiliaryProcessInitializationParameters&& parame
#if ENABLE(CONTENT_EXTENSIONS)
, m_networkContentRuleListManager(*this)
#endif
#if PLATFORM(IOS_FAMILY)
, m_webSQLiteDatabaseTracker(*this)
#endif
{
NetworkProcessPlatformStrategies::initialize();

@@ -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 @@ class NetworkProcess : public AuxiliaryProcess, private DownloadManager::Client,
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)
@@ -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::didFinishLastTransaction()

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
@@ -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 @@ class WebSQLiteDatabaseTracker : public WebCore::SQLiteDatabaseTrackerClient {
private:
void hysteresisUpdated(PAL::HysteresisState);

NetworkProcess& m_process;
AuxiliaryProcess& m_process;
AuxiliaryProcess::ProcessType m_processType;
PAL::HysteresisActivity m_hysteresis;
};

@@ -182,6 +182,9 @@ WebProcess::WebProcess()
, m_pluginProcessConnectionManager(PluginProcessConnectionManager::create())
#endif
, m_nonVisibleProcessCleanupTimer(*this, &WebProcess::nonVisibleProcessCleanupTimerFired)
#if PLATFORM(IOS_FAMILY)
, m_webSQLiteDatabaseTracker(*this)
#endif
{
// Initialize our platform strategies.
WebPlatformStrategies::initialize();
@@ -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 @@ class WebProcess : public AuxiliaryProcess {

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;

0 comments on commit 5c1f725

Please sign in to comment.