Stop storing raw pointers inside WebIDBServer::m_connections and use a WeakHashSet instead.
Created attachment 430495 [details] Patch
Comment on attachment 430495 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=430495&action=review > Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.h:106 > + WeakHashSet<IPC::Connection> m_connections; // Only used on the main thread. It's unfortunate that we can't assert this.
(In reply to Ryosuke Niwa from comment #2) > Comment on attachment 430495 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=430495&action=review > > > Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.h:106 > > + WeakHashSet<IPC::Connection> m_connections; // Only used on the main thread. > > It's unfortunate that we can't assert this. Well, we do have assertions in the places where it is used. But I agree I wish there was a way to enforce that a particular data member can only be used on the main thread. I guess we could come up with a MainThreadOnly<T> type that has the assertions embedded :P
(In reply to Chris Dumez from comment #3) > (In reply to Ryosuke Niwa from comment #2) > > Comment on attachment 430495 [details] > > Patch > > > > View in context: > > https://bugs.webkit.org/attachment.cgi?id=430495&action=review > > > > > Source/WebKit/NetworkProcess/IndexedDB/WebIDBServer.h:106 > > > + WeakHashSet<IPC::Connection> m_connections; // Only used on the main thread. > > > > It's unfortunate that we can't assert this. > > Well, we do have assertions in the places where it is used. But I agree I > wish there was a way to enforce that a particular data member can only be > used on the main thread. I guess we could come up with a MainThreadOnly<T> > type that has the assertions embedded :P Yeah, that might make sense.
Committed r278422 (238446@main): <https://commits.webkit.org/238446@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 430495 [details].
<rdar://problem/78837612>