Changeset 264613 in webkit
- Timestamp:
- Jul 20, 2020, 1:12:44 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r264602 r264613 1 2020-07-20 Alex Christensen <achristensen@webkit.org> 2 3 REGRESSION(r263551) Main thread often hangs while saving cookies 4 https://bugs.webkit.org/show_bug.cgi?id=214564 5 <rdar://problem/65779712> 6 7 Reviewed by Geoffrey Garen. 8 9 I had assumed that CFNetwork wouldn't write cookies on the main thread, but I was wrong. 10 That change caused spins, so let's just do the work on the WebsiteDataStore's queue instead. 11 12 * UIProcess/API/APIHTTPCookieStore.h: 13 * UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm: 14 (API::HTTPCookieStore::flushDefaultUIProcessCookieStore): 15 * UIProcess/WebsiteData/WebsiteDataStore.cpp: 16 (WebKit::WebsiteDataStore::dispatchOnQueue): 17 * UIProcess/WebsiteData/WebsiteDataStore.h: 18 1 19 2020-07-20 David Kilzer <ddkilzer@apple.com> 2 20 -
trunk/Source/WebKit/UIProcess/API/APIHTTPCookieStore.h
r263551 r264613 86 86 void unregisterForNewProcessPoolNotifications(); 87 87 88 staticvoid flushDefaultUIProcessCookieStore(CompletionHandler<void()>&&);88 void flushDefaultUIProcessCookieStore(CompletionHandler<void()>&&); 89 89 static Vector<WebCore::Cookie> getAllDefaultUIProcessCookieStoreCookies(); 90 90 static void setCookieInDefaultUIProcessCookieStore(const WebCore::Cookie&); -
trunk/Source/WebKit/UIProcess/API/Cocoa/APIHTTPCookieStoreCocoa.mm
r263551 r264613 27 27 #import "APIHTTPCookieStore.h" 28 28 29 #import "WebsiteDataStore.h" 29 30 #import <WebCore/Cookie.h> 30 31 #import <WebCore/CookieStorageObserver.h> … … 40 41 #if HAVE(FOUNDATION_WITH_SAVE_COOKIES_WITH_COMPLETION_HANDLER) 41 42 ASSERT(RunLoop::isMain()); 42 [[NSHTTPCookieStorage sharedHTTPCookieStorage] _saveCookies:makeBlockPtr([completionHandler = WTFMove(completionHandler)]() mutable { 43 // CFNetwork may call the completion block on a background queue, so we need to redispatch to the main thread. 44 RunLoop::main().dispatch(WTFMove(completionHandler)); 45 }).get()]; 43 m_owningDataStore->dispatchOnQueue([completionHandler = WTFMove(completionHandler)] () mutable { 44 [[NSHTTPCookieStorage sharedHTTPCookieStorage] _saveCookies:makeBlockPtr([completionHandler = WTFMove(completionHandler)]() mutable { 45 RunLoop::main().dispatch(WTFMove(completionHandler)); 46 }).get()]; 47 }); 46 48 #else 47 49 [[NSHTTPCookieStorage sharedHTTPCookieStorage] _saveCookies]; -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
r264356 r264613 2222 2222 } 2223 2223 2224 void WebsiteDataStore::dispatchOnQueue(Function<void()>&& function) 2225 { 2226 m_queue->dispatch(WTFMove(function)); 2227 } 2228 2224 2229 uint64_t WebsiteDataStore::perThirdPartyOriginStorageQuota() const 2225 2230 { -
trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h
r264356 r264613 237 237 void clearPendingCookies(); 238 238 239 void dispatchOnQueue(Function<void()>&&); 240 239 241 #if USE(CURL) 240 242 void setNetworkProxySettings(WebCore::CurlProxySettings&&);
Note:
See TracChangeset
for help on using the changeset viewer.