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

Changeset 284786 in webkit


Ignore:
Timestamp:
Oct 25, 2021, 8:37:16 AM (5 years ago)
Author:
Wenson Hsieh
Message:

REGRESSION (r284079): Audio continues playing on hulu.com in private browsing mode after closing the tab
https://bugs.webkit.org/show_bug.cgi?id=232113
rdar://84399283

Reviewed by Chris Dumez.

Source/WebKit:

I inadvertently introduced a ref-counting cycle between RemoteRenderingBackend and RemoteDisplayListRecorder
after IPC stream refactoring in r284079, since RemoteDisplayListRecorder directly strongly refs the rendering
backend, and the rendering backend indirectly holds on to RemoteDisplayListRecorders through remote image
buffers in the resource cache. Since RemoteRenderingBackend also strongly refs GPUConnectionToWebProcess as
well, this caused the entire GPUConnectionToWebProcess to leak after tearing down the connected web process, if
the web process ever installed a remote rendering backend for 2D canvas.

To avoid this cycle, turn RemoteDisplayListRecorder's m_renderingBackend into a RefPtr instead of a Ref, and
clear it out in stopListeningForIPC(). This also means that we no longer need a separate boolean flag to
ensure that RemoteDisplayListRecorder::stopListeningForIPC() is idempotent, so we also remove
m_isListeningForIPC altogether.

Test: GPUProcess.DoNotLeakConnectionAfterClosingWebPage

  • GPUProcess/GPUConnectionToWebProcess.cpp:

(WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess):
(WebKit::GPUConnectionToWebProcess::~GPUConnectionToWebProcess):

  • GPUProcess/GPUConnectionToWebProcess.h:

(WebKit::GPUConnectionToWebProcess::objectCountForTesting):

  • GPUProcess/GPUProcess.cpp:

(WebKit::GPUProcess::webProcessConnectionCountForTesting):

Add support for a testing-only SPI hook to ask for the live GPUConnectionToWebProcess count. This retrieves a
statically incremented/decremented count of the GPUConnectionToWebProcess instances that exist in the GPU
process; importantly, this is different from asking the GPUProcess for the number of connections in
m_webProcessConnections, since the latter will be 0 even when one or more GPUConnectionToWebProcesses are
still alive.

  • GPUProcess/GPUProcess.h:
  • GPUProcess/GPUProcess.messages.in:
  • GPUProcess/graphics/RemoteDisplayListRecorder.cpp:

(WebKit::RemoteDisplayListRecorder::RemoteDisplayListRecorder):

Also fix a leak caused by RemoteDisplayListRecorder and RemoteImageBuffer strongly reffing each other. Since
RemoteImageBuffer owns RemoteDisplayListRecorder, the backpointer from RemoteDisplayListRecorder to the image
buffer should be weak, not strong.

(WebKit::RemoteDisplayListRecorder::startListeningForIPC):
(WebKit::RemoteDisplayListRecorder::stopListeningForIPC):
(WebKit::RemoteDisplayListRecorder::paintFrameForMedia):

  • GPUProcess/graphics/RemoteDisplayListRecorder.h:

(): Deleted.

  • GPUProcess/graphics/RemoteRenderingBackend.cpp:

(WebKit::RemoteRenderingBackend::stopListeningForIPC):

Adjust this logic to ensure that we finish pending work and destroy cached resources *right before* we stop
listening for all stream IPC messages. Since RemoteDisplayListRecorder now clears out its pointer to the
rendering backend in stopListeningForIPC(), we'll need to ensure that any pending IPC stream messages that
might cause RemoteDisplayListRecorder to call into the back end are processed before we sever the IPC stream
connection for good by removing all receivers.

  • UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:

Add the new testing SPI (see above for more details).

  • UIProcess/API/Cocoa/WKWebViewTesting.mm:

(-[WKWebView _gpuToWebProcessConnectionCountForTesting:]):

  • UIProcess/GPU/GPUProcessProxy.cpp:

(WebKit::GPUProcessProxy::webProcessConnectionCountForTesting):

  • UIProcess/GPU/GPUProcessProxy.h:

Tools:

Add a new API test to verify that the GPU to web prcoess connection isn't leaked in the GPU process. See WebKit
ChangeLog for more details.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm:
  • TestWebKitAPI/Tests/WebKitCocoa/canvas-image-data.html: Added.
  • TestWebKitAPI/cocoa/TestWKWebView.h:
  • TestWebKitAPI/cocoa/TestWKWebView.mm:

(-[WKWebView gpuToWebProcessConnectionCount]):

Location:
trunk
Files:
1 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r284775 r284786  
     12021-10-25  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        REGRESSION (r284079): Audio continues playing on hulu.com in private browsing mode after closing the tab
     4        https://bugs.webkit.org/show_bug.cgi?id=232113
     5        rdar://84399283
     6
     7        Reviewed by Chris Dumez.
     8
     9        I inadvertently introduced a ref-counting cycle between RemoteRenderingBackend and RemoteDisplayListRecorder
     10        after IPC stream refactoring in r284079, since RemoteDisplayListRecorder directly strongly refs the rendering
     11        backend, and the rendering backend indirectly holds on to RemoteDisplayListRecorders through remote image
     12        buffers in the resource cache. Since RemoteRenderingBackend also strongly refs  GPUConnectionToWebProcess as
     13        well, this caused the entire GPUConnectionToWebProcess to leak after tearing down the connected web process, if
     14        the web process ever installed a remote rendering backend for 2D canvas.
     15
     16        To avoid this cycle, turn RemoteDisplayListRecorder's `m_renderingBackend` into a RefPtr instead of a Ref, and
     17        clear it out in `stopListeningForIPC()`. This also means that we no longer need a separate boolean flag to
     18        ensure that `RemoteDisplayListRecorder::stopListeningForIPC()` is idempotent, so we also remove
     19        `m_isListeningForIPC` altogether.
     20
     21        Test: GPUProcess.DoNotLeakConnectionAfterClosingWebPage
     22
     23        * GPUProcess/GPUConnectionToWebProcess.cpp:
     24        (WebKit::GPUConnectionToWebProcess::GPUConnectionToWebProcess):
     25        (WebKit::GPUConnectionToWebProcess::~GPUConnectionToWebProcess):
     26        * GPUProcess/GPUConnectionToWebProcess.h:
     27        (WebKit::GPUConnectionToWebProcess::objectCountForTesting):
     28        * GPUProcess/GPUProcess.cpp:
     29        (WebKit::GPUProcess::webProcessConnectionCountForTesting):
     30
     31        Add support for a testing-only SPI hook to ask for the live GPUConnectionToWebProcess count. This retrieves a
     32        statically incremented/decremented count of the GPUConnectionToWebProcess instances that exist in the GPU
     33        process; importantly, this is different from asking the GPUProcess for the number of connections in
     34        `m_webProcessConnections`, since the latter will be 0 even when one or more GPUConnectionToWebProcesses are
     35        still alive.
     36
     37        * GPUProcess/GPUProcess.h:
     38        * GPUProcess/GPUProcess.messages.in:
     39        * GPUProcess/graphics/RemoteDisplayListRecorder.cpp:
     40        (WebKit::RemoteDisplayListRecorder::RemoteDisplayListRecorder):
     41
     42        Also fix a leak caused by RemoteDisplayListRecorder and RemoteImageBuffer strongly reffing each other. Since
     43        RemoteImageBuffer owns RemoteDisplayListRecorder, the backpointer from RemoteDisplayListRecorder to the image
     44        buffer should be weak, not strong.
     45
     46        (WebKit::RemoteDisplayListRecorder::startListeningForIPC):
     47        (WebKit::RemoteDisplayListRecorder::stopListeningForIPC):
     48        (WebKit::RemoteDisplayListRecorder::paintFrameForMedia):
     49        * GPUProcess/graphics/RemoteDisplayListRecorder.h:
     50        (): Deleted.
     51        * GPUProcess/graphics/RemoteRenderingBackend.cpp:
     52        (WebKit::RemoteRenderingBackend::stopListeningForIPC):
     53
     54        Adjust this logic to ensure that we finish pending work and destroy cached resources *right before* we stop
     55        listening for all stream IPC messages. Since RemoteDisplayListRecorder now clears out its pointer to the
     56        rendering backend in `stopListeningForIPC()`, we'll need to ensure that any pending IPC stream messages that
     57        might cause RemoteDisplayListRecorder to call into the back end are processed before we sever the IPC stream
     58        connection for good by removing all receivers.
     59
     60        * UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h:
     61
     62        Add the new testing SPI (see above for more details).
     63
     64        * UIProcess/API/Cocoa/WKWebViewTesting.mm:
     65        (-[WKWebView _gpuToWebProcessConnectionCountForTesting:]):
     66        * UIProcess/GPU/GPUProcessProxy.cpp:
     67        (WebKit::GPUProcessProxy::webProcessConnectionCountForTesting):
     68        * UIProcess/GPU/GPUProcessProxy.h:
     69
    1702021-10-25  Sam Sneddon  <gsnedders@apple.com>
    271
  • trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp

    r284220 r284786  
    249249    m_connection->setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(true);
    250250    m_connection->open();
     251
     252    ++gObjectCountForTesting;
    251253}
    252254
     
    263265    m_libWebRTCCodecsProxy->close();
    264266#endif
    265 }
     267
     268    --gObjectCountForTesting;
     269}
     270
     271uint64_t GPUConnectionToWebProcess::gObjectCountForTesting = 0;
    266272
    267273void GPUConnectionToWebProcess::didClose(IPC::Connection& connection)
  • trunk/Source/WebKit/GPUProcess/GPUConnectionToWebProcess.h

    r284220 r284786  
    171171#endif
    172172
     173    static uint64_t objectCountForTesting() { return gObjectCountForTesting; }
     174
    173175    using RemoteRenderingBackendMap = HashMap<RenderingBackendIdentifier, IPC::ScopedActiveMessageReceiveQueue<RemoteRenderingBackend>>;
    174176    const RemoteRenderingBackendMap& remoteRenderingBackendMap() const { return m_remoteRenderingBackendMap; }
     
    243245#endif
    244246
     247    static uint64_t gObjectCountForTesting;
     248
    245249    RefPtr<Logger> m_logger;
    246250
  • trunk/Source/WebKit/GPUProcess/GPUProcess.cpp

    r284135 r284786  
    499499#endif
    500500
     501void GPUProcess::webProcessConnectionCountForTesting(CompletionHandler<void(uint64_t)>&& completionHandler)
     502{
     503    completionHandler(GPUConnectionToWebProcess::objectCountForTesting());
     504}
     505
    501506} // namespace WebKit
    502507
  • trunk/Source/WebKit/GPUProcess/GPUProcess.h

    r283116 r284786  
    101101    const String& applicationVisibleName() const { return m_applicationVisibleName; }
    102102
     103    void webProcessConnectionCountForTesting(CompletionHandler<void(uint64_t)>&&);
     104
    103105private:
    104106    void lowMemoryHandler(Critical, Synchronous);
  • trunk/Source/WebKit/GPUProcess/GPUProcess.messages.in

    r283116 r284786  
    6969    NotifyPreferencesChanged(String domain, String key, std::optional<String> encodedValue)
    7070#endif
     71
     72    WebProcessConnectionCountForTesting() -> (uint64_t count) Async
    7173}
    7274
  • trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.cpp

    r284695 r284786  
    3838    , m_imageBufferIdentifier(imageBufferIdentifier)
    3939    , m_webProcessIdentifier(webProcessIdentifier)
    40     , m_renderingBackend(renderingBackend)
     40    , m_renderingBackend(&renderingBackend)
    4141{
    4242}
     
    5454void RemoteDisplayListRecorder::startListeningForIPC()
    5555{
    56     ASSERT(!m_isListeningForIPC);
    57     m_isListeningForIPC = true;
    5856    m_renderingBackend->streamConnection().startReceivingMessages(*this, Messages::RemoteDisplayListRecorder::messageReceiverName(), m_imageBufferIdentifier.object().toUInt64());
    5957}
     
    6159void RemoteDisplayListRecorder::stopListeningForIPC()
    6260{
    63     if (!m_isListeningForIPC)
    64         return;
    65 
    66     m_renderingBackend->streamConnection().stopReceivingMessages(Messages::RemoteDisplayListRecorder::messageReceiverName(), m_imageBufferIdentifier.object().toUInt64());
    67     m_isListeningForIPC = false;
     61    if (auto renderingBackend = std::exchange(m_renderingBackend, { }))
     62        renderingBackend->streamConnection().stopReceivingMessages(Messages::RemoteDisplayListRecorder::messageReceiverName(), m_imageBufferIdentifier.object().toUInt64());
    6863}
    6964
     
    427422void RemoteDisplayListRecorder::paintFrameForMedia(MediaPlayerIdentifier identifier, const FloatRect& destination)
    428423{
    429     m_renderingBackend->performWithMediaPlayerOnMainThread(identifier, [imageBuffer = m_imageBuffer.copyRef(), destination](MediaPlayer& player) {
     424    m_renderingBackend->performWithMediaPlayerOnMainThread(identifier, [imageBuffer = RefPtr { m_imageBuffer.get() }, destination](MediaPlayer& player) {
    430425        // It is currently not safe to call paintFrameForMedia() off the main thread.
    431426        imageBuffer->context().paintFrameForMedia(player, destination);
  • trunk/Source/WebKit/GPUProcess/graphics/RemoteDisplayListRecorder.h

    r283991 r284786  
    150150    void didReceiveStreamMessage(IPC::StreamServerConnectionBase&, IPC::Decoder&) final;
    151151
    152     Ref<WebCore::ImageBuffer> m_imageBuffer;
     152    WeakPtr<WebCore::ImageBuffer> m_imageBuffer;
    153153    QualifiedRenderingResourceIdentifier m_imageBufferIdentifier;
    154154    WebCore::ProcessIdentifier m_webProcessIdentifier;
    155     Ref<RemoteRenderingBackend> m_renderingBackend;
     155    RefPtr<RemoteRenderingBackend> m_renderingBackend;
    156156    RefPtr<WebCore::ImageBuffer> m_maskImageBuffer;
    157     bool m_isListeningForIPC { false };
    158157};
    159158
  • trunk/Source/WebKit/GPUProcess/graphics/RemoteRenderingBackend.cpp

    r284768 r284786  
    109109{
    110110    ASSERT(RunLoop::isMain());
     111    // Make sure we destroy the ResourceCache on the WorkQueue since it gets populated on the WorkQueue.
     112    // Make sure rendering resource request is released after destroying the cache.
     113    m_workQueue->dispatch([renderingResourcesRequest = WTFMove(m_renderingResourcesRequest), remoteResourceCache = WTFMove(m_remoteResourceCache)] { });
     114    m_workQueue->stopAndWaitForCompletion();
     115
    111116    m_streamConnection->stopReceivingMessages(Messages::RemoteRenderingBackend::messageReceiverName(), m_renderingBackendIdentifier.toUInt64());
    112117    m_streamConnection->stopReceivingMessages(Messages::RemoteDisplayListRecorder::messageReceiverName());
     
    118123            remoteContext.value->stopListeningForIPC();
    119124    }
    120 
    121     // Make sure we destroy the ResourceCache on the WorkQueue since it gets populated on the WorkQueue.
    122     // Make sure rendering resource request is released after destroying the cache.
    123     m_workQueue->dispatch([renderingResourcesRequest = WTFMove(m_renderingResourcesRequest), remoteResourceCache = WTFMove(m_remoteResourceCache)] { });
    124     m_workQueue->stopAndWaitForCompletion();
    125125}
    126126
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h

    r284544 r284786  
    115115
    116116- (void)_createMediaSessionCoordinatorForTesting:(id <_WKMediaSessionCoordinator>)privateCoordinator completionHandler:(void(^)(BOOL))completionHandler;
     117- (void)_gpuToWebProcessConnectionCountForTesting:(void(^)(NSUInteger))completionHandler WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
    117118
    118119@end
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm

    r284544 r284786  
    2828
    2929#import "AudioSessionRoutingArbitratorProxy.h"
     30#import "GPUProcessProxy.h"
    3031#import "MediaSessionCoordinatorProxyPrivate.h"
    3132#import "PlaybackSessionManagerProxy.h"
     
    424425}
    425426
     427- (void)_gpuToWebProcessConnectionCountForTesting:(void(^)(NSUInteger))completionHandler
     428{
     429    RefPtr gpuProcess = _page->process().processPool().gpuProcess();
     430    if (!gpuProcess) {
     431        completionHandler(0);
     432        return;
     433    }
     434
     435    gpuProcess->webProcessConnectionCountForTesting([completionHandler = makeBlockPtr(completionHandler)](uint64_t count) {
     436        completionHandler(count);
     437    });
     438}
     439
    426440- (void)_createMediaSessionCoordinatorForTesting:(id <_WKMediaSessionCoordinator>)privateCoordinator completionHandler:(void(^)(BOOL))completionHandler
    427441{
  • trunk/Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp

    r284641 r284786  
    400400}
    401401
     402void GPUProcessProxy::webProcessConnectionCountForTesting(CompletionHandler<void(uint64_t)>&& completionHandler)
     403{
     404    sendWithAsyncReply(Messages::GPUProcess::WebProcessConnectionCountForTesting(), WTFMove(completionHandler));
     405}
     406
    402407void GPUProcessProxy::didClose(IPC::Connection&)
    403408{
  • trunk/Source/WebKit/UIProcess/GPU/GPUProcessProxy.h

    r284641 r284786  
    9595
    9696    void terminateForTesting();
     97    void webProcessConnectionCountForTesting(CompletionHandler<void(uint64_t)>&&);
    9798
    9899private:
  • trunk/Tools/ChangeLog

    r284785 r284786  
     12021-10-25  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        REGRESSION (r284079): Audio continues playing on hulu.com in private browsing mode after closing the tab
     4        https://bugs.webkit.org/show_bug.cgi?id=232113
     5        rdar://84399283
     6
     7        Reviewed by Chris Dumez.
     8
     9        Add a new API test to verify that the GPU to web prcoess connection isn't leaked in the GPU process. See WebKit
     10        ChangeLog for more details.
     11
     12        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     13        * TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm:
     14        * TestWebKitAPI/Tests/WebKitCocoa/canvas-image-data.html: Added.
     15        * TestWebKitAPI/cocoa/TestWKWebView.h:
     16        * TestWebKitAPI/cocoa/TestWKWebView.mm:
     17        (-[WKWebView gpuToWebProcessConnectionCount]):
     18
    1192021-10-25  Simon Fraser  <simon.fraser@apple.com>
    220
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r284748 r284786  
    12961296                F4E0A2B82122847400AF7C7F /* TestFilePromiseReceiver.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4E0A2B72122847400AF7C7F /* TestFilePromiseReceiver.mm */; };
    12971297                F4E3D80820F70BB9007B58C5 /* significant-text-milestone-article.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4E3D80720F708E4007B58C5 /* significant-text-milestone-article.html */; };
     1298                F4E7A66327222CA900E74D36 /* canvas-image-data.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4E7A66227222BB100E74D36 /* canvas-image-data.html */; };
    12981299                F4EB4E912328AC3000574DAB /* NSItemProviderAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = F4EB4E902328AC3000574DAB /* NSItemProviderAdditions.mm */; };
    12991300                F4EC8094260D30540010311D /* simple-image-overlay.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = F4EC8093260D2E620010311D /* simple-image-overlay.html */; };
     
    14451446                                7C486BA11AA12567003F6F9B /* bundle-file.html in Copy Resources */,
    14461447                                26DF5A6315A2A27E003689C2 /* CancelLoadFromResourceLoadDelegate.html in Copy Resources */,
     1448                                F4E7A66327222CA900E74D36 /* canvas-image-data.html in Copy Resources */,
    14471449                                2EFF06C51D8867760004BB30 /* change-video-source-on-click.html in Copy Resources */,
    14481450                                2EFF06C71D886A580004BB30 /* change-video-source-on-end.html in Copy Resources */,
     
    31883190                F4E0A2B72122847400AF7C7F /* TestFilePromiseReceiver.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = TestFilePromiseReceiver.mm; sourceTree = "<group>"; };
    31893191                F4E3D80720F708E4007B58C5 /* significant-text-milestone-article.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "significant-text-milestone-article.html"; sourceTree = "<group>"; };
     3192                F4E7A66227222BB100E74D36 /* canvas-image-data.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "canvas-image-data.html"; sourceTree = "<group>"; };
    31903193                F4EB4E8F2328AC3000574DAB /* NSItemProviderAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSItemProviderAdditions.h; path = cocoa/NSItemProviderAdditions.h; sourceTree = SOURCE_ROOT; };
    31913194                F4EB4E902328AC3000574DAB /* NSItemProviderAdditions.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = NSItemProviderAdditions.mm; path = cocoa/NSItemProviderAdditions.mm; sourceTree = SOURCE_ROOT; };
     
    40514054                                464C764C230DF83200AFB020 /* BadServiceWorkerRegistrations-4.sqlite3 */,
    40524055                                2DE71AFF1D49C2F000904094 /* blinking-div.html */,
     4056                                F4E7A66227222BB100E74D36 /* canvas-image-data.html */,
    40534057                                2EFF06C41D8867700004BB30 /* change-video-source-on-click.html */,
    40544058                                2EFF06C61D886A560004BB30 /* change-video-source-on-end.html */,
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/GPUProcess.mm

    r280951 r284786  
    283283}
    284284
     285TEST(GPUProcess, DoNotLeakConnectionAfterClosingWebPage)
     286{
     287    auto configuration = adoptNS([[WKWebViewConfiguration alloc] init]);
     288    WKPreferencesSetBoolValueForKeyForTesting((__bridge WKPreferencesRef)[configuration preferences], true, WKStringCreateWithUTF8CString("UseGPUProcessForCanvasRenderingEnabled"));
     289    WKPreferencesSetBoolValueForKeyForTesting((__bridge WKPreferencesRef)[configuration preferences], false, WKStringCreateWithUTF8CString("UseGPUProcessForDOMRenderingEnabled"));
     290
     291    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 400, 400) configuration:configuration.get()]);
     292    [webView synchronouslyLoadTestPageNamed:@"canvas-image-data"];
     293    EXPECT_EQ(1U, [webView gpuToWebProcessConnectionCount]);
     294    [webView _close];
     295
     296    while ([webView gpuToWebProcessConnectionCount])
     297        TestWebKitAPI::Util::sleep(0.1);
     298}
     299
    285300#if ENABLE(LEGACY_ENCRYPTED_MEDIA)
    286301TEST(GPUProcess, LegacyCDM)
  • trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.h

    r284738 r284786  
    5454- (NSArray<_WKTextInputContext *> *)synchronouslyRequestTextInputContextsInRect:(CGRect)rect;
    5555#endif
     56@property (nonatomic, readonly) NSUInteger gpuToWebProcessConnectionCount;
    5657@property (nonatomic, readonly) NSString *contentsAsString;
    5758@property (nonatomic, readonly) NSArray<NSString *> *tagsInBody;
  • trunk/Tools/TestWebKitAPI/cocoa/TestWKWebView.mm

    r284738 r284786  
    155155#endif // PLATFORM(IOS_FAMILY)
    156156
     157- (NSUInteger)gpuToWebProcessConnectionCount
     158{
     159    __block bool done = false;
     160    __block NSUInteger count = 0;
     161    [self _gpuToWebProcessConnectionCountForTesting:^(NSUInteger result) {
     162        done = true;
     163        count = result;
     164    }];
     165    TestWebKitAPI::Util::run(&done);
     166    return count;
     167}
     168
    157169- (NSString *)contentsAsString
    158170{
Note: See TracChangeset for help on using the changeset viewer.