WebKit Bugzilla
Attachment 369444 Details for
Bug 197724
: [Legacy WebKit] REGRESSION (r238078): Crash in hardwareKeyboardAvailabilityChangedCallback()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197724-20190508162959.patch (text/plain), 2.46 KB, created by
Daniel Bates
on 2019-05-08 16:30:00 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Daniel Bates
Created:
2019-05-08 16:30:00 PDT
Size:
2.46 KB
patch
obsolete
>Subversion Revision: 244742 >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index e13f9ccc50e8ca83b839742fff3e755b1155758b..0e8ee57b4c8fd3abdf2eacdddbc59a3796f340a3 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,19 @@ >+2019-05-08 Daniel Bates <dabates@apple.com> >+ >+ [Legacy WebKit] REGRESSION (r238078): Crash in hardwareKeyboardAvailabilityChangedCallback() >+ https://bugs.webkit.org/show_bug.cgi?id=197724 >+ <rdar://problem/49725959> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Speculative fix for race condition. Between the time we receive a kGSEventHardwareKeyboardAvailabilityChangedNotification >+ notification and when we schedule execution to run on the WebThread the WebView that notification >+ was for may no longer exist. Take out a weak ptr on the WebView when we receive the notification >+ and check that we still have it once we are running on the WebThread. >+ >+ * WebView/WebHTMLView.mm: >+ (hardwareKeyboardAvailabilityChangedCallback): >+ > 2019-04-26 Keith Rollin <krollin@apple.com> > > Enable new build rule for post-processing headers when using XCBuild >diff --git a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >index 942e6d1a14573e655da5a1493f7b9950bd78ffcb..1fa5acb35e7cfcbae113cb5a405394994f4f9ed6 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm >@@ -146,6 +146,7 @@ > #import <wtf/ObjCRuntimeExtras.h> > #import <wtf/RunLoop.h> > #import <wtf/SystemTracing.h> >+#import <wtf/WeakObjCPtr.h> > > #if PLATFORM(MAC) > #import "WebNSEventExtras.h" >@@ -820,10 +821,12 @@ static NSString * const WebMarkedTextUpdatedNotification = @"WebMarkedTextUpdate > static void hardwareKeyboardAvailabilityChangedCallback(CFNotificationCenterRef, void* observer, CFStringRef, const void*, CFDictionaryRef) > { > ASSERT(observer); >+ auto weakWebView = WeakObjCPtr<WebHTMLView>((__bridge WebHTMLView *)observer); > WebThreadRun(^{ >- WebHTMLView *webView = (__bridge WebHTMLView *)observer; >- if (Frame* coreFrame = core([webView _frame])) >- coreFrame->eventHandler().capsLockStateMayHaveChanged(); >+ if (auto webView = weakWebView.get()) { >+ if (auto* coreFrame = core([webView _frame])) >+ coreFrame->eventHandler().capsLockStateMayHaveChanged(); >+ } > }); > } > #endif
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 197724
: 369444