Changeset 254101 in webkit


Ignore:
Timestamp:
Jan 6, 2020 5:06:34 PM (4 years ago)
Author:
pvollan@apple.com
Message:

[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:
Location:
trunk/Source/WebKit
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r254098 r254101  
     12020-01-06  Per Arne Vollan  <pvollan@apple.com>
     2
     3        [iOS] Get display level in the UI process for all iOS platforms
     4        https://bugs.webkit.org/show_bug.cgi?id=205835
     5        <rdar://problem/58116883>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        This was previously only done for iOS, but should be done for all iOS platforms.
     10
     11        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
     12        (WebKit::WebProcessPool::registerNotificationObservers):
     13        * UIProcess/WebProcessPool.cpp:
     14        (WebKit::WebProcessPool::initializeNewWebProcess):
     15        * UIProcess/WebProcessPool.h:
     16        * WebProcess/WebProcess.h:
     17        * WebProcess/WebProcess.messages.in:
     18        * WebProcess/cocoa/WebProcessCocoa.mm:
     19
    1202020-01-06  Eric Carlson  <eric.carlson@apple.com>
    221
  • trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm

    r254081 r254101  
    103103#endif
    104104
    105 #if PLATFORM(IOS)
     105#if PLATFORM(IOS_FAMILY)
    106106SOFT_LINK_PRIVATE_FRAMEWORK(BackBoardServices)
    107107SOFT_LINK(BackBoardServices, BKSDisplayBrightnessGetCurrent, float, (), ());
     
    483483}
    484484
    485 #if PLATFORM(IOS)
     485#if PLATFORM(IOS_FAMILY)
    486486float WebProcessPool::displayBrightness()
    487487{
     
    542542        setApplicationIsActive(false);
    543543    }];
    544 #elif PLATFORM(IOS)
     544#else
    545545    CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), this, backlightLevelDidChangeCallback, static_cast<CFStringRef>(UIBacklightLevelChangedNotification), nullptr, CFNotificationSuspensionBehaviorCoalesce);
     546#if PLATFORM(IOS)
    546547    m_accessibilityEnabledObserver = [[NSNotificationCenter defaultCenter] addObserverForName:(__bridge id)kAXSApplicationAccessibilityEnabledNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *) {
    547548        for (size_t i = 0; i < m_processes.size(); ++i)
    548549            m_processes[i]->unblockAccessibilityServerIfNeeded();
    549550    }];
     551#endif // PLATFORM(IOS)
    550552#endif // !PLATFORM(IOS_FAMILY)
    551553}
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r254006 r254101  
    10631063    }
    10641064
    1065 #if PLATFORM(IOS)
     1065#if PLATFORM(IOS_FAMILY)
    10661066    process.send(Messages::WebProcess::BacklightLevelDidChange(displayBrightness()), 0);
    10671067#endif
  • trunk/Source/WebKit/UIProcess/WebProcessPool.h

    r254006 r254101  
    606606    void updateBackForwardCacheCapacity();
    607607
    608 #if PLATFORM(IOS)
     608#if PLATFORM(IOS_FAMILY)
    609609    static float displayBrightness();
    610610    static void backlightLevelDidChangeCallback(CFNotificationCenterRef, void *observer, CFStringRef name, const void *, CFDictionaryRef userInfo);   
  • trunk/Source/WebKit/WebProcess/WebProcess.h

    r253990 r254101  
    289289#endif
    290290
    291 #if PLATFORM(IOS)
     291#if PLATFORM(IOS_FAMILY)
    292292    float backlightLevel() const { return m_backlightLevel; }
    293293#endif
     
    462462#endif
    463463
    464 #if PLATFORM(IOS)
     464#if PLATFORM(IOS_FAMILY)
    465465    void backlightLevelDidChange(float backlightLevel);
    466 #endif
    467 
    468 #if PLATFORM(IOS_FAMILY)
     466
    469467    bool shouldFreezeOnSuspension() const;
    470468    void updateFreezerStatus();
     
    594592#endif
    595593
    596 #if PLATFORM(IOS)
     594#if PLATFORM(IOS_FAMILY)
    597595    float m_backlightLevel { 0 };
    598596#endif
  • trunk/Source/WebKit/WebProcess/WebProcess.messages.in

    r252655 r254101  
    126126#endif
    127127
    128 #if PLATFORM(IOS)
     128#if PLATFORM(IOS_FAMILY)
    129129    BacklightLevelDidChange(float backlightLevel)
    130130#endif
  • trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

    r254087 r254101  
    8181
    8282#if PLATFORM(IOS)
     83#import <WebCore/ParentalControlsContentFilter.h>
     84#endif
     85
     86#if PLATFORM(IOS_FAMILY)
    8387#import "UIKitSPI.h"
    84 #import <WebCore/ParentalControlsContentFilter.h>
    85 #endif
    86 
    87 #if PLATFORM(IOS_FAMILY)
    88 #include <bmalloc/MemoryStatusSPI.h>
     88#import <bmalloc/MemoryStatusSPI.h>
    8989#endif
    9090
     
    816816#endif
    817817
    818 #if PLATFORM(IOS)
     818#if PLATFORM(IOS_FAMILY)
    819819static float currentBacklightLevel()
    820820{
Note: See TracChangeset for help on using the changeset viewer.