⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280861 in webkit


Ignore:
Timestamp:
Aug 10, 2021, 1:49:44 PM (5 years ago)
Author:
rniwa@webkit.org
Message:

Deploy some more smart pointers in DOMWindow.cpp
https://bugs.webkit.org/show_bug.cgi?id=228883

Reviewed by Darin Adler.

A follow up to r279661. Deploy even more smart pointers.

  • page/DOMWindow.cpp:

(WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents):
(WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
(WebCore::DOMWindow::dispatchEvent):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r280860 r280861  
     12021-08-10  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Deploy some more smart pointers in DOMWindow.cpp
     4        https://bugs.webkit.org/show_bug.cgi?id=228883
     5
     6        Reviewed by Darin Adler.
     7
     8        A follow up to r279661. Deploy even more smart pointers.
     9
     10        * page/DOMWindow.cpp:
     11        (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents):
     12        (WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
     13        (WebCore::DOMWindow::dispatchEvent):
     14
    1152021-08-10  Antti Koivisto  <antti@apple.com>
    216
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r280504 r280861  
    249249            continue;
    250250
    251         Frame* frame = window->frame();
     251        RefPtr frame = window->frame();
    252252        if (!frame)
    253253            continue;
     
    21552155        // Fire a fake DeviceMotionEvent with acceleration data to unblock the site's login flow.
    21562156        document()->postTask([](auto& context) {
    2157             if (auto* window = downcast<Document>(context).domWindow()) {
     2157            if (RefPtr window = downcast<Document>(context).domWindow()) {
    21582158                auto acceleration = DeviceMotionData::Acceleration::create();
    21592159                window->dispatchEvent(DeviceMotionEvent::create(eventNames().devicemotionEvent, DeviceMotionData::create(acceleration.copyRef(), acceleration.copyRef(), DeviceMotionData::RotationRate::create(), std::nullopt).ptr()));
     
    23122312    event.resetBeforeDispatch();
    23132313
    2314     Frame* protectedFrame = nullptr;
     2314    RefPtr<Frame> protectedFrame;
    23152315    bool hasListenersForEvent = false;
    23162316    if (UNLIKELY(InspectorInstrumentation::hasFrontends())) {
     
    23182318        hasListenersForEvent = hasEventListeners(event.type());
    23192319        if (hasListenersForEvent)
    2320             InspectorInstrumentation::willDispatchEventOnWindow(protectedFrame, event, *this);
     2320            InspectorInstrumentation::willDispatchEventOnWindow(protectedFrame.get(), event, *this);
    23212321    }
    23222322
     
    23262326
    23272327    if (hasListenersForEvent)
    2328         InspectorInstrumentation::didDispatchEventOnWindow(protectedFrame, event);
     2328        InspectorInstrumentation::didDispatchEventOnWindow(protectedFrame.get(), event);
    23292329
    23302330    event.resetAfterDispatch();
Note: See TracChangeset for help on using the changeset viewer.