Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4deeedaacec92708589899707d067bc335bc048b
      
https://github.com/WebKit/WebKit/commit/4deeedaacec92708589899707d067bc335bc048b
  Author: Alex Christensen <[email protected]>
  Date:   2024-04-26 (Fri, 26 Apr 2024)

  Changed paths:
    M Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
    M Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
    M Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
    M Tools/WebKitTestRunner/InjectedBundle/TestRunner.h

  Log Message:
  -----------
  Stop using mainFrameJSContext and firstRootFrameJSContext in WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=273298
rdar://127093020

Reviewed by Charlie Wolfe.

We need a JSContextRef to do things with JavaScript.  It's easy to use a 
globally accessible
function to get one that's always there, but with site isolation the main frame 
JS context
is no longer always there.  Instead, get the JSContextRef from the originating 
JS function
call.  For callbacks, store a JSRetainPtr<JSGlobalContextRef> and use it again 
when the
callback happens.

* Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::postMessageWithAsyncReply):
(WTR::firstRootFrame): Deleted.
(WTR::firstRootFrameJSContext): Deleted.
* Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::findOptionsFromArray):
(WTR::TestRunner::findString):
(WTR::TestRunner::findStringMatchesInPage):
(WTR::cacheTestRunnerCallback):
(WTR::callTestRunnerCallback):
(WTR::TestRunner::clearTestRunnerCallbacks):
(WTR::TestRunner::addChromeInputField):
(WTR::TestRunner::removeChromeInputField):
(WTR::TestRunner::setTextInChromeInputField):
(WTR::TestRunner::selectChromeInputField):
(WTR::TestRunner::getSelectedTextInChromeInputField):
(WTR::TestRunner::focusWebView):
(WTR::TestRunner::setBackingScaleFactor):
(WTR::TestRunner::removeAllCookies):
(WTR::TestRunner::setEnterFullscreenForElementCallback):
(WTR::TestRunner::setExitFullscreenForElementCallback):
(WTR::TestRunner::simulateWebNotificationClick):
(WTR::TestRunner::runUIScript):
(WTR::TestRunner::runUIScriptImmediately):
(WTR::TestRunner::runUIScriptCallback):
(WTR::TestRunner::setAllowedMenuActions):
(WTR::TestRunner::installDidBeginSwipeCallback):
(WTR::TestRunner::installWillEndSwipeCallback):
(WTR::TestRunner::installDidEndSwipeCallback):
(WTR::TestRunner::installDidRemoveSwipeSnapshotCallback):
(WTR::TestRunner::setStatisticsDebugMode):
(WTR::TestRunner::setStatisticsPrevalentResourceForDebugMode):
(WTR::TestRunner::setStatisticsLastSeen):
(WTR::TestRunner::setStatisticsMergeStatistic):
(WTR::TestRunner::setStatisticsExpiredStatistic):
(WTR::TestRunner::setStatisticsPrevalentResource):
(WTR::TestRunner::setStatisticsVeryPrevalentResource):
(WTR::TestRunner::setStatisticsHasHadUserInteraction):
(WTR::TestRunner::installStatisticsDidModifyDataRecordsCallback):
(WTR::TestRunner::installStatisticsDidScanDataRecordsCallback):
(WTR::TestRunner::statisticsUpdateCookieBlocking):
(WTR::TestRunner::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WTR::TestRunner::statisticsClearInMemoryAndPersistentStore):
(WTR::TestRunner::statisticsClearThroughWebsiteDataRemoval):
(WTR::TestRunner::setStatisticsShouldDowngradeReferrer):
(WTR::TestRunner::setStatisticsShouldBlockThirdPartyCookies):
(WTR::TestRunner::setStatisticsFirstPartyWebsiteDataRemovalMode):
(WTR::TestRunner::statisticsSetToSameSiteStrictCookies):
(WTR::TestRunner::statisticsSetFirstPartyHostCNAMEDomain):
(WTR::TestRunner::statisticsSetThirdPartyCNAMEDomain):
(WTR::TestRunner::statisticsResetToConsistentState):
(WTR::TestRunner::installTextDidChangeInTextFieldCallback):
(WTR::TestRunner::installTextFieldDidBeginEditingCallback):
(WTR::TestRunner::installTextFieldDidEndEditingCallback):
(WTR::TestRunner::getAllStorageAccessEntries):
(WTR::TestRunner::loadedSubresourceDomains):
(WTR::captureDeviceProperties):
(WTR::TestRunner::addMockCameraDevice):
(WTR::TestRunner::addMockMicrophoneDevice):
(WTR::TestRunner::removeAllSessionCredentials):
(WTR::TestRunner::getApplicationManifestThen):
(WTR::TestRunner::setAppBoundDomains):
(WTR::TestRunner::setManagedDomains):
(WTR::TestRunner::takeViewPortSnapshot):
(WTR::TestRunner::flushConsoleLogs):
(WTR::TestRunner::getAndClearReportedWindowProxyAccessDomains):
(WTR::mainFrame): Deleted.
(WTR::mainFrameJSContext): Deleted.
* Tools/WebKitTestRunner/InjectedBundle/TestRunner.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to