Changeset 222663 in webkit


Ignore:
Timestamp:
Sep 29, 2017 1:50:13 PM (7 years ago)
Author:
achristensen@apple.com
Message:

Add WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit
https://bugs.webkit.org/show_bug.cgi?id=177644
<rdar://problem/34338698>

Reviewed by Geoffrey Garen.

WKPageConfigurationSetBackgroundCPULimit is a setter of a std::optional<double> with no accessor.
It's never set to 0 in practice, so I guess the ObjC equivalent is a double that is zero or nonzero.

  • UIProcess/API/Cocoa/WKWebView.mm:

(-[WKWebView _initializeWithConfiguration:]):

  • UIProcess/API/Cocoa/WKWebViewConfiguration.mm:

(-[WKWebViewConfiguration _setCPULimit:]):
(-[WKWebViewConfiguration _cpuLimit]):

  • UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
Location:
trunk/Source/WebKit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r222656 r222663  
     12017-09-28  Alex Christensen  <achristensen@webkit.org>
     2
     3        Add WKWebViewConfiguration SPI equivalent to WKPageConfigurationSetBackgroundCPULimit
     4        https://bugs.webkit.org/show_bug.cgi?id=177644
     5        <rdar://problem/34338698>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        WKPageConfigurationSetBackgroundCPULimit is a setter of a std::optional<double> with no accessor.
     10        It's never set to 0 in practice, so I guess the ObjC equivalent is a double that is zero or nonzero.
     11
     12        * UIProcess/API/Cocoa/WKWebView.mm:
     13        (-[WKWebView _initializeWithConfiguration:]):
     14        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
     15        (-[WKWebViewConfiguration _setCPULimit:]):
     16        (-[WKWebViewConfiguration _cpuLimit]):
     17        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
     18
    1192017-09-28  Ryosuke Niwa  <rniwa@webkit.org>
    220
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm

    r222456 r222663  
    471471
    472472#if PLATFORM(MAC)
     473    if (auto cpuLimit = [_configuration _cpuLimit])
     474        pageConfiguration->setCPULimit(cpuLimit);
    473475    pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::showsURLsInToolTipsEnabledKey(), WebKit::WebPreferencesStore::Value(!![_configuration _showsURLsInToolTips]));
    474476    pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::serviceControlsEnabledKey(), WebKit::WebPreferencesStore::Value(!![_configuration _serviceControlsEnabled]));
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm

    r219526 r222663  
    138138
    139139#if PLATFORM(MAC)
     140    double _cpuLimit;
    140141    BOOL _showsURLsInToolTips;
    141142    BOOL _serviceControlsEnabled;
     
    819820}
    820821
     822- (void)_setCPULimit:(double)cpuLimit
     823{
     824    _cpuLimit = cpuLimit;
     825}
     826
     827- (double)_cpuLimit
     828{
     829    return _cpuLimit;
     830}
     831
    821832#endif // PLATFORM(MAC)
    822833
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h

    r221930 r222663  
    7979@property (nonatomic, setter=_setImageControlsEnabled:) BOOL _imageControlsEnabled WK_API_AVAILABLE(macosx(10.12));
    8080@property (nonatomic, readwrite, setter=_setRequiresUserActionForEditingControlsManager:) BOOL _requiresUserActionForEditingControlsManager WK_API_AVAILABLE(macosx(10.12));
     81@property (nonatomic, readwrite, setter=_setCPULimit:) double _cpuLimit WK_API_AVAILABLE(WK_MAC_TBA);
    8182#endif
    8283
Note: See TracChangeset for help on using the changeset viewer.