WebKit Bugzilla
Attachment 370594 Details for
Bug 198215
: Make sure completion handler is always called in SWServer::startSuspension
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198215-20190524152620.patch (text/plain), 3.01 KB, created by
youenn fablet
on 2019-05-24 15:26:21 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2019-05-24 15:26:21 PDT
Size:
3.01 KB
patch
obsolete
>Subversion Revision: 245747 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 3dbb5c2a7db7da72c420032b23a5aa181e04cda5..cedb7a96917bf7370fa5db4a73ab5f5e740197d5 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,21 @@ >+2019-05-24 Youenn Fablet <youenn@apple.com> >+ >+ Make sure completion handler is always called in SWServer::startSuspension >+ https://bugs.webkit.org/show_bug.cgi?id=198215 >+ <rdar://problem/51114613> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ In case a connection gets closed, handle all of its async reply completion handlers. >+ This ensures they handlers are called in case the connection does not get destroyed until a much later stage. >+ >+ * Platform/IPC/Connection.cpp: >+ (IPC::Connection::~Connection): >+ (IPC::Connection::connectionDidClose): >+ (IPC::addAsyncReplyHandler): >+ (IPC::clearAsyncReplyHandlers): >+ (IPC::CompletionHandler<void): >+ > 2019-05-24 Youenn Fablet <youenn@apple.com> > > Update messages_unittest.py after r245715 >diff --git a/Source/WebKit/Platform/IPC/Connection.cpp b/Source/WebKit/Platform/IPC/Connection.cpp >index e2ee1485878d9918baab37359028b60e7be82f2c..361f8619d23c848075bc1074fd67f4ae08cb99b5 100644 >--- a/Source/WebKit/Platform/IPC/Connection.cpp >+++ b/Source/WebKit/Platform/IPC/Connection.cpp >@@ -242,7 +242,9 @@ static HashMap<uintptr_t, HashMap<uint64_t, CompletionHandler<void(Decoder*)>>>& > static NeverDestroyed<HashMap<uintptr_t, HashMap<uint64_t, CompletionHandler<void(Decoder*)>>>> map; > return map.get(); > } >- >+ >+static void clearAsyncReplyHandlers(const Connection&); >+ > Connection::Connection(Identifier identifier, bool isServer, Client& client) > : m_client(client) > , m_uniqueID(UniqueID::generate()) >@@ -277,12 +279,8 @@ Connection::~Connection() > ASSERT(!isValid()); > > allConnections().remove(m_uniqueID); >- >- auto map = asyncReplyHandlerMap().take(reinterpret_cast<uintptr_t>(this)); >- for (auto& handler : map.values()) { >- if (handler) >- handler(nullptr); >- } >+ >+ clearAsyncReplyHandlers(*this); > } > > Connection* Connection::connection(UniqueID uniqueID) >@@ -849,6 +847,8 @@ void Connection::connectionDidClose() > protectedThis->m_isValid = false; > > protectedThis->m_client.didClose(protectedThis.get()); >+ >+ clearAsyncReplyHandlers(protectedThis.get()); > }); > } > >@@ -1139,6 +1139,15 @@ void addAsyncReplyHandler(Connection& connection, uint64_t identifier, Completio > ASSERT_UNUSED(result, result.isNewEntry); > } > >+void clearAsyncReplyHandlers(const Connection& connection) >+{ >+ auto map = asyncReplyHandlerMap().take(reinterpret_cast<uintptr_t>(&connection)); >+ for (auto& handler : map.values()) { >+ if (handler) >+ handler(nullptr); >+ } >+} >+ > CompletionHandler<void(Decoder*)> takeAsyncReplyHandler(Connection& connection, uint64_t identifier) > { > auto iterator = asyncReplyHandlerMap().find(reinterpret_cast<uintptr_t>(&connection));
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 198215
:
370564
|
370568
|
370594