Changeset 237365 in webkit
- Timestamp:
- Oct 23, 2018 1:36:37 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r237355 r237365 1 2018-10-23 David Kilzer <ddkilzer@apple.com> 2 3 Fix false positive leaks when using custom -init methods that don't start with -init 4 <https://webkit.org/b/190818> 5 <rdar://problem/45476042> 6 7 Reviewed by Dan Bernstein. 8 9 * UIProcess/Cocoa/WKWebViewContentProvider.h: 10 (-[WKWebViewContentProvider web_initWithFrame:webView:mimeType:]): 11 Add attribute to make this behave like an -init method. 12 1 13 2018-10-23 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Source/WebKit/UIProcess/Cocoa/WKWebViewContentProvider.h
r237266 r237365 44 44 @protocol WKWebViewContentProvider <NSObject> 45 45 46 - (instancetype)web_initWithFrame:(CGRect) frame webView:(WKWebView *)webView mimeType:(NSString *)mimeType;46 - (instancetype)web_initWithFrame:(CGRect)frame webView:(WKWebView *)webView mimeType:(NSString *)mimeType __attribute__((objc_method_family(init))); 47 47 - (void)web_setContentProviderData:(NSData *)data suggestedFilename:(NSString *)filename; 48 48 - (void)web_setMinimumSize:(CGSize)size; -
trunk/Source/WebKitLegacy/mac/ChangeLog
r237266 r237365 1 2018-10-23 David Kilzer <ddkilzer@apple.com> 2 3 Fix false positive leaks when using custom -init methods that don't start with -init 4 <https://webkit.org/b/190818> 5 <rdar://problem/45476042> 6 7 Reviewed by Dan Bernstein. 8 9 * Misc/WebKitErrors.m: Move `descriptions` static global so that 10 it is accessible by both categories. 11 (-[NSError _webkit_initWithDomain:code:URL:]): Declare new 12 NSError (WebKitInternal) category. Add attribute to make this 13 behave like an -init method. 14 (-[NSError _webkit_initWithDomain:code:URL:]): Move into new 15 NSError (WebKitInternal) category. Modernize method. Replace 16 constant NSString with `NSURLErrorFailingURLStringErrorKey`. 17 1 18 2018-10-18 Alexey Proskuryakov <ap@apple.com> 2 19 -
trunk/Source/WebKitLegacy/mac/Misc/WebKitErrors.m
r232452 r237365 30 30 31 31 #import "WebLocalizableStringsInternal.h" 32 #import <Foundation/NSURLError.h> 32 33 #import <WebKitLegacy/WebKitErrorsPrivate.h> 33 34 #import <WebKitLegacy/WebNSURLExtras.h> … … 59 60 #define WebKitErrorDescriptionGeolocationLocationUnknown UI_STRING_INTERNAL("The current location cannot be found.", "WebKitErrorGeolocationLocationUnknown description") 60 61 62 static NSMutableDictionary *descriptions = nil; 63 64 @interface NSError (WebKitInternal) 65 - (instancetype)_webkit_initWithDomain:(NSString *)domain code:(int)code URL:(NSURL *)URL __attribute__((objc_method_family(init))); 66 @end 67 68 @implementation NSError (WebKitInternal) 69 70 - (instancetype)_webkit_initWithDomain:(NSString *)domain code:(int)code URL:(NSURL *)URL 71 { 72 // Insert a localized string here for those folks not savvy to our category methods. 73 NSDictionary *descriptionsDict = [descriptions objectForKey:domain]; 74 NSString *localizedDescription = descriptionsDict ? [descriptionsDict objectForKey:[NSNumber numberWithInt:code]] : nil; 75 NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: 76 URL, @"NSErrorFailingURLKey", 77 [URL absoluteString], NSURLErrorFailingURLStringErrorKey, 78 localizedDescription, NSLocalizedDescriptionKey, 79 nil]; 80 return [self initWithDomain:domain code:code userInfo:dict]; 81 } 82 83 @end 84 61 85 @implementation NSError (WebKitExtras) 62 63 static NSMutableDictionary *descriptions = nil;64 86 65 87 + (void)_registerWebKitErrors … … 90 112 } 91 113 }); 92 }93 94 -(id)_webkit_initWithDomain:(NSString *)domain code:(int)code URL:(NSURL *)URL95 {96 NSDictionary *descriptionsDict;97 NSString *localizedDesc;98 NSDictionary *dict;99 // insert a localized string here for those folks not savvy to our category methods100 descriptionsDict = [descriptions objectForKey:domain];101 localizedDesc = descriptionsDict ? [descriptionsDict objectForKey:[NSNumber numberWithInt:code]] : nil;102 dict = [NSDictionary dictionaryWithObjectsAndKeys:103 URL, @"NSErrorFailingURLKey",104 [URL absoluteString], @"NSErrorFailingURLStringKey",105 localizedDesc, NSLocalizedDescriptionKey,106 nil];107 return [self initWithDomain:domain code:code userInfo:dict];108 114 } 109 115
Note: See TracChangeset
for help on using the changeset viewer.