Diff
Modified: trunk/Source/WebKit/ChangeLog (254100 => 254101)
--- trunk/Source/WebKit/ChangeLog 2020-01-07 00:52:56 UTC (rev 254100)
+++ trunk/Source/WebKit/ChangeLog 2020-01-07 01:06:34 UTC (rev 254101)
@@ -1,3 +1,22 @@
+2020-01-06 Per Arne Vollan <pvol...@apple.com>
+
+ [iOS] Get display level in the UI process for all iOS platforms
+ https://bugs.webkit.org/show_bug.cgi?id=205835
+ <rdar://problem/58116883>
+
+ Reviewed by Brent Fulgham.
+
+ This was previously only done for iOS, but should be done for all iOS platforms.
+
+ * 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-06 Eric Carlson <eric.carl...@apple.com>
Add some of the remote media player messages needed for video playback
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (254100 => 254101)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2020-01-07 00:52:56 UTC (rev 254100)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2020-01-07 01:06:34 UTC (rev 254101)
@@ -102,7 +102,7 @@
static NSString * const WebKitLogCookieInformationDefaultsKey = @"WebKitLogCookieInformation";
#endif
-#if PLATFORM(IOS)
+#if PLATFORM(IOS_FAMILY)
SOFT_LINK_PRIVATE_FRAMEWORK(BackBoardServices)
SOFT_LINK(BackBoardServices, BKSDisplayBrightnessGetCurrent, float, (), ());
#endif
@@ -482,7 +482,7 @@
return WTF::hasEntitlement(ensureNetworkProcess().connection()->xpcConnection(), entitlement.utf8().data());
}
-#if PLATFORM(IOS)
+#if PLATFORM(IOS_FAMILY)
float WebProcessPool::displayBrightness()
{
return BKSDisplayBrightnessGetCurrent();
@@ -541,12 +541,14 @@
m_deactivationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidResignActiveNotification object:NSApp queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) {
setApplicationIsActive(false);
}];
-#elif PLATFORM(IOS)
+#else
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 *) {
for (size_t i = 0; i < m_processes.size(); ++i)
m_processes[i]->unblockAccessibilityServerIfNeeded();
}];
+#endif // PLATFORM(IOS)
#endif // !PLATFORM(IOS_FAMILY)
}
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (254100 => 254101)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2020-01-07 00:52:56 UTC (rev 254100)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2020-01-07 01:06:34 UTC (rev 254101)
@@ -1062,7 +1062,7 @@
process.send(Messages::WebProcess::PrewarmGlobally(), 0);
}
-#if PLATFORM(IOS)
+#if PLATFORM(IOS_FAMILY)
process.send(Messages::WebProcess::BacklightLevelDidChange(displayBrightness()), 0);
#endif
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.h (254100 => 254101)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.h 2020-01-07 00:52:56 UTC (rev 254100)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.h 2020-01-07 01:06:34 UTC (rev 254101)
@@ -605,7 +605,7 @@
void updateBackForwardCacheCapacity();
-#if PLATFORM(IOS)
+#if PLATFORM(IOS_FAMILY)
static float displayBrightness();
static void backlightLevelDidChangeCallback(CFNotificationCenterRef, void *observer, CFStringRef name, const void *, CFDictionaryRef userInfo);
#endif
Modified: trunk/Source/WebKit/WebProcess/WebProcess.h (254100 => 254101)
--- trunk/Source/WebKit/WebProcess/WebProcess.h 2020-01-07 00:52:56 UTC (rev 254100)
+++ trunk/Source/WebKit/WebProcess/WebProcess.h 2020-01-07 01:06:34 UTC (rev 254101)
@@ -288,7 +288,7 @@
void unblockAccessibilityServer(const SandboxExtension::Handle&);
#endif
-#if PLATFORM(IOS)
+#if PLATFORM(IOS_FAMILY)
float backlightLevel() const { return m_backlightLevel; }
#endif
@@ -461,11 +461,9 @@
void updateProcessName();
#endif
-#if PLATFORM(IOS)
+#if PLATFORM(IOS_FAMILY)
void backlightLevelDidChange(float backlightLevel);
-#endif
-#if PLATFORM(IOS_FAMILY)
bool shouldFreezeOnSuspension() const;
void updateFreezerStatus();
#endif
@@ -593,7 +591,7 @@
HashMap<String, RefPtr<SandboxExtension>> m_mediaCaptureSandboxExtensions;
#endif
-#if PLATFORM(IOS)
+#if PLATFORM(IOS_FAMILY)
float m_backlightLevel { 0 };
#endif
Modified: trunk/Source/WebKit/WebProcess/WebProcess.messages.in (254100 => 254101)
--- trunk/Source/WebKit/WebProcess/WebProcess.messages.in 2020-01-07 00:52:56 UTC (rev 254100)
+++ trunk/Source/WebKit/WebProcess/WebProcess.messages.in 2020-01-07 01:06:34 UTC (rev 254101)
@@ -125,7 +125,7 @@
#endif
#endif
-#if PLATFORM(IOS)
+#if PLATFORM(IOS_FAMILY)
BacklightLevelDidChange(float backlightLevel)
#endif
Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (254100 => 254101)
--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2020-01-07 00:52:56 UTC (rev 254100)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2020-01-07 01:06:34 UTC (rev 254101)
@@ -80,12 +80,12 @@
#import <wtf/cocoa/NSURLExtras.h>
#if PLATFORM(IOS)
-#import "UIKitSPI.h"
#import <WebCore/ParentalControlsContentFilter.h>
#endif
#if PLATFORM(IOS_FAMILY)
-#include <bmalloc/MemoryStatusSPI.h>
+#import "UIKitSPI.h"
+#import <bmalloc/MemoryStatusSPI.h>
#endif
#if PLATFORM(IOS_FAMILY)
@@ -815,7 +815,7 @@
}
#endif
-#if PLATFORM(IOS)
+#if PLATFORM(IOS_FAMILY)
static float currentBacklightLevel()
{
return WebProcess::singleton().backlightLevel();