Changeset 179161 in webkit


Ignore:
Timestamp:
Jan 26, 2015 6:39:44 PM (9 years ago)
Author:
Simon Fraser
Message:

[iOS WK2] Fix possible crash when -[WKWebView evaluateJavaScript:completionHandler:] was called then the WKWebView is destroyed
https://bugs.webkit.org/show_bug.cgi?id=140203
rdar://problem/19198492

Reviewed by Sam Weinig.
Source/WebKit2:

When handling the OwnerWasInvalidated case in -[WKWebView evaluateJavaScript:completionHandler:],
the block passed to dispatch_async() needs to be retained. Fix by passing the RefPtr
to the lambda.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView evaluateJavaScript:completionHandler:]):

Tools:

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewEvaluateJavaScript.mm: Added.

(TEST):

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r179157 r179161  
     12015-01-26  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] Fix possible crash when -[WKWebView evaluateJavaScript:completionHandler:] was called then the WKWebView is destroyed
     4        https://bugs.webkit.org/show_bug.cgi?id=140203
     5        rdar://problem/19198492
     6
     7        Reviewed by Sam Weinig.
     8       
     9        When handling the OwnerWasInvalidated case in -[WKWebView evaluateJavaScript:completionHandler:],
     10        the block passed to dispatch_async() needs to be retained. Fix by passing the RefPtr
     11        to the lambda.
     12
     13        * UIProcess/API/Cocoa/WKWebView.mm:
     14        (-[WKWebView evaluateJavaScript:completionHandler:]):
     15
    1162015-01-26  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/Tools/ChangeLog

    r179144 r179161  
     12015-01-26  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [iOS WK2] Fix possible crash when -[WKWebView evaluateJavaScript:completionHandler:] was called then the WKWebView is destroyed
     4        https://bugs.webkit.org/show_bug.cgi?id=140203
     5        rdar://problem/19198492
     6
     7        Reviewed by Sam Weinig.
     8
     9        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     10        * TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewEvaluateJavaScript.mm: Added.
     11        (TEST):
     12
    1132015-01-26  David Kilzer  <ddkilzer@apple.com>
    214
Note: See TracChangeset for help on using the changeset viewer.