Changeset 218760 in webkit
- Timestamp:
- Jun 23, 2017 1:45:46 PM (7 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r218759 r218760 1 2017-06-23 David Kilzer <ddkilzer@apple.com> 2 3 v3: REGRESSION (r218419): 3 NSMutableDictionary leaks calling -[WKProcessPool _pluginLoadClientPolicies] 4 <https://webkit.org/b/173689> 5 6 Reviewed by Tim Horton. 7 8 * UIProcess/API/Cocoa/WKProcessPool.mm: 9 (policiesHashMapToDictionary): Use adoptNS().get() to avoid 10 dumping objects into autoreleasepools unnecessarily. 11 * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: 12 (-[WKProcessPool _pluginLoadClientPolicies]): Add back 'copy' 13 attribute to document that we're returning a new object on each 14 invocation. I shouldn't have removed it in the v2 patch. 15 1 16 2017-06-23 Youenn Fablet <youenn@apple.com> 2 17 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm
r218704 r218760 1 1 /* 2 * Copyright (C) 2014 , 2016Apple Inc. All rights reserved.2 * Copyright (C) 2014-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 314 314 static NSDictionary *policiesHashMapToDictionary(const HashMap<String, HashMap<String, HashMap<String, uint8_t>>>& map) 315 315 { 316 NSMutableDictionary *policies = [NSMutableDictionary dictionaryWithCapacity:map.size()];316 auto policies = adoptNS([[NSMutableDictionary alloc] initWithCapacity:map.size()]); 317 317 for (auto& hostPair : map) { 318 318 NSString *host = hostPair.key; 319 policies [host] = [NSMutableDictionary dictionaryWithCapacity:hostPair.value.size()];319 policies.get()[host] = adoptNS([[NSMutableDictionary alloc] initWithCapacity:hostPair.value.size()]).get(); 320 320 for (auto& bundleIdentifierPair : hostPair.value) { 321 321 NSString *bundlerIdentifier = bundleIdentifierPair.key; 322 policies [host][bundlerIdentifier] = [NSMutableDictionary dictionaryWithCapacity:bundleIdentifierPair.value.size()];322 policies.get()[host][bundlerIdentifier] = adoptNS([[NSMutableDictionary alloc] initWithCapacity:bundleIdentifierPair.value.size()]).get(); 323 323 for (auto& versionPair : bundleIdentifierPair.value) { 324 324 NSString *version = versionPair.key; 325 policies [host][bundlerIdentifier][version] = [NSNumber numberWithUnsignedInt:versionPair.value];325 policies.get()[host][bundlerIdentifier][version] = adoptNS([[NSNumber alloc] initWithUnsignedInt:versionPair.value]).get(); 326 326 } 327 327 } 328 328 } 329 return policies ;329 return policies.autorelease(); 330 330 } 331 331 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
r218704 r218760 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014-2017 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 55 55 #if !TARGET_OS_IPHONE 56 56 - (void)_resetPluginLoadClientPolicies:(NSDictionary *)policies WK_API_AVAILABLE(macosx(WK_MAC_TBA)); 57 @property (nonatomic, readonly ) NSDictionary *_pluginLoadClientPolicies WK_API_AVAILABLE(macosx(WK_MAC_TBA));57 @property (nonatomic, readonly, copy) NSDictionary *_pluginLoadClientPolicies WK_API_AVAILABLE(macosx(WK_MAC_TBA)); 58 58 #endif 59 59
Note: See TracChangeset
for help on using the changeset viewer.