Title: [254474] branches/safari-609-branch/Source/WebKit
Revision
254474
Author
[email protected]
Date
2020-01-13 17:10:01 -0800 (Mon, 13 Jan 2020)

Log Message

Cherry-pick r254101. rdar://problem/58535157

    [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:

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

Modified Paths

Diff

Modified: branches/safari-609-branch/Source/WebKit/ChangeLog (254473 => 254474)


--- branches/safari-609-branch/Source/WebKit/ChangeLog	2020-01-14 01:08:49 UTC (rev 254473)
+++ branches/safari-609-branch/Source/WebKit/ChangeLog	2020-01-14 01:10:01 UTC (rev 254474)
@@ -1,3 +1,46 @@
+2020-01-13  Alan Coon  <[email protected]>
+
+        Cherry-pick r254101. rdar://problem/58535157
+
+    [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:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-01-06  Per Arne Vollan  <[email protected]>
+
+            [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-03  Garrett Davidson  <[email protected]>
 
         IconLoadingClient::getLoadDecisionForIcon() leaks an Objective-C block

Modified: branches/safari-609-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (254473 => 254474)


--- branches/safari-609-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2020-01-14 01:08:49 UTC (rev 254473)
+++ branches/safari-609-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2020-01-14 01:10:01 UTC (rev 254474)
@@ -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
@@ -481,7 +481,7 @@
     return WTF::hasEntitlement(ensureNetworkProcess().connection()->xpcConnection(), entitlement.utf8().data());
 }
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS_FAMILY)
 float WebProcessPool::displayBrightness()
 {
     return BKSDisplayBrightnessGetCurrent();
@@ -540,12 +540,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: branches/safari-609-branch/Source/WebKit/UIProcess/WebProcessPool.cpp (254473 => 254474)


--- branches/safari-609-branch/Source/WebKit/UIProcess/WebProcessPool.cpp	2020-01-14 01:08:49 UTC (rev 254473)
+++ branches/safari-609-branch/Source/WebKit/UIProcess/WebProcessPool.cpp	2020-01-14 01:10:01 UTC (rev 254474)
@@ -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: branches/safari-609-branch/Source/WebKit/UIProcess/WebProcessPool.h (254473 => 254474)


--- branches/safari-609-branch/Source/WebKit/UIProcess/WebProcessPool.h	2020-01-14 01:08:49 UTC (rev 254473)
+++ branches/safari-609-branch/Source/WebKit/UIProcess/WebProcessPool.h	2020-01-14 01:10:01 UTC (rev 254474)
@@ -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: branches/safari-609-branch/Source/WebKit/WebProcess/WebProcess.h (254473 => 254474)


--- branches/safari-609-branch/Source/WebKit/WebProcess/WebProcess.h	2020-01-14 01:08:49 UTC (rev 254473)
+++ branches/safari-609-branch/Source/WebKit/WebProcess/WebProcess.h	2020-01-14 01:10:01 UTC (rev 254474)
@@ -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: branches/safari-609-branch/Source/WebKit/WebProcess/WebProcess.messages.in (254473 => 254474)


--- branches/safari-609-branch/Source/WebKit/WebProcess/WebProcess.messages.in	2020-01-14 01:08:49 UTC (rev 254473)
+++ branches/safari-609-branch/Source/WebKit/WebProcess/WebProcess.messages.in	2020-01-14 01:10:01 UTC (rev 254474)
@@ -125,7 +125,7 @@
 #endif
 #endif
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS_FAMILY)
     BacklightLevelDidChange(float backlightLevel)
 #endif
 

Modified: branches/safari-609-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (254473 => 254474)


--- branches/safari-609-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-01-14 01:08:49 UTC (rev 254473)
+++ branches/safari-609-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2020-01-14 01:10:01 UTC (rev 254474)
@@ -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)
@@ -812,7 +812,7 @@
 }
 #endif
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS_FAMILY)
 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