Changeset 218719 in webkit
- Timestamp:
- Jun 22, 2017 2:36:02 PM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r218702 r218719 1 2017-06-22 David Kilzer <ddkilzer@apple.com> 2 3 REGRESSION (r218419): 7 leaks in PluginLoadClientPolicies.mm 4 <https://webkit.org/b/173721> 5 6 Reviewed by Joseph Pecoraro. 7 8 Use RetainPtr<> to create NSMutableDictionary and NSNumber 9 objects to fix leaks and to avoid the autoreleasepool. 10 11 * TestWebKitAPI/Tests/WebKit2Cocoa/PluginLoadClientPolicies.mm: 12 (TEST): 13 1 14 2017-06-22 Matt Lewis <jlewis3@apple.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/PluginLoadClientPolicies.mm
r218419 r218719 33 33 #import <WebKit/WKPluginInformation.h> 34 34 #import <WebKit/WKProcessPoolPrivate.h> 35 #import <wtf/RetainPtr.h> 35 36 36 37 #if WK_API_ENABLED … … 68 69 EXPECT_EQ(kWKPluginLoadClientPolicyAllow, [policiesForAppleHost[@"com.microsoft.SilverlightPlugin"][@"5.1.50901.0"] unsignedIntegerValue]); 69 70 70 NSMutableDictionary *newPolicies = [policies mutableCopy];71 [newPolicies removeObjectForKey:@"apple.com"];72 newPolicies [@"google.com"] = [[NSMutableDictionary alloc] init];73 newPolicies [@"google.com"][@"com.macromedia.Flash Player.plugin"] = [[NSMutableDictionary alloc] init];74 newPolicies [@"google.com"][@"com.macromedia.Flash Player.plugin"][@"26.0.0.126"] = [[NSNumber alloc] initWithUnsignedInt:kWKPluginLoadClientPolicyAllowAlways];75 newPolicies [@"google.com"][@"com.apple.QuickTime.plugin"] = [[NSMutableDictionary alloc] init];76 newPolicies [@"google.com"][@"com.apple.QuickTime.plugin"][@"1.0"] = [[NSNumber alloc] initWithUnsignedInt:kWKPluginLoadClientPolicyBlock];77 newPolicies [@"google.com"][@"com.apple.QuickTime.plugin"][@"1.1"] = [[NSNumber alloc] initWithUnsignedInt:kWKPluginLoadClientPolicyAllow];71 RetainPtr<NSMutableDictionary> newPolicies = adoptNS([policies mutableCopy]); 72 [newPolicies.get() removeObjectForKey:@"apple.com"]; 73 newPolicies.get()[@"google.com"] = adoptNS([[NSMutableDictionary alloc] initWithCapacity:2]).get(); 74 newPolicies.get()[@"google.com"][@"com.macromedia.Flash Player.plugin"] = adoptNS([[NSMutableDictionary alloc] initWithCapacity:1]).get(); 75 newPolicies.get()[@"google.com"][@"com.macromedia.Flash Player.plugin"][@"26.0.0.126"] = adoptNS([[NSNumber alloc] initWithUnsignedInt:kWKPluginLoadClientPolicyAllowAlways]).get(); 76 newPolicies.get()[@"google.com"][@"com.apple.QuickTime.plugin"] = adoptNS([[NSMutableDictionary alloc] initWithCapacity:2]).get(); 77 newPolicies.get()[@"google.com"][@"com.apple.QuickTime.plugin"][@"1.0"] = adoptNS([[NSNumber alloc] initWithUnsignedInt:kWKPluginLoadClientPolicyBlock]).get(); 78 newPolicies.get()[@"google.com"][@"com.apple.QuickTime.plugin"][@"1.1"] = adoptNS([[NSNumber alloc] initWithUnsignedInt:kWKPluginLoadClientPolicyAllow]).get(); 78 79 79 [processPool.get() _resetPluginLoadClientPolicies:newPolicies ];80 [processPool.get() _resetPluginLoadClientPolicies:newPolicies.get()]; 80 81 81 82 policies = processPool.get()._pluginLoadClientPolicies;
Note: See TracChangeset
for help on using the changeset viewer.