Title: [254433] trunk/Source/WebKit
Revision
254433
Author
[email protected]
Date
2020-01-13 09:14:25 -0800 (Mon, 13 Jan 2020)

Log Message

[macCatalyst] UI process crashes on launch after r254101
https://bugs.webkit.org/show_bug.cgi?id=206156
<rdar://problem/58514942>

Reviewed by Brent Fulgham.

Fixes the crash by not soft-linking BackBoardServices in an attempt to invoke BKSDisplayBrightnessGetCurrent on
macCatalyst. Prior to r254101, this was only defined on iOS and not watchOS or tvOS; after this change, it
should be defined only on iOS, watchOS and tvOS.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::registerNotificationObservers):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (254432 => 254433)


--- trunk/Source/WebKit/ChangeLog	2020-01-13 17:06:25 UTC (rev 254432)
+++ trunk/Source/WebKit/ChangeLog	2020-01-13 17:14:25 UTC (rev 254433)
@@ -1,3 +1,24 @@
+2020-01-12  Wenson Hsieh  <[email protected]>
+
+        [macCatalyst] UI process crashes on launch after r254101
+        https://bugs.webkit.org/show_bug.cgi?id=206156
+        <rdar://problem/58514942>
+
+        Reviewed by Brent Fulgham.
+
+        Fixes the crash by not soft-linking BackBoardServices in an attempt to invoke BKSDisplayBrightnessGetCurrent on
+        macCatalyst. Prior to r254101, this was only defined on iOS and not watchOS or tvOS; after this change, it
+        should be defined only on iOS, watchOS and tvOS.
+
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::registerNotificationObservers):
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::initializeNewWebProcess):
+        * UIProcess/WebProcessPool.h:
+        * WebProcess/WebProcess.h:
+        * WebProcess/WebProcess.messages.in:
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+
 2020-01-13  Antti Koivisto  <[email protected]>
 
         [LFC][Integration] Enable LFC integration

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (254432 => 254433)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2020-01-13 17:06:25 UTC (rev 254432)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2020-01-13 17:14:25 UTC (rev 254433)
@@ -102,7 +102,7 @@
 static NSString * const WebKitLogCookieInformationDefaultsKey = @"WebKitLogCookieInformation";
 #endif
 
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
 SOFT_LINK_PRIVATE_FRAMEWORK(BackBoardServices)
 SOFT_LINK(BackBoardServices, BKSDisplayBrightnessGetCurrent, float, (), ());
 #endif
@@ -491,7 +491,7 @@
     return WTF::hasEntitlement(ensureNetworkProcess().connection()->xpcConnection(), entitlement.utf8().data());
 }
 
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
 float WebProcessPool::displayBrightness()
 {
     return BKSDisplayBrightnessGetCurrent();
@@ -550,7 +550,7 @@
     m_deactivationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidResignActiveNotification object:NSApp queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) {
         setApplicationIsActive(false);
     }];
-#else
+#elif !PLATFORM(MACCATALYST)
     CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), this, backlightLevelDidChangeCallback, static_cast<CFStringRef>(UIBacklightLevelChangedNotification), nullptr, CFNotificationSuspensionBehaviorCoalesce);
 #if PLATFORM(IOS)
     m_accessibilityEnabledObserver = [[NSNotificationCenter defaultCenter] addObserverForName:(__bridge id)kAXSApplicationAccessibilityEnabledNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *) {

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (254432 => 254433)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2020-01-13 17:06:25 UTC (rev 254432)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp	2020-01-13 17:14:25 UTC (rev 254433)
@@ -1055,7 +1055,7 @@
         process.send(Messages::WebProcess::PrewarmGlobally(), 0);
     }
 
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
     process.send(Messages::WebProcess::BacklightLevelDidChange(displayBrightness()), 0);
 #endif
 

Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (254432 => 254433)


--- trunk/Source/WebKit/UIProcess/WebProcessPool.h	2020-01-13 17:06:25 UTC (rev 254432)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h	2020-01-13 17:14:25 UTC (rev 254433)
@@ -605,7 +605,7 @@
 
     void updateBackForwardCacheCapacity();
 
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
     static float displayBrightness();
     static void backlightLevelDidChangeCallback(CFNotificationCenterRef, void *observer, CFStringRef name, const void *, CFDictionaryRef userInfo);    
 #endif

Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (254432 => 254433)


--- trunk/Source/WebKit/WebProcess/WebProcess.h	2020-01-13 17:06:25 UTC (rev 254432)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h	2020-01-13 17:14:25 UTC (rev 254433)
@@ -287,7 +287,7 @@
     void unblockAccessibilityServer(const SandboxExtension::Handle&);
 #endif
 
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
     float backlightLevel() const { return m_backlightLevel; }
 #endif
 
@@ -460,9 +460,11 @@
     void updateProcessName();
 #endif
 
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
     void backlightLevelDidChange(float backlightLevel);
+#endif
 
+#if PLATFORM(IOS_FAMILY)
     bool shouldFreezeOnSuspension() const;
     void updateFreezerStatus();
 #endif
@@ -589,7 +591,7 @@
     HashMap<String, RefPtr<SandboxExtension>> m_mediaCaptureSandboxExtensions;
 #endif
 
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
     float m_backlightLevel { 0 };
 #endif
 

Modified: trunk/Source/WebKit/WebProcess/WebProcess.messages.in (254432 => 254433)


--- trunk/Source/WebKit/WebProcess/WebProcess.messages.in	2020-01-13 17:06:25 UTC (rev 254432)
+++ trunk/Source/WebKit/WebProcess/WebProcess.messages.in	2020-01-13 17:14:25 UTC (rev 254433)
@@ -125,7 +125,7 @@
 #endif
 #endif
 
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
     BacklightLevelDidChange(float backlightLevel)
 #endif
 

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (254432 => 254433)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-01-13 17:06:25 UTC (rev 254432)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-01-13 17:14:25 UTC (rev 254433)
@@ -819,7 +819,7 @@
 }
 #endif
 
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
 static float currentBacklightLevel()
 {
     return WebProcess::singleton().backlightLevel();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to