Title: [283345] branches/safari-611.4.2.0-branch/Source/WebCore
Revision
283345
Author
repst...@apple.com
Date
2021-09-30 16:12:10 -0700 (Thu, 30 Sep 2021)

Log Message

Cherry-pick r280861. rdar://problem/81757530

    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):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280861 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-611.4.2.0-branch/Source/WebCore/ChangeLog (283344 => 283345)


--- branches/safari-611.4.2.0-branch/Source/WebCore/ChangeLog	2021-09-30 23:06:22 UTC (rev 283344)
+++ branches/safari-611.4.2.0-branch/Source/WebCore/ChangeLog	2021-09-30 23:12:10 UTC (rev 283345)
@@ -1,3 +1,36 @@
+2021-09-30  Russell Epstein  <repst...@apple.com>
+
+        Cherry-pick r280861. rdar://problem/81757530
+
+    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):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280861 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-08-10  Ryosuke Niwa  <rn...@webkit.org>
+
+            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):
+
 2021-09-03  Alan Coon  <alanc...@apple.com>
 
         Cherry-pick r279832. rdar://problem/82733433

Modified: branches/safari-611.4.2.0-branch/Source/WebCore/page/DOMWindow.cpp (283344 => 283345)


--- branches/safari-611.4.2.0-branch/Source/WebCore/page/DOMWindow.cpp	2021-09-30 23:06:22 UTC (rev 283344)
+++ branches/safari-611.4.2.0-branch/Source/WebCore/page/DOMWindow.cpp	2021-09-30 23:12:10 UTC (rev 283345)
@@ -245,7 +245,7 @@
         if (!set.contains(window.ptr()))
             continue;
 
-        Frame* frame = window->frame();
+        RefPtr frame = window->frame();
         if (!frame)
             continue;
 
@@ -2103,7 +2103,7 @@
     if (RegistrableDomain::uncheckedCreateFromRegistrableDomainString("chase.com"_s).matches(document()->url())) {
         // Fire a fake DeviceMotionEvent with acceleration data to unblock the site's login flow.
         document()->postTask([](auto& context) {
-            if (auto* window = downcast<Document>(context).domWindow()) {
+            if (RefPtr window = downcast<Document>(context).domWindow()) {
                 auto acceleration = DeviceMotionData::Acceleration::create();
                 window->dispatchEvent(DeviceMotionEvent::create(eventNames().devicemotionEvent, DeviceMotionData::create(acceleration.copyRef(), acceleration.copyRef(), DeviceMotionData::RotationRate::create(), WTF::nullopt).ptr()));
             }
@@ -2260,13 +2260,13 @@
     event.setEventPhase(Event::AT_TARGET);
     event.resetBeforeDispatch();
 
-    Frame* protectedFrame = nullptr;
+    RefPtr<Frame> protectedFrame;
     bool hasListenersForEvent = false;
     if (UNLIKELY(InspectorInstrumentation::hasFrontends())) {
         protectedFrame = frame();
         hasListenersForEvent = hasEventListeners(event.type());
         if (hasListenersForEvent)
-            InspectorInstrumentation::willDispatchEventOnWindow(protectedFrame, event, *this);
+            InspectorInstrumentation::willDispatchEventOnWindow(protectedFrame.get(), event, *this);
     }
 
     // FIXME: We should use EventDispatcher everywhere.
@@ -2274,7 +2274,7 @@
     fireEventListeners(event, EventInvokePhase::Bubbling);
 
     if (hasListenersForEvent)
-        InspectorInstrumentation::didDispatchEventOnWindow(protectedFrame, event);
+        InspectorInstrumentation::didDispatchEventOnWindow(protectedFrame.get(), event);
 
     event.resetAfterDispatch();
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to