Changeset 254433 in webkit


Ignore:
Timestamp:
Jan 13, 2020 9:14:25 AM (4 years ago)
Author:
Wenson Hsieh
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:
Location:
trunk/Source/WebKit
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r254428 r254433  
     12020-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [macCatalyst] UI process crashes on launch after r254101
     4        https://bugs.webkit.org/show_bug.cgi?id=206156
     5        <rdar://problem/58514942>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Fixes the crash by not soft-linking BackBoardServices in an attempt to invoke BKSDisplayBrightnessGetCurrent on
     10        macCatalyst. Prior to r254101, this was only defined on iOS and not watchOS or tvOS; after this change, it
     11        should be defined only on iOS, watchOS and tvOS.
     12
     13        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
     14        (WebKit::WebProcessPool::registerNotificationObservers):
     15        * UIProcess/WebProcessPool.cpp:
     16        (WebKit::WebProcessPool::initializeNewWebProcess):
     17        * UIProcess/WebProcessPool.h:
     18        * WebProcess/WebProcess.h:
     19        * WebProcess/WebProcess.messages.in:
     20        * WebProcess/cocoa/WebProcessCocoa.mm:
     21
    1222020-01-13  Antti Koivisto  <antti@apple.com>
    223
  • trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm

    r254397 r254433  
    103103#endif
    104104
    105 #if PLATFORM(IOS_FAMILY)
     105#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
    106106SOFT_LINK_PRIVATE_FRAMEWORK(BackBoardServices)
    107107SOFT_LINK(BackBoardServices, BKSDisplayBrightnessGetCurrent, float, (), ());
     
    492492}
    493493
    494 #if PLATFORM(IOS_FAMILY)
     494#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
    495495float WebProcessPool::displayBrightness()
    496496{
     
    551551        setApplicationIsActive(false);
    552552    }];
    553 #else
     553#elif !PLATFORM(MACCATALYST)
    554554    CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), this, backlightLevelDidChangeCallback, static_cast<CFStringRef>(UIBacklightLevelChangedNotification), nullptr, CFNotificationSuspensionBehaviorCoalesce);
    555555#if PLATFORM(IOS)
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r254293 r254433  
    10561056    }
    10571057
    1058 #if PLATFORM(IOS_FAMILY)
     1058#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
    10591059    process.send(Messages::WebProcess::BacklightLevelDidChange(displayBrightness()), 0);
    10601060#endif
  • trunk/Source/WebKit/UIProcess/WebProcessPool.h

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

    r254210 r254433  
    288288#endif
    289289
    290 #if PLATFORM(IOS_FAMILY)
     290#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
    291291    float backlightLevel() const { return m_backlightLevel; }
    292292#endif
     
    461461#endif
    462462
     463#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
     464    void backlightLevelDidChange(float backlightLevel);
     465#endif
     466
    463467#if PLATFORM(IOS_FAMILY)
    464     void backlightLevelDidChange(float backlightLevel);
    465 
    466468    bool shouldFreezeOnSuspension() const;
    467469    void updateFreezerStatus();
     
    590592#endif
    591593
    592 #if PLATFORM(IOS_FAMILY)
     594#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
    593595    float m_backlightLevel { 0 };
    594596#endif
  • trunk/Source/WebKit/WebProcess/WebProcess.messages.in

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

    r254373 r254433  
    820820#endif
    821821
    822 #if PLATFORM(IOS_FAMILY)
     822#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
    823823static float currentBacklightLevel()
    824824{
Note: See TracChangeset for help on using the changeset viewer.