Changeset 252000 in webkit
- Timestamp:
- Nov 4, 2019 10:20:56 AM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r251999 r252000 1 2019-11-04 Alex Christensen <achristensen@webkit.org> 2 3 REGRESSION(r243947) Epson software updater fails to install new version 4 https://bugs.webkit.org/show_bug.cgi?id=203809 5 <rdar://problem/56002179> 6 7 Reviewed by Brady Eidson. 8 9 I manually verified this fixes the issue. See the radar. 10 11 * platform/RuntimeApplicationChecks.h: 12 * platform/cocoa/RuntimeApplicationChecksCocoa.mm: 13 (WebCore::MacApplication::isEpsonSoftwareUpdater): 14 1 15 2019-11-04 Ross Kirsling <ross.kirsling@sony.com> 2 16 -
trunk/Source/WebCore/platform/RuntimeApplicationChecks.h
r251108 r252000 69 69 WEBCORE_EXPORT bool isHRBlock(); 70 70 WEBCORE_EXPORT bool isIAdProducer(); 71 WEBCORE_EXPORT bool isEpsonSoftwareUpdater(); 71 72 72 73 } // MacApplication -
trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm
r251108 r252000 194 194 } 195 195 196 bool MacApplication::isEpsonSoftwareUpdater() 197 { 198 static bool isEpsonSoftwareUpdater = applicationBundleIsEqualTo("com.epson.EPSON_Software_Updater"_s); 199 return isEpsonSoftwareUpdater; 200 } 201 196 202 #endif // PLATFORM(MAC) 197 203 -
trunk/Source/WebKitLegacy/mac/ChangeLog
r251963 r252000 1 2019-11-04 Alex Christensen <achristensen@webkit.org> 2 3 REGRESSION(r243947) Epson software updater fails to install new version 4 https://bugs.webkit.org/show_bug.cgi?id=203809 5 <rdar://problem/56002179> 6 7 Reviewed by Brady Eidson. 8 9 * Misc/WebDownload.mm: 10 (shouldCallOnNetworkThread): 11 (callOnDelegateThread): 12 (isDelegateThread): 13 (-[WebDownloadInternal downloadDidBegin:]): 14 (-[WebDownloadInternal download:willSendRequest:redirectResponse:]): 15 (-[WebDownloadInternal download:didReceiveAuthenticationChallenge:]): 16 (-[WebDownloadInternal download:didReceiveResponse:]): 17 (-[WebDownloadInternal download:didReceiveDataOfLength:]): 18 (-[WebDownloadInternal download:shouldDecodeSourceDataOfMIMEType:]): 19 (-[WebDownloadInternal download:decideDestinationWithSuggestedFilename:]): 20 (-[WebDownloadInternal download:didCreateDestination:]): 21 (-[WebDownloadInternal downloadDidFinish:]): 22 (-[WebDownloadInternal download:didFailWithError:]): 23 1 24 2019-11-02 Devin Rousso <drousso@apple.com> 2 25 -
trunk/Source/WebKitLegacy/mac/Misc/WebDownload.mm
r247837 r252000 37 37 #import <WebCore/NetworkStorageSession.h> 38 38 #import <WebCore/ProtectionSpace.h> 39 #import <WebCore/RuntimeApplicationChecks.h> 39 40 #import <WebKitLegacy/WebPanelAuthenticationHandler.h> 40 41 #import <pal/spi/cocoa/NSURLDownloadSPI.h> 41 42 #import <wtf/Assertions.h> 42 43 #import <wtf/MainThread.h> 44 #import <wtf/spi/darwin/dyldSPI.h> 45 46 static bool shouldCallOnNetworkThread() 47 { 48 #if PLATFORM(MAC) 49 static bool isOldEpsonSoftwareUpdater = WebCore::MacApplication::isEpsonSoftwareUpdater() && dyld_get_program_sdk_version() < DYLD_MACOSX_VERSION_10_15; 50 return isOldEpsonSoftwareUpdater; 51 #else 52 return false; 53 #endif 54 } 55 56 static void callOnDelegateThread(Function<void()>&& function) 57 { 58 if (shouldCallOnNetworkThread()) 59 function(); 60 callOnMainThread(WTFMove(function)); 61 } 62 63 template<typename Callable> 64 static void callOnDelegateThreadAndWait(Callable&& work) 65 { 66 if (shouldCallOnNetworkThread() || isMainThread()) 67 work(); 68 else 69 dispatch_sync(dispatch_get_main_queue(), work); 70 } 43 71 44 72 using namespace WebCore; … … 84 112 - (void)downloadDidBegin:(NSURLDownload *)download 85 113 { 86 callOn MainThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download)] {114 callOnDelegateThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download)] { 87 115 [realDelegate downloadDidBegin:download.get()]; 88 116 }); … … 96 124 returnValue = [realDelegate download:download willSendRequest:request redirectResponse:redirectResponse]; 97 125 }; 98 if (isMainThread()) 99 work(); 100 else 101 dispatch_sync(dispatch_get_main_queue(), work); 126 callOnDelegateThreadAndWait(WTFMove(work)); 102 127 return returnValue.autorelease(); 103 128 } … … 116 141 117 142 if ([realDelegate respondsToSelector:@selector(download:didReceiveAuthenticationChallenge:)]) { 118 callOn MainThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), challenge = retainPtr(challenge)] {143 callOnDelegateThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), challenge = retainPtr(challenge)] { 119 144 [realDelegate download:download.get() didReceiveAuthenticationChallenge:challenge.get()]; 120 145 }); 121 146 } else { 122 callOn MainThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), challenge = retainPtr(challenge)] {147 callOnDelegateThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), challenge = retainPtr(challenge)] { 123 148 NSWindow *window = nil; 124 149 if ([realDelegate respondsToSelector:@selector(downloadWindowForAuthenticationSheet:)]) … … 133 158 - (void)download:(NSURLDownload *)download didReceiveResponse:(NSURLResponse *)response 134 159 { 135 callOn MainThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), response = retainPtr(response)] {160 callOnDelegateThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), response = retainPtr(response)] { 136 161 [realDelegate download:download.get() didReceiveResponse:response.get()]; 137 162 }); … … 140 165 - (void)download:(NSURLDownload *)download didReceiveDataOfLength:(NSUInteger)length 141 166 { 142 callOn MainThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), length] {167 callOnDelegateThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), length] { 143 168 [realDelegate download:download.get() didReceiveDataOfLength:length]; 144 169 }); … … 151 176 returnValue = [realDelegate download:download shouldDecodeSourceDataOfMIMEType:encodingType]; 152 177 }; 153 if (isMainThread()) 154 work(); 155 else 156 dispatch_sync(dispatch_get_main_queue(), work); 178 callOnDelegateThreadAndWait(WTFMove(work)); 157 179 return returnValue; 158 180 } … … 160 182 - (void)download:(NSURLDownload *)download decideDestinationWithSuggestedFilename:(NSString *)filename 161 183 { 162 callOn MainThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), filename = retainPtr(filename)] {184 callOnDelegateThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), filename = retainPtr(filename)] { 163 185 [realDelegate download:download.get() decideDestinationWithSuggestedFilename:filename.get()]; 164 186 }); … … 167 189 - (void)download:(NSURLDownload *)download didCreateDestination:(NSString *)path 168 190 { 169 callOn MainThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), path = retainPtr(path)] {191 callOnDelegateThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), path = retainPtr(path)] { 170 192 [realDelegate download:download.get() didCreateDestination:path.get()]; 171 193 }); … … 174 196 - (void)downloadDidFinish:(NSURLDownload *)download 175 197 { 176 callOn MainThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download)] {198 callOnDelegateThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download)] { 177 199 [realDelegate downloadDidFinish:download.get()]; 178 200 }); … … 181 203 - (void)download:(NSURLDownload *)download didFailWithError:(NSError *)error 182 204 { 183 callOn MainThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), error = retainPtr(error)] {205 callOnDelegateThread([realDelegate = retainPtr(realDelegate), download = retainPtr(download), error = retainPtr(error)] { 184 206 [realDelegate download:download.get() didFailWithError:error.get()]; 185 207 });
Note: See TracChangeset
for help on using the changeset viewer.