WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
psaavedra patch version 2
patch_v2.patch (text/plain), 4.60 KB, created by
Pablo Saavedra
on 2022-02-18 10:46:32 PST
(
hide
)
Description:
psaavedra patch version 2
Filename:
MIME Type:
Creator:
Pablo Saavedra
Created:
2022-02-18 10:46:32 PST
Size:
4.60 KB
patch
obsolete
>diff --git a/Source/WebCore/platform/graphics/PlatformDisplay.cpp b/Source/WebCore/platform/graphics/PlatformDisplay.cpp >index 6db9d50b..e05bb157 100644 >--- a/Source/WebCore/platform/graphics/PlatformDisplay.cpp >+++ b/Source/WebCore/platform/graphics/PlatformDisplay.cpp >@@ -266,6 +266,7 @@ void PlatformDisplay::terminateEGLDisplay() > ASSERT(m_eglDisplayInitialized); > if (m_eglDisplay == EGL_NO_DISPLAY) > return; >+ eglMakeCurrent(m_eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); > eglTerminate(m_eglDisplay); > m_eglDisplay = EGL_NO_DISPLAY; > } >diff --git a/Source/WebKit/Shared/AuxiliaryProcess.cpp b/Source/WebKit/Shared/AuxiliaryProcess.cpp >index 7a597661..66b2d745 100644 >--- a/Source/WebKit/Shared/AuxiliaryProcess.cpp >+++ b/Source/WebKit/Shared/AuxiliaryProcess.cpp >@@ -59,7 +59,15 @@ AuxiliaryProcess::~AuxiliaryProcess() > > void AuxiliaryProcess::didClose(IPC::Connection&) > { >+// _exit() does not call the atexit handlers that we are using in some places. >+// We rely on exit handlers to cleanup EGL resources, and this handler needs to >+// be called from the main thread. >+// For glib based ports we call the stopRunLoop() what will endup in a normal exit. >+#if PLATFORM(GTK) || PLATFORM(WPE) >+ stopRunLoop(); >+#else > _exit(EXIT_SUCCESS); >+#endif > } > > void AuxiliaryProcess::initialize(const AuxiliaryProcessInitializationParameters& parameters) >diff --git a/Source/WebKit/Shared/AuxiliaryProcess.h b/Source/WebKit/Shared/AuxiliaryProcess.h >index f5e9c1f0..0bba1db3 100644 >--- a/Source/WebKit/Shared/AuxiliaryProcess.h >+++ b/Source/WebKit/Shared/AuxiliaryProcess.h >@@ -108,6 +108,9 @@ protected: > virtual void initializeSandbox(const AuxiliaryProcessInitializationParameters&, SandboxInitializationParameters&); > virtual void initializeConnection(IPC::Connection*); > >+ // IPC::Connection::Client. >+ void didClose(IPC::Connection&) override; >+ > virtual bool shouldTerminate() = 0; > virtual void terminate(); > >@@ -143,7 +146,6 @@ private: > > // IPC::Connection::Client. > void didReceiveInvalidMessage(IPC::Connection&, IPC::MessageName) final; >- void didClose(IPC::Connection&) override; > > void shutDown(); > >diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp >index 7d12acba..42c29da4 100644 >--- a/Source/WebKit/WebProcess/WebProcess.cpp >+++ b/Source/WebKit/WebProcess/WebProcess.cpp >@@ -248,6 +248,7 @@ namespace WebKit { > using namespace JSC; > using namespace WebCore; > >+#if !PLATFORM(GTK) && !PLATFORM(WPE) > NO_RETURN static void callExit(IPC::Connection*) > { > #if OS(WINDOWS) >@@ -257,6 +258,7 @@ NO_RETURN static void callExit(IPC::Connection*) > _exit(EXIT_SUCCESS); > #endif > } >+#endif > > WebProcess& WebProcess::singleton() > { >@@ -352,9 +354,12 @@ void WebProcess::initializeConnection(IPC::Connection* connection) > { > AuxiliaryProcess::initializeConnection(connection); > >+// For GTK and WPE ports, do not fast-track an _exit() from a worker thread on IPC disconnection >+#if !PLATFORM(GTK) && !PLATFORM(WPE) > // We call _exit() directly from the background queue in case the main thread is unresponsive > // and AuxiliaryProcess::didClose() does not get called. > connection->setDidCloseOnConnectionWorkQueueCallback(callExit); >+#endif > > #if !PLATFORM(GTK) && !PLATFORM(WPE) > connection->setShouldExitOnSyncMessageSendFailure(true); >@@ -854,6 +859,18 @@ void WebProcess::terminate() > AuxiliaryProcess::terminate(); > } > >+void WebProcess::didClose(IPC::Connection& connection) >+{ >+ // Closing WebPages before exit. This ends-up in the invalidation of the >+ // ThreadedCompositor objects associated to those WebPages. This action >+ // will release the EGL resources preventing the WebProcess hang in the >+ // eglTerminate() during a exit() call. >+ for (auto& webPage : m_pageMap.values()) >+ webPage->close(); >+ >+ AuxiliaryProcess::didClose(connection); >+} >+ > bool WebProcess::didReceiveSyncMessage(IPC::Connection& connection, IPC::Decoder& decoder, UniqueRef<IPC::Encoder>& replyEncoder) > { > if (messageReceiverMap().dispatchSyncMessage(connection, decoder, replyEncoder)) >diff --git a/Source/WebKit/WebProcess/WebProcess.h b/Source/WebKit/WebProcess/WebProcess.h >index 45a0173b..238a7368 100644 >--- a/Source/WebKit/WebProcess/WebProcess.h >+++ b/Source/WebKit/WebProcess/WebProcess.h >@@ -547,6 +547,7 @@ private: > > // IPC::Connection::Client > friend class WebConnectionToUIProcess; >+ void didClose(IPC::Connection&) override; > void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; > bool didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, UniqueRef<IPC::Encoder>&) override; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 217655
:
449800
|
449805
|
449816
|
449837
|
452022
|
452542
|
452743
|
452835
|
452836
|
452837
|
452853
|
452859