Title: [258179] branches/safari-610.1.7-branch
Revision
258179
Author
[email protected]
Date
2020-03-09 17:10:25 -0700 (Mon, 09 Mar 2020)

Log Message

Cherry-pick r258174. rdar://problem/60250780

    [macOS] Notification observer is not removed
    https://bugs.webkit.org/show_bug.cgi?id=208834

    Reviewed by Tim Horton.

    Source/WebKit:

    The Accessibility notification observer is not being removed on macOS.

    API test: WebKit.EnableAccessibilityCrash

    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
    (WebKit::WebProcessPool::unregisterNotificationObservers):

    Tools:

    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKit/EnableAccessibility.mm: Added.
    (TEST):

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-610.1.7-branch/Source/WebKit/ChangeLog (258178 => 258179)


--- branches/safari-610.1.7-branch/Source/WebKit/ChangeLog	2020-03-09 23:59:40 UTC (rev 258178)
+++ branches/safari-610.1.7-branch/Source/WebKit/ChangeLog	2020-03-10 00:10:25 UTC (rev 258179)
@@ -1,3 +1,45 @@
+2020-03-09  Russell Epstein  <[email protected]>
+
+        Cherry-pick r258174. rdar://problem/60250780
+
+    [macOS] Notification observer is not removed
+    https://bugs.webkit.org/show_bug.cgi?id=208834
+    
+    Reviewed by Tim Horton.
+    
+    Source/WebKit:
+    
+    The Accessibility notification observer is not being removed on macOS.
+    
+    API test: WebKit.EnableAccessibilityCrash
+    
+    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+    (WebKit::WebProcessPool::unregisterNotificationObservers):
+    
+    Tools:
+    
+    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+    * TestWebKitAPI/Tests/WebKit/EnableAccessibility.mm: Added.
+    (TEST):
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-03-09  Per Arne Vollan  <[email protected]>
+
+            [macOS] Notification observer is not removed
+            https://bugs.webkit.org/show_bug.cgi?id=208834
+
+            Reviewed by Tim Horton.
+
+            The Accessibility notification observer is not being removed on macOS.
+
+            API test: WebKit.EnableAccessibilityCrash
+
+            * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+            (WebKit::WebProcessPool::unregisterNotificationObservers):
+
 2020-03-09  Alan Coon  <[email protected]>
 
         Cherry-pick r258168. rdar://problem/60249994

Modified: branches/safari-610.1.7-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (258178 => 258179)


--- branches/safari-610.1.7-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2020-03-09 23:59:40 UTC (rev 258178)
+++ branches/safari-610.1.7-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2020-03-10 00:10:25 UTC (rev 258179)
@@ -687,12 +687,12 @@
 #elif !PLATFORM(MACCATALYST)
     CFNotificationCenterRemoveObserver(CFNotificationCenterGetDarwinNotifyCenter(), this, static_cast<CFStringRef>(UIBacklightLevelChangedNotification) , nullptr);
 #if PLATFORM(IOS)
-    [[NSNotificationCenter defaultCenter] removeObserver:m_accessibilityEnabledObserver.get()];
 #if ENABLE(REMOTE_INSPECTOR)
     CFNotificationCenterRemoveObserver(CFNotificationCenterGetDarwinNotifyCenter(), this, CFSTR(WIRServiceEnabledNotification), nullptr);
 #endif
 #endif // PLATFORM(IOS)
 #endif // !PLATFORM(IOS_FAMILY)
+    [[NSNotificationCenter defaultCenter] removeObserver:m_accessibilityEnabledObserver.get()];
 }
 
 static CFURLStorageSessionRef privateBrowsingSession()

Modified: branches/safari-610.1.7-branch/Tools/ChangeLog (258178 => 258179)


--- branches/safari-610.1.7-branch/Tools/ChangeLog	2020-03-09 23:59:40 UTC (rev 258178)
+++ branches/safari-610.1.7-branch/Tools/ChangeLog	2020-03-10 00:10:25 UTC (rev 258179)
@@ -1,3 +1,42 @@
+2020-03-09  Russell Epstein  <[email protected]>
+
+        Cherry-pick r258174. rdar://problem/60250780
+
+    [macOS] Notification observer is not removed
+    https://bugs.webkit.org/show_bug.cgi?id=208834
+    
+    Reviewed by Tim Horton.
+    
+    Source/WebKit:
+    
+    The Accessibility notification observer is not being removed on macOS.
+    
+    API test: WebKit.EnableAccessibilityCrash
+    
+    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+    (WebKit::WebProcessPool::unregisterNotificationObservers):
+    
+    Tools:
+    
+    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+    * TestWebKitAPI/Tests/WebKit/EnableAccessibility.mm: Added.
+    (TEST):
+    
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@258174 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-03-09  Per Arne Vollan  <[email protected]>
+
+            [macOS] Notification observer is not removed
+            https://bugs.webkit.org/show_bug.cgi?id=208834
+
+            Reviewed by Tim Horton.
+
+            * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+            * TestWebKitAPI/Tests/WebKit/EnableAccessibility.mm: Added.
+            (TEST):
+
 2020-03-08  Per Arne Vollan  <[email protected]>
 
         [iOS] Mapping to UTI from tag and tag class should be performed in the UI process

Modified: branches/safari-610.1.7-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (258178 => 258179)


--- branches/safari-610.1.7-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2020-03-09 23:59:40 UTC (rev 258178)
+++ branches/safari-610.1.7-branch/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj	2020-03-10 00:10:25 UTC (rev 258179)
@@ -883,6 +883,7 @@
 		C0ADBE9612FCA79B00D2C129 /* simple-form.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = C0ADBE8412FCA6B600D2C129 /* simple-form.html */; };
 		C0BD669F131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */; };
 		C0C5D3C61459912900A802A6 /* GetBackingScaleFactor_Bundle.mm in Sources */ = {isa = PBXBuildFile; fileRef = C0C5D3BD14598B6F00A802A6 /* GetBackingScaleFactor_Bundle.mm */; };
+		C13D82D92416F13200A62793 /* EnableAccessibility.mm in Sources */ = {isa = PBXBuildFile; fileRef = C13D82D82416F13200A62793 /* EnableAccessibility.mm */; };
 		C145CC0C23DA5A1F003A5EEB /* MimeTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = C145CC0B23DA5A0F003A5EEB /* MimeTypes.mm */; };
 		C15CBB3023F1FF1A00300CC7 /* BacklightLevelNotification.mm in Sources */ = {isa = PBXBuildFile; fileRef = C15CBB2F23F1FF1A00300CC7 /* BacklightLevelNotification.mm */; };
 		C15CBB3F23FB177A00300CC7 /* PreferenceChanges.mm in Sources */ = {isa = PBXBuildFile; fileRef = C15CBB3E23FB177A00300CC7 /* PreferenceChanges.mm */; };
@@ -2457,6 +2458,7 @@
 		C0BD669E131D3CFF00E18F2A /* ResponsivenessTimerDoesntFireEarly_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResponsivenessTimerDoesntFireEarly_Bundle.cpp; sourceTree = "<group>"; };
 		C0C5D3BC14598B6F00A802A6 /* GetBackingScaleFactor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GetBackingScaleFactor.mm; sourceTree = "<group>"; };
 		C0C5D3BD14598B6F00A802A6 /* GetBackingScaleFactor_Bundle.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = GetBackingScaleFactor_Bundle.mm; sourceTree = "<group>"; };
+		C13D82D82416F13200A62793 /* EnableAccessibility.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = EnableAccessibility.mm; sourceTree = "<group>"; };
 		C145CC0B23DA5A0F003A5EEB /* MimeTypes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MimeTypes.mm; sourceTree = "<group>"; };
 		C15CBB2F23F1FF1A00300CC7 /* BacklightLevelNotification.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = BacklightLevelNotification.mm; sourceTree = "<group>"; };
 		C15CBB3E23FB177A00300CC7 /* PreferenceChanges.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PreferenceChanges.mm; sourceTree = "<group>"; };
@@ -2911,6 +2913,7 @@
 			children = (
 				C15CBB2F23F1FF1A00300CC7 /* BacklightLevelNotification.mm */,
 				C1692DC923D10DAE006E88F7 /* Battery.mm */,
+				C13D82D82416F13200A62793 /* EnableAccessibility.mm */,
 				E394AE6E23F2303E005B4936 /* GrantAccessToMobileAssets.mm */,
 				E34A6D182412DE390012AB6E /* GrantAccessToPreferencesService.mm */,
 				E35B908123F60DD0000011FF /* LocalizedDeviceModel.mm */,
@@ -4807,6 +4810,7 @@
 				7CCE7EE01A411A9A00447C4C /* EditorCommands.mm in Sources */,
 				F44D06471F39627A001A0E29 /* EditorStateTests.mm in Sources */,
 				7CCE7EBF1A411A7E00447C4C /* ElementAtPointInWebFrame.mm in Sources */,
+				C13D82D92416F13200A62793 /* EnableAccessibility.mm in Sources */,
 				F4CF32802366552200D3AD07 /* EnterKeyHintTests.mm in Sources */,
 				07492B3B1DF8B14C00633DE1 /* EnumerateMediaDevices.cpp in Sources */,
 				448D7E471EA6C55500ECC756 /* EnvironmentUtilitiesTest.cpp in Sources */,

Added: branches/safari-610.1.7-branch/Tools/TestWebKitAPI/Tests/WebKit/EnableAccessibility.mm (0 => 258179)


--- branches/safari-610.1.7-branch/Tools/TestWebKitAPI/Tests/WebKit/EnableAccessibility.mm	                        (rev 0)
+++ branches/safari-610.1.7-branch/Tools/TestWebKitAPI/Tests/WebKit/EnableAccessibility.mm	2020-03-10 00:10:25 UTC (rev 258179)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#import "PlatformUtilities.h"
+#import "TestWKWebView.h"
+#import <WebKit/WKProcessPoolPrivate.h>
+#import <WebKit/_WKProcessPoolConfiguration.h>
+
+#import <wtf/SoftLinking.h>
+
+SOFT_LINK_LIBRARY(libAccessibility)
+SOFT_LINK_CONSTANT(libAccessibility, kAXSApplicationAccessibilityEnabledNotification, CFStringRef);
+
+TEST(WebKit, EnableAccessibilityCrash)
+{
+    {
+        auto poolConfiguration = adoptNS([[_WKProcessPoolConfiguration alloc] init]);
+        auto pool = adoptNS([[WKProcessPool alloc] _initWithConfiguration:poolConfiguration.get()]);
+        auto viewConfiguration = adoptNS([[WKWebViewConfiguration alloc] init]);
+        [viewConfiguration setProcessPool:pool.get()];
+    }
+
+    CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(),  getkAXSApplicationAccessibilityEnabledNotification(), NULL, NULL, false);
+}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to