[webkit-changes] [WebKit/WebKit] a51462: Use smart pointers more in UIScriptController rela...

Alex Christensen noreply at github.com
Tue Jan 28 17:48:28 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a51462a095c75b6841c9c54f3cf646ae6c633df0
      https://github.com/WebKit/WebKit/commit/a51462a095c75b6841c9c54f3cf646ae6c633df0
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2025-01-28 (Tue, 28 Jan 2025)

  Changed paths:
    M Tools/DumpRenderTree/TestRunner.cpp
    M Tools/DumpRenderTree/TestRunner.h
    M Tools/TestRunnerShared/UIScriptContext/UIScriptContext.cpp
    M Tools/TestRunnerShared/UIScriptContext/UIScriptContext.h
    M Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
    M Tools/TestRunnerShared/UIScriptContext/UIScriptControllerShared.cpp
    M Tools/WebKitTestRunner/TestInvocation.cpp
    M Tools/WebKitTestRunner/TestInvocation.h
    M Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm

  Log Message:
  -----------
  Use smart pointers more in UIScriptController related code
https://bugs.webkit.org/show_bug.cgi?id=286646
rdar://143784212

Reviewed by Tim Horton.

This started as a fix for a crash in WebKitTestRunner when the callback of
EventStreamPlayer.playStream:window:completionHandler: is called after the
UIScriptContext is destroyed, and the unsafely implicitly captured raw pointer
to the UIScriptContext is dereferenced.  I expanded a bit to remove or replace
unsafe pointer use with smart pointers.

* Tools/DumpRenderTree/TestRunner.cpp:
(TestRunner::runUIScript):
* Tools/DumpRenderTree/TestRunner.h:
* Tools/TestRunnerShared/UIScriptContext/UIScriptContext.cpp:
(UIScriptContext::~UIScriptContext):
* Tools/TestRunnerShared/UIScriptContext/UIScriptContext.h:
(WTR::UIScriptContext::create):
* Tools/TestRunnerShared/UIScriptContext/UIScriptController.h:
(WTR::UIScriptController::context): Deleted.
* Tools/TestRunnerShared/UIScriptContext/UIScriptControllerShared.cpp:
(WTR::UIScriptController::UIScriptController):
(WTR::UIScriptController::context):
(WTR::UIScriptController::contextDestroyed): Deleted.
* Tools/WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::runUISideScriptImmediately):
(WTR::TestInvocation::runUISideScript):
(WTR::TestInvocation::~TestInvocation): Deleted.
* Tools/WebKitTestRunner/TestInvocation.h:
* Tools/WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::playBackEvents):
(WTR::UIScriptControllerMac::beginBackSwipe):
(WTR::UIScriptControllerMac::completeBackSwipe):
(WTR::UIScriptControllerMac::playBackEventStream):

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list