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

Changeset 244364 in webkit


Ignore:
Timestamp:
Apr 16, 2019, 5:18:11 PM (7 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION(r244162) Clearing website data from ephemeral WKWebsiteDataStore should finish instead of asserting or hanging
https://bugs.webkit.org/show_bug.cgi?id=196995

Patch by Alex Christensen <achristensen@webkit.org> on 2019-04-16
Reviewed by Brady Eidson.

Source/WebKit:

Always call CompletionHandlers. Otherwise things hang or assert.
I added an API test that asserts without this change so we don't regress this again.

  • NetworkProcess/cache/CacheStorageEngine.cpp:

(WebKit::CacheStorage::Engine::clearAllCaches):
(WebKit::CacheStorage::Engine::clearCachesForOrigin):

Tools:

  • TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:

(TEST):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r244361 r244364  
     12019-04-16  Alex Christensen  <achristensen@webkit.org>
     2
     3        REGRESSION(r244162) Clearing website data from ephemeral WKWebsiteDataStore should finish instead of asserting or hanging
     4        https://bugs.webkit.org/show_bug.cgi?id=196995
     5
     6        Reviewed by Brady Eidson.
     7
     8        Always call CompletionHandlers.  Otherwise things hang or assert.
     9        I added an API test that asserts without this change so we don't regress this again.
     10
     11        * NetworkProcess/cache/CacheStorageEngine.cpp:
     12        (WebKit::CacheStorage::Engine::clearAllCaches):
     13        (WebKit::CacheStorage::Engine::clearCachesForOrigin):
     14
    1152019-04-16  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp

    r244162 r244364  
    526526    auto callbackAggregator = CallbackAggregator::create([this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)]() mutable {
    527527        if (!this->shouldPersist())
    528             return;
     528            return completionHandler();
    529529       
    530530        this->clearAllCachesFromDisk(WTFMove(completionHandler));
     
    554554    auto callbackAggregator = CallbackAggregator::create([this, protectedThis = makeRef(*this), origin, completionHandler = WTFMove(completionHandler)]() mutable {
    555555        if (!this->shouldPersist())
    556             return;
     556            return completionHandler();
    557557
    558558        this->clearCachesForOriginFromDisk(origin, [completionHandler = WTFMove(completionHandler)]() mutable {
  • trunk/Tools/ChangeLog

    r244361 r244364  
     12019-04-16  Alex Christensen  <achristensen@webkit.org>
     2
     3        REGRESSION(r244162) Clearing website data from ephemeral WKWebsiteDataStore should finish instead of asserting or hanging
     4        https://bugs.webkit.org/show_bug.cgi?id=196995
     5
     6        Reviewed by Brady Eidson.
     7
     8        * TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
     9        (TEST):
     10
    1112019-04-16  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm

    r242339 r244364  
    2828#import "PlatformUtilities.h"
    2929#import "Test.h"
     30#import "TestWKWebView.h"
    3031#import <WebKit/WKWebsiteDataStorePrivate.h>
    3132#import <WebKit/WebKit.h>
     
    4950    TestWebKitAPI::Util::run(&readyToContinue);
    5051}
     52
     53TEST(WKWebsiteDataStore, RemoveEphemeralData)
     54{
     55    auto configuration = adoptNS([WKWebViewConfiguration new]);
     56    [configuration setWebsiteDataStore:[WKWebsiteDataStore nonPersistentDataStore]];
     57    auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
     58    [webView synchronouslyLoadTestPageNamed:@"simple"];
     59    __block bool done = false;
     60    [[configuration websiteDataStore] removeDataOfTypes:[WKWebsiteDataStore allWebsiteDataTypes] modifiedSince:[NSDate distantPast] completionHandler: ^{
     61        done = true;
     62    }];
     63    TestWebKitAPI::Util::run(&done);
     64}
Note: See TracChangeset for help on using the changeset viewer.