- Revision
- 254763
- Author
- [email protected]
- Date
- 2020-01-17 13:10:54 -0800 (Fri, 17 Jan 2020)
Log Message
Cherry-pick r254433. rdar://problem/58686757
[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:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-609-branch/Source/WebKit/ChangeLog (254762 => 254763)
--- branches/safari-609-branch/Source/WebKit/ChangeLog 2020-01-17 21:06:55 UTC (rev 254762)
+++ branches/safari-609-branch/Source/WebKit/ChangeLog 2020-01-17 21:10:54 UTC (rev 254763)
@@ -1,3 +1,49 @@
+2020-01-17 Alan Coon <[email protected]>
+
+ Cherry-pick r254433. rdar://problem/58686757
+
+ [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:
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 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-15 Alan Coon <[email protected]>
Cherry-pick r254187. rdar://problem/58605950
Modified: branches/safari-609-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (254762 => 254763)
--- branches/safari-609-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2020-01-17 21:06:55 UTC (rev 254762)
+++ branches/safari-609-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2020-01-17 21:10:54 UTC (rev 254763)
@@ -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
@@ -481,7 +481,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();
@@ -540,7 +540,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: branches/safari-609-branch/Source/WebKit/UIProcess/WebProcessPool.cpp (254762 => 254763)
--- branches/safari-609-branch/Source/WebKit/UIProcess/WebProcessPool.cpp 2020-01-17 21:06:55 UTC (rev 254762)
+++ branches/safari-609-branch/Source/WebKit/UIProcess/WebProcessPool.cpp 2020-01-17 21:10:54 UTC (rev 254763)
@@ -1062,7 +1062,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: branches/safari-609-branch/Source/WebKit/UIProcess/WebProcessPool.h (254762 => 254763)
--- branches/safari-609-branch/Source/WebKit/UIProcess/WebProcessPool.h 2020-01-17 21:06:55 UTC (rev 254762)
+++ branches/safari-609-branch/Source/WebKit/UIProcess/WebProcessPool.h 2020-01-17 21:10:54 UTC (rev 254763)
@@ -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: branches/safari-609-branch/Source/WebKit/WebProcess/WebProcess.h (254762 => 254763)
--- branches/safari-609-branch/Source/WebKit/WebProcess/WebProcess.h 2020-01-17 21:06:55 UTC (rev 254762)
+++ branches/safari-609-branch/Source/WebKit/WebProcess/WebProcess.h 2020-01-17 21:10:54 UTC (rev 254763)
@@ -288,7 +288,7 @@
void unblockAccessibilityServer(const SandboxExtension::Handle&);
#endif
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
float backlightLevel() const { return m_backlightLevel; }
#endif
@@ -461,9 +461,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
@@ -591,7 +593,7 @@
HashMap<String, RefPtr<SandboxExtension>> m_mediaCaptureSandboxExtensions;
#endif
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
float m_backlightLevel { 0 };
#endif
Modified: branches/safari-609-branch/Source/WebKit/WebProcess/WebProcess.messages.in (254762 => 254763)
--- branches/safari-609-branch/Source/WebKit/WebProcess/WebProcess.messages.in 2020-01-17 21:06:55 UTC (rev 254762)
+++ branches/safari-609-branch/Source/WebKit/WebProcess/WebProcess.messages.in 2020-01-17 21:10:54 UTC (rev 254763)
@@ -125,7 +125,7 @@
#endif
#endif
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
BacklightLevelDidChange(float backlightLevel)
#endif
Modified: branches/safari-609-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (254762 => 254763)
--- branches/safari-609-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2020-01-17 21:06:55 UTC (rev 254762)
+++ branches/safari-609-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2020-01-17 21:10:54 UTC (rev 254763)
@@ -812,7 +812,7 @@
}
#endif
-#if PLATFORM(IOS_FAMILY)
+#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
static float currentBacklightLevel()
{
return WebProcess::singleton().backlightLevel();