Changeset 252412 in webkit
- Timestamp:
- Nov 13, 2019, 9:31:49 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/ios-wk2/TestExpectations (modified) (1 diff)
-
Source/WebKit/ChangeLog (modified) (1 diff)
-
Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp (modified) (4 diffs)
-
Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h (modified) (2 diffs)
-
Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r252406 r252412 1 2019-11-13 Youenn Fablet <youenn@apple.com> 2 3 [ iOS ]: Layout Test http/tests/IndexedDB/storage-limit-1.https.html is a Flaky Failure 4 https://bugs.webkit.org/show_bug.cgi?id=203275 5 <rdar://problem/56516249> 6 7 Reviewed by Alex Christensen. 8 9 * platform/ios-wk2/TestExpectations: 10 1 11 2019-11-13 Per Arne Vollan <pvollan@apple.com> 2 12 -
trunk/LayoutTests/platform/ios-wk2/TestExpectations
r252140 r252412 1352 1352 webkit.org/b/203264 [ Release ] editing/pasteboard/smart-paste-paragraph-004.html [ Pass Failure ] 1353 1353 1354 # <rdar://problem/56516249> REGRESSION (r250936?) [ iOS ]: Layout Test http/tests/IndexedDB/storage-limit-1.https.html is a Flaky Failure (203275)1355 webkit.org/b/203275 http/tests/IndexedDB/storage-limit-1.https.html [ Pass Failure ]1356 1357 1354 # <rdar://problem/56590026> [iOS] fast/forms/contenteditable- font-optical-size.html landed flaky (203371) 1358 1355 webkit.org/b/203371 fast/forms/contenteditable-font-optical-size.html [ Pass Failure ] -
trunk/Source/WebKit/ChangeLog
r252410 r252412 1 2019-11-13 Youenn Fablet <youenn@apple.com> 2 3 [ iOS ]: Layout Test http/tests/IndexedDB/storage-limit-1.https.html is a Flaky Failure 4 https://bugs.webkit.org/show_bug.cgi?id=203275 5 <rdar://problem/56516249> 6 7 Reviewed by Alex Christensen. 8 9 Fix flakiness by clearing the storage of each cache when the cache is being cleared. 10 This ensures that the storage salt gets recreated if needed. 11 12 To further improve repeatability, make sure that initialize based tasks happen after clear tasks are complete. 13 For that purpose, add a clear task counter and append initialize callbacks to a Vector if counter is not zero. 14 Increment counter at clear task creation and decrement counter at completion time. 15 If counter is back to 0, we can safely process the pending clear tasks. 16 17 Covered by unflaked test. 18 19 * NetworkProcess/cache/CacheStorageEngine.cpp: 20 (WebKit::CacheStorage::Engine::~Engine): 21 (WebKit::CacheStorage::Engine::initialize): 22 (WebKit::CacheStorage::CompletionHandler<void): 23 (WebKit::CacheStorage::Engine::clearAllCaches): 24 (WebKit::CacheStorage::Engine::clearCachesForOrigin): 25 * NetworkProcess/cache/CacheStorageEngine.h: 26 * NetworkProcess/cache/CacheStorageEngineCaches.cpp: 27 (WebKit::CacheStorage::Caches::clearMemoryRepresentation): 28 1 29 2019-11-13 Chris Dumez <cdumez@apple.com> 2 30 -
trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.cpp
r252381 r252412 63 63 caches->detach(); 64 64 65 auto pendingClearCallbacks = WTFMove(m_pendingClearCallbacks); 66 for (auto& callback : pendingClearCallbacks) 67 callback(Error::Internal); 68 65 69 auto initializationCallbacks = WTFMove(m_initializationCallbacks); 66 70 for (auto& callback : initializationCallbacks) … … 290 294 void Engine::initialize(CompletionCallback&& callback) 291 295 { 296 if (m_clearTaskCounter || !m_pendingClearCallbacks.isEmpty()) { 297 m_pendingClearCallbacks.append(WTFMove(callback)); 298 return; 299 } 300 292 301 if (m_salt) { 293 302 callback(WTF::nullopt); … … 597 606 } 598 607 608 CompletionHandler<void()> Engine::createClearTask(CompletionHandler<void()>&& completionHandler) 609 { 610 ++m_clearTaskCounter; 611 return [this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)]() mutable { 612 completionHandler(); 613 if (!--m_clearTaskCounter) { 614 auto callbacks = WTFMove(m_pendingClearCallbacks); 615 for (auto& callback : callbacks) 616 initialize(WTFMove(callback)); 617 } 618 }; 619 } 620 599 621 void Engine::clearAllCaches(CompletionHandler<void()>&& completionHandler) 600 622 { 601 623 ASSERT(RunLoop::isMain()); 602 624 603 auto callbackAggregator = CallbackAggregator::create([this, protectedThis = makeRef(*this), completionHandler = WTFMove(completionHandler)]() mutable {625 auto callbackAggregator = CallbackAggregator::create([this, completionHandler = createClearTask(WTFMove(completionHandler))]() mutable { 604 626 if (!this->shouldPersist()) 605 627 return completionHandler(); … … 630 652 ASSERT(RunLoop::isMain()); 631 653 632 auto callbackAggregator = CallbackAggregator::create([this, protectedThis = makeRef(*this), origin, completionHandler = WTFMove(completionHandler)]() mutable {654 auto callbackAggregator = CallbackAggregator::create([this, origin, completionHandler = createClearTask(WTFMove(completionHandler))]() mutable { 633 655 if (!this->shouldPersist()) 634 656 return completionHandler(); -
trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngine.h
r252381 r252412 133 133 void readCache(uint64_t cacheIdentifier, CacheCallback&&); 134 134 135 CompletionHandler<void()> createClearTask(CompletionHandler<void()>&&); 136 135 137 Cache* cache(uint64_t cacheIdentifier); 136 138 … … 147 149 HashMap<uint64_t, CompletionHandler<void(const NetworkCache::Data&, int error)>> m_pendingReadCallbacks; 148 150 uint64_t m_pendingCallbacksCounter { 0 }; 151 Vector<WebCore::DOMCacheEngine::CompletionCallback> m_pendingClearCallbacks; 152 uint64_t m_clearTaskCounter { 0 }; 149 153 }; 150 154 -
trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp
r252381 r252412 635 635 void Caches::clearMemoryRepresentation() 636 636 { 637 if (!m_isInitialized) {638 ASSERT(!m_storage || !hasActiveCache() || !m_pendingInitializationCallbacks.isEmpty());639 // m_storage might not be null in case Caches is being initialized. This is fine as nullify it below is a memory optimization.640 m_caches.clear();641 return;642 }643 644 637 makeDirty(); 645 638 m_caches.clear();
Note:
See TracChangeset
for help on using the changeset viewer.