Changeset 240599 in webkit


Ignore:
Timestamp:
Jan 28, 2019, 1:19:52 PM (6 years ago)
Author:
Chris Dumez
Message:

Regression(PSON) Crash under WebPageProxy::didStartProgress()
https://bugs.webkit.org/show_bug.cgi?id=193915
<rdar://problem/47560907>

Reviewed by Alex Christensen.

Source/WebKit:

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::close):
Make sure we destroy the ProvisionalPageProxy if the page gets closed as we do not want to keep receiving
IPC after this or even worse, commit the provisional page.

(WebKit::WebPageProxy::didStartProgress):
Add an assertion in didStartProgress() to make sure we do not receive this IPC after the page has been
closed.

Tools:

Add API test coverage.

  • TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r240589 r240599  
     12019-01-28  Chris Dumez  <cdumez@apple.com>
     2
     3        Regression(PSON) Crash under WebPageProxy::didStartProgress()
     4        https://bugs.webkit.org/show_bug.cgi?id=193915
     5        <rdar://problem/47560907>
     6
     7        Reviewed by Alex Christensen.
     8
     9        * UIProcess/WebPageProxy.cpp:
     10        (WebKit::WebPageProxy::close):
     11        Make sure we destroy the ProvisionalPageProxy if the page gets closed as we do not want to keep receiving
     12        IPC after this or even worse, commit the provisional page.
     13
     14        (WebKit::WebPageProxy::didStartProgress):
     15        Add an assertion in didStartProgress() to make sure we do not receive this IPC after the page has been
     16        closed.
     17
    1182019-01-28  Antoine Quint  <graouts@apple.com>
    219
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r240533 r240599  
    966966#endif
    967967
     968    m_provisionalPage = nullptr;
     969
    968970    m_inspector->invalidate();
    969971
     
    37123714void WebPageProxy::didStartProgress()
    37133715{
     3716    ASSERT(!m_isClosed);
     3717
    37143718    PageClientProtector protector(pageClient());
    37153719
  • trunk/Tools/ChangeLog

    r240597 r240599  
     12019-01-28  Chris Dumez  <cdumez@apple.com>
     2
     3        Regression(PSON) Crash under WebPageProxy::didStartProgress()
     4        https://bugs.webkit.org/show_bug.cgi?id=193915
     5        <rdar://problem/47560907>
     6
     7        Reviewed by Alex Christensen.
     8
     9        Add API test coverage.
     10
     11        * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
     12
    1132019-01-28  Aakash Jain  <aakash_jain@apple.com>
    214
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm

    r240533 r240599  
    33523352}
    33533353
     3354
     3355TEST(ProcessSwap, ClosePageAfterCrossSiteProvisionalLoad)
     3356{
     3357    auto processPoolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
     3358    processPoolConfiguration.get().processSwapsOnNavigation = YES;
     3359    auto processPool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:processPoolConfiguration.get()]);
     3360
     3361    auto webViewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
     3362    [webViewConfiguration setProcessPool:processPool.get()];
     3363    auto handler = adoptNS([[PSONScheme alloc] init]);
     3364    [webViewConfiguration setURLSchemeHandler:handler.get() forURLScheme:@"PSON"];
     3365
     3366    auto webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:webViewConfiguration.get()]);
     3367    auto navigationDelegate = adoptNS([[PSONNavigationDelegate alloc] init]);
     3368    [webView setNavigationDelegate:navigationDelegate.get()];
     3369
     3370    [webView configuration].preferences.safeBrowsingEnabled = NO;
     3371
     3372    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"pson://www.webkit.org/main.html"]]];
     3373    TestWebKitAPI::Util::run(&done);
     3374    done = false;
     3375
     3376    didStartProvisionalLoad = false;
     3377    [webView loadRequest:[NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"simple" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]];
     3378
     3379    navigationDelegate->decidePolicyForNavigationAction = ^(WKNavigationAction *, void (^decisionHandler)(WKNavigationActionPolicy)) {
     3380        decisionHandler(WKNavigationActionPolicyAllow);
     3381
     3382        [webView _close];
     3383        done = true;
     3384    };
     3385
     3386    TestWebKitAPI::Util::run(&done);
     3387    done = false;
     3388
     3389    TestWebKitAPI::Util::sleep(0.5);
     3390}
     3391
    33543392#if PLATFORM(MAC)
    33553393
Note: See TracChangeset for help on using the changeset viewer.