Changeset 167164 in webkit
- Timestamp:
- Apr 11, 2014 3:36:37 PM (10 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r167155 r167164 1 2014-04-10 Jer Noble <jer.noble@apple.com> 2 3 [WK2] Dispatch to main thread's run loop to handle cookie requests. 4 https://bugs.webkit.org/show_bug.cgi?id=131524 5 6 Reviewed by Brady Eidson. 7 8 When using synchronous network APIs from the main thread (e.g., -[NSImage 9 initWithContentsOfURL:]) our cookie shim would attempt to dispath_async 10 to the main thread to handle the cookie request, and block against the original 11 request. CFNetwork is still servicing the run loop however, so rather than 12 dispatch_async to the main queue, use the RunLoop to dispatch to the main thread. 13 14 * Shared/mac/CookieStorageShim.mm: 15 (-[WKNSURLSessionLocal _getCookieHeadersForTask:completionHandler:]): 16 1 17 2014-04-11 Tim Horton <timothy_horton@apple.com> 2 18 -
trunk/Source/WebKit2/Shared/mac/CookieStorageShim.mm
r166940 r167164 40 40 #include <wtf/MainThread.h> 41 41 #include <wtf/RetainPtr.h> 42 #include <wtf/RunLoop.h> 42 43 #include <wtf/text/WTFString.h> 43 44 … … 121 122 return; 122 123 123 dispatch_async(dispatch_get_main_queue(), ^{ 124 completionHandler(WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL(nullptr, (CFURLRef)[[task currentRequest] URL])); 124 RetainPtr<NSURLSessionTask> strongTask = task; 125 RunLoop::main().dispatch([strongTask, completionHandler]{ 126 completionHandler(WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL(nullptr, (CFURLRef)[[strongTask currentRequest] URL])); 125 127 }); 126 128 }
Note: See TracChangeset
for help on using the changeset viewer.