WebKit Bugzilla
Attachment 368324 Details for
Bug 197314
: WebKitTestRunner leaks an NSDictionary and multiple JSStringRef objects
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch v1
bug-197314-20190426095204.patch (text/plain), 5.66 KB, created by
David Kilzer (:ddkilzer)
on 2019-04-26 09:52:05 PDT
(
hide
)
Description:
Patch v1
Filename:
MIME Type:
Creator:
David Kilzer (:ddkilzer)
Created:
2019-04-26 09:52:05 PDT
Size:
5.66 KB
patch
obsolete
>Subversion Revision: 244596 >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index a8617e4f7e8dd8b3856b93ada85cb09a89e1710c..9181af9602bec2b49c3a34d65894d609be02ea96 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,28 @@ >+2019-04-26 David Kilzer <ddkilzer@apple.com> >+ >+ WebKitTestRunner leaks an NSDictionary and multiple JSStringRef objects >+ <https://webkit.org/b/197314> >+ <rdar://problem/50245252> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebKitTestRunner/UIScriptControllerCocoa.mm: >+ (WTR::UIScriptController::lastUndoLabel const): >+ (WTR::UIScriptController::firstRedoLabel const): >+ - Use adopt(JSStringCreateWithCFString(...)) to fix leaks. >+ >+ * WebKitTestRunner/ios/HIDEventGenerator.mm: >+ (-[HIDEventGenerator sendEventStream:completionBlock:]): >+ - Call -autorelease to fix leak of NSDictionary. >+ >+ * WebKitTestRunner/ios/UIScriptControllerIOS.mm: >+ (WTR::UIScriptController::accessibilitySpeakSelectionContent const): >+ (WTR::UIScriptController::selectFormPopoverTitle const): >+ (WTR::UIScriptController::textContentType const): >+ (WTR::UIScriptController::formInputLabel const): >+ (WTR::UIScriptController::scrollingTreeAsText const): >+ - Use adopt(JSStringCreateWithCFString(...)) to fix leaks. >+ > 2019-04-24 Alex Christensen <achristensen@webkit.org> > > Add unit test for r239322 >diff --git a/Tools/WebKitTestRunner/UIScriptControllerCocoa.mm b/Tools/WebKitTestRunner/UIScriptControllerCocoa.mm >index eabdf2747117536129b5c86e2efab3a5ee8759f5..7c653c0ab8c31f502c45a4960884ab6ad4cc5206 100644 >--- a/Tools/WebKitTestRunner/UIScriptControllerCocoa.mm >+++ b/Tools/WebKitTestRunner/UIScriptControllerCocoa.mm >@@ -151,12 +151,12 @@ void UIScriptController::setDefaultCalendarType(JSStringRef calendarIdentifier) > > JSRetainPtr<JSStringRef> UIScriptController::lastUndoLabel() const > { >- return JSStringCreateWithCFString((__bridge CFStringRef)platformUndoManager().undoActionName); >+ return adopt(JSStringCreateWithCFString((__bridge CFStringRef)platformUndoManager().undoActionName)); > } > > JSRetainPtr<JSStringRef> UIScriptController::firstRedoLabel() const > { >- return JSStringCreateWithCFString((__bridge CFStringRef)platformUndoManager().redoActionName); >+ return adopt(JSStringCreateWithCFString((__bridge CFStringRef)platformUndoManager().redoActionName)); > } > > NSUndoManager *UIScriptController::platformUndoManager() const >diff --git a/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm b/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm >index caf76b73ae5c5a518cf156b1b83c991e95b0fd13..57756267e495936359e912ffc0202bbf34c98eaf 100644 >--- a/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm >+++ b/Tools/WebKitTestRunner/ios/HIDEventGenerator.mm >@@ -1138,7 +1138,7 @@ - (void)sendEventStream:(NSDictionary *)eventInfo completionBlock:(void (^)(void > } > > NSDictionary* threadData = @{ >- @"eventInfo": [eventInfo copy], >+ @"eventInfo": [[eventInfo copy] autorelease], > @"completionBlock": [[completionBlock copy] autorelease] > }; > >diff --git a/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm b/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >index 191bc993fed605142810ff6e7d3f83a967f29189..37554c003d67714882e6c67b52f92a6ba5a16fef 100644 >--- a/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >+++ b/Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm >@@ -198,7 +198,7 @@ void UIScriptController::retrieveSpeakSelectionContent(JSValueRef callback) > JSRetainPtr<JSStringRef> UIScriptController::accessibilitySpeakSelectionContent() const > { > TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); >- return JSStringCreateWithCFString((CFStringRef)webView.accessibilitySpeakSelectionContent); >+ return adopt(JSStringCreateWithCFString((CFStringRef)webView.accessibilitySpeakSelectionContent)); > } > > void UIScriptController::simulateAccessibilitySettingsChangeNotification(JSValueRef callback) >@@ -499,19 +499,19 @@ void UIScriptController::dismissFilePicker(JSValueRef callback) > JSRetainPtr<JSStringRef> UIScriptController::selectFormPopoverTitle() const > { > TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); >- return JSStringCreateWithCFString((CFStringRef)webView.selectFormPopoverTitle); >+ return adopt(JSStringCreateWithCFString((CFStringRef)webView.selectFormPopoverTitle)); > } > > JSRetainPtr<JSStringRef> UIScriptController::textContentType() const > { > TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); >- return JSStringCreateWithCFString((CFStringRef)(webView.textContentTypeForTesting ?: @"")); >+ return adopt(JSStringCreateWithCFString((CFStringRef)(webView.textContentTypeForTesting ?: @""))); > } > > JSRetainPtr<JSStringRef> UIScriptController::formInputLabel() const > { > TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); >- return JSStringCreateWithCFString((CFStringRef)webView.formInputLabel); >+ return adopt(JSStringCreateWithCFString((CFStringRef)webView.formInputLabel)); > } > > void UIScriptController::selectFormAccessoryPickerRow(long rowIndex) >@@ -751,7 +751,7 @@ void UIScriptController::removeAllDynamicDictionaries() > JSRetainPtr<JSStringRef> UIScriptController::scrollingTreeAsText() const > { > TestRunnerWKWebView *webView = TestController::singleton().mainWebView()->platformView(); >- return JSStringCreateWithCFString((CFStringRef)[webView _scrollingTreeAsText]); >+ return adopt(JSStringCreateWithCFString((CFStringRef)[webView _scrollingTreeAsText])); > } > > JSObjectRef UIScriptController::propertiesOfLayerWithID(uint64_t layerID) const
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197314
: 368324