Changeset 254522 in webkit


Ignore:
Timestamp:
Jan 14, 2020 11:37:23 AM (4 years ago)
Author:
Alan Coon
Message:

Cherry-pick r254433. rdar://problem/58554516

[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

Location:
branches/safari-610.1.1-branch/Source/WebKit
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-610.1.1-branch/Source/WebKit/ChangeLog

    r254521 r254522  
     12020-01-14  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r254433. rdar://problem/58554516
     4
     5    [macCatalyst] UI process crashes on launch after r254101
     6    https://bugs.webkit.org/show_bug.cgi?id=206156
     7    <rdar://problem/58514942>
     8   
     9    Reviewed by Brent Fulgham.
     10   
     11    Fixes the crash by not soft-linking BackBoardServices in an attempt to invoke BKSDisplayBrightnessGetCurrent on
     12    macCatalyst. Prior to r254101, this was only defined on iOS and not watchOS or tvOS; after this change, it
     13    should be defined only on iOS, watchOS and tvOS.
     14   
     15    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
     16    (WebKit::WebProcessPool::registerNotificationObservers):
     17    * UIProcess/WebProcessPool.cpp:
     18    (WebKit::WebProcessPool::initializeNewWebProcess):
     19    * UIProcess/WebProcessPool.h:
     20    * WebProcess/WebProcess.h:
     21    * WebProcess/WebProcess.messages.in:
     22    * WebProcess/cocoa/WebProcessCocoa.mm:
     23   
     24    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     25
     26    2020-01-12  Wenson Hsieh  <wenson_hsieh@apple.com>
     27
     28            [macCatalyst] UI process crashes on launch after r254101
     29            https://bugs.webkit.org/show_bug.cgi?id=206156
     30            <rdar://problem/58514942>
     31
     32            Reviewed by Brent Fulgham.
     33
     34            Fixes the crash by not soft-linking BackBoardServices in an attempt to invoke BKSDisplayBrightnessGetCurrent on
     35            macCatalyst. Prior to r254101, this was only defined on iOS and not watchOS or tvOS; after this change, it
     36            should be defined only on iOS, watchOS and tvOS.
     37
     38            * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
     39            (WebKit::WebProcessPool::registerNotificationObservers):
     40            * UIProcess/WebProcessPool.cpp:
     41            (WebKit::WebProcessPool::initializeNewWebProcess):
     42            * UIProcess/WebProcessPool.h:
     43            * WebProcess/WebProcess.h:
     44            * WebProcess/WebProcess.messages.in:
     45            * WebProcess/cocoa/WebProcessCocoa.mm:
     46
    1472020-01-14  Kocsen Chung  <kocsen_chung@apple.com>
    248
  • branches/safari-610.1.1-branch/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm

    r254397 r254522  
    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)
  • branches/safari-610.1.1-branch/Source/WebKit/UIProcess/WebProcessPool.cpp

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

    r254101 r254522  
    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);   
  • branches/safari-610.1.1-branch/Source/WebKit/WebProcess/WebProcess.h

    r254210 r254522  
    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
  • branches/safari-610.1.1-branch/Source/WebKit/WebProcess/WebProcess.messages.in

    r254101 r254522  
    126126#endif
    127127
    128 #if PLATFORM(IOS_FAMILY)
     128#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
    129129    BacklightLevelDidChange(float backlightLevel)
    130130#endif
  • branches/safari-610.1.1-branch/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm

    r254373 r254522  
    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.