Changeset 223457 in webkit


Ignore:
Timestamp:
Oct 16, 2017 10:12:52 PM (7 years ago)
Author:
Chris Dumez
Message:

ServiceWorkerRegistration should subclass RefCounted<>
https://bugs.webkit.org/show_bug.cgi?id=178374

Reviewed by Ryosuke Niwa.

ServiceWorkerRegistration should subclass RefCounted<> or we end up with an infinite recursion
when constructing such object. This is because ServiceWorkerRegistration subclasses
EventTargetWithInlineData which implements ref() / deref() by calling refEventTarget() /
derefEventTarget(). refEventTarget() / derefEventTarget() are implemented in
ServiceWorkerRegistration so that they call ref() / deref() (which ends up being EventTarget's
methods).

  • workers/service/ServiceWorkerRegistration.h:
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r223452 r223457  
     12017-10-16  Chris Dumez  <cdumez@apple.com>
     2
     3        ServiceWorkerRegistration should subclass RefCounted<>
     4        https://bugs.webkit.org/show_bug.cgi?id=178374
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        ServiceWorkerRegistration should subclass RefCounted<> or we end up with an infinite recursion
     9        when constructing such object. This is because ServiceWorkerRegistration subclasses
     10        EventTargetWithInlineData which implements ref() / deref() by calling refEventTarget() /
     11        derefEventTarget(). refEventTarget() / derefEventTarget() are implemented in
     12        ServiceWorkerRegistration so that they call ref() / deref() (which ends up being EventTarget's
     13        methods).
     14
     15        * workers/service/ServiceWorkerRegistration.h:
     16
    1172017-10-16  Jer Noble  <jer.noble@apple.com>
    218
  • trunk/Source/WebCore/workers/service/ServiceWorkerRegistration.h

    r221392 r223457  
    3838class ServiceWorker;
    3939
    40 class ServiceWorkerRegistration final : public EventTargetWithInlineData, public ActiveDOMObject {
     40class ServiceWorkerRegistration final : public RefCounted<ServiceWorkerRegistration>, public EventTargetWithInlineData, public ActiveDOMObject {
    4141public:
    4242    enum class UpdateViaCache {
     
    6363    void unregister(Ref<DeferredPromise>&&);
    6464
     65    using RefCounted::ref;
     66    using RefCounted::deref;
     67
    6568private:
    6669    ServiceWorkerRegistration(ScriptExecutionContext&, const ServiceWorkerRegistrationData&);
Note: See TracChangeset for help on using the changeset viewer.