[webkit-changes] [WebKit/WebKit] 18c088: RTCDataChannelRemoteManager registers for work que...

Kimmo Kinnunen noreply at github.com
Thu Sep 22 03:03:02 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 18c0882056e44303ec3d1af63254bc67b02f5eeb
      https://github.com/WebKit/WebKit/commit/18c0882056e44303ec3d1af63254bc67b02f5eeb
  Author: Kimmo Kinnunen <kkinnunen at apple.com>
  Date:   2022-09-22 (Thu, 22 Sep 2022)

  Changed paths:
    M Source/WebKit/WebProcess/Network/webrtc/RTCDataChannelRemoteManager.cpp
    M Source/WebKit/WebProcess/Network/webrtc/RTCDataChannelRemoteManager.h

  Log Message:
  -----------
  RTCDataChannelRemoteManager registers for work queue messages in wrong way
https://bugs.webkit.org/show_bug.cgi?id=245064
rdar://problem/99812041

Reviewed by Antti Koivisto.

RTCDataChannelRemoteManager:
 - is RefCounted but the initial ref is never adopted as expected
 - registers a work queue message handler before the vptr is correctly setup
   risking incorrect virtual function calls to the instance from another
   thread

Change the base class to IPC::MessageReceiver. This is not refcounted,
and is suitable for RTCDataChannelRemoteManager which is a singleton.

Register the message handler in a separate function after construction.

Register using addMessageReceiver(). This is work to simplify the IPC
thread related code, being able to remove Connection::addWorkQueueMessageReceiver().

* Source/WebKit/WebProcess/Network/webrtc/RTCDataChannelRemoteManager.cpp:
(WebKit::RTCDataChannelRemoteManager::sharedManager):
(WebKit::RTCDataChannelRemoteManager::RTCDataChannelRemoteManager):
(WebKit::RTCDataChannelRemoteManager::startListeningForIPC):
(WebKit::RTCDataChannelRemoteManager::setConnection): Deleted.
* Source/WebKit/WebProcess/Network/webrtc/RTCDataChannelRemoteManager.h:

Canonical link: https://commits.webkit.org/254752@main




More information about the webkit-changes mailing list