Title: [258607] branches/safari-610.1.7-branch/Source/WebKit
Revision
258607
Author
[email protected]
Date
2020-03-17 15:46:25 -0700 (Tue, 17 Mar 2020)

Log Message

Cherry-pick r258515. rdar://problem/60551856

    [Cocoa] Crash under -[WKPreferenceObserver init]
    https://bugs.webkit.org/show_bug.cgi?id=209145

    Reviewed by Darin Adler.

    Handle the case when calling [NSUserDefaults initWithSuiteName:] did not succeed.

    No new tests, since I have not been able to reproduce.

    * UIProcess/Cocoa/PreferenceObserver.mm:
    (-[WKPreferenceObserver init]):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258515 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-610.1.7-branch/Source/WebKit/ChangeLog (258606 => 258607)


--- branches/safari-610.1.7-branch/Source/WebKit/ChangeLog	2020-03-17 22:45:17 UTC (rev 258606)
+++ branches/safari-610.1.7-branch/Source/WebKit/ChangeLog	2020-03-17 22:46:25 UTC (rev 258607)
@@ -1,5 +1,39 @@
 2020-03-17  Alan Coon  <[email protected]>
 
+        Cherry-pick r258515. rdar://problem/60551856
+
+    [Cocoa] Crash under -[WKPreferenceObserver init]
+    https://bugs.webkit.org/show_bug.cgi?id=209145
+    
+    Reviewed by Darin Adler.
+    
+    Handle the case when calling [NSUserDefaults initWithSuiteName:] did not succeed.
+    
+    No new tests, since I have not been able to reproduce.
+    
+    * UIProcess/Cocoa/PreferenceObserver.mm:
+    (-[WKPreferenceObserver init]):
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-03-16  Per Arne Vollan  <[email protected]>
+
+            [Cocoa] Crash under -[WKPreferenceObserver init]
+            https://bugs.webkit.org/show_bug.cgi?id=209145
+
+            Reviewed by Darin Adler.
+
+            Handle the case when calling [NSUserDefaults initWithSuiteName:] did not succeed.
+
+            No new tests, since I have not been able to reproduce.
+
+            * UIProcess/Cocoa/PreferenceObserver.mm:
+            (-[WKPreferenceObserver init]):
+
+2020-03-17  Alan Coon  <[email protected]>
+
         Cherry-pick r258518. rdar://problem/60517387
 
     [macOS] Accessibility sandbox regressions

Modified: branches/safari-610.1.7-branch/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm (258606 => 258607)


--- branches/safari-610.1.7-branch/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm	2020-03-17 22:45:17 UTC (rev 258606)
+++ branches/safari-610.1.7-branch/Source/WebKit/UIProcess/Cocoa/PreferenceObserver.mm	2020-03-17 22:46:25 UTC (rev 258607)
@@ -203,6 +203,10 @@
 
     for (auto domain : domains) {
         auto userDefaults = adoptNS([[WKUserDefaults alloc] initWithSuiteName:domain]);
+        if (!userDefaults) {
+            WTFLogAlways("Could not init user defaults instance for domain %s", String(domain).utf8().data());
+            continue;
+        }
         userDefaults.get()->m_observer = self;
         // Start observing a dummy key in order to make the preference daemon become aware of our NSUserDefaults instance.
         // This is to make sure we receive KVO notifications. We cannot use normal KVO techniques here, since we are looking
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to