⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 237636 in webkit


Ignore:
Timestamp:
Oct 31, 2018, 8:08:26 AM (8 years ago)
Author:
Antti Koivisto
Message:

Remove LayerFlushScheduler
https://bugs.webkit.org/show_bug.cgi?id=191103

Reviewed by Anders Carlsson.

Source/WebCore:

It is only used in WK1.

  • SourcesCocoa.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • platform/graphics/ca/LayerFlushScheduler.cpp: Removed.
  • platform/graphics/ca/LayerFlushScheduler.h: Removed.
  • platform/graphics/ca/LayerFlushSchedulerClient.h: Removed.
  • platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Removed.

Source/WebKitLegacy/mac:

Add a RunLoopObserver directly into WebViewLayerFlushScheduler and remove
all the virtual cruft.

  • WebView/WebViewData.h:

(WebViewLayerFlushScheduler::~WebViewLayerFlushScheduler): Deleted.
(): Deleted.

  • WebView/WebViewData.mm:

(currentRunLoop):
(WebViewLayerFlushScheduler::WebViewLayerFlushScheduler):
(WebViewLayerFlushScheduler::~WebViewLayerFlushScheduler):
(WebViewLayerFlushScheduler::schedule):
(WebViewLayerFlushScheduler::invalidate):
(WebViewLayerFlushScheduler::layerFlushCallback):

Location:
trunk/Source
Files:
4 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r237635 r237636  
     12018-10-31  Antti Koivisto  <antti@apple.com>
     2
     3        Remove LayerFlushScheduler
     4        https://bugs.webkit.org/show_bug.cgi?id=191103
     5
     6        Reviewed by Anders Carlsson.
     7
     8        It is only used in WK1.
     9
     10        * SourcesCocoa.txt:
     11        * WebCore.xcodeproj/project.pbxproj:
     12        * platform/graphics/ca/LayerFlushScheduler.cpp: Removed.
     13        * platform/graphics/ca/LayerFlushScheduler.h: Removed.
     14        * platform/graphics/ca/LayerFlushSchedulerClient.h: Removed.
     15        * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Removed.
     16
    1172018-10-31  Zalan Bujtas  <zalan@apple.com>
    218
  • trunk/Source/WebCore/PlatformAppleWin.cmake

    r237579 r237636  
    9393
    9494        platform/graphics/ca/GraphicsLayerCA.cpp
    95         platform/graphics/ca/LayerFlushScheduler.cpp
    9695        platform/graphics/ca/LayerPool.cpp
    9796        platform/graphics/ca/PlatformCALayer.cpp
  • trunk/Source/WebCore/PlatformMac.cmake

    r235563 r237636  
    257257
    258258    platform/graphics/ca/GraphicsLayerCA.cpp
    259     platform/graphics/ca/LayerFlushScheduler.cpp
    260259    platform/graphics/ca/LayerPool.cpp
    261260    platform/graphics/ca/PlatformCAAnimation.cpp
     
    266265    platform/graphics/ca/TransformationMatrixCA.cpp
    267266
    268     platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp
    269267    platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm
    270268    platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm
  • trunk/Source/WebCore/SourcesCocoa.txt

    r237368 r237636  
    256256
    257257platform/graphics/ca/GraphicsLayerCA.cpp
    258 platform/graphics/ca/LayerFlushScheduler.cpp
    259258platform/graphics/ca/LayerPool.cpp
    260259platform/graphics/ca/PlatformCAAnimation.cpp
     
    264263platform/graphics/ca/TileGrid.cpp
    265264platform/graphics/ca/TransformationMatrixCA.cpp
    266 platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp
    267265platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm
    268266platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r237631 r237636  
    693693                285D32082035D6560070D32F /* ServerTimingParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 288E82F02035D4ED00B0DCFF /* ServerTimingParser.h */; };
    694694                2914E3081CAB5A440049966F /* AccessibilityAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 2914E3061CAB5A440049966F /* AccessibilityAttachment.h */; };
    695                 2917B5621473496C0052C9D0 /* LayerFlushScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 2917B55F1473496C0052C9D0 /* LayerFlushScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; };
    696                 2917B5631473496C0052C9D0 /* LayerFlushSchedulerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
    697695                293EAE1F1356B2FE0067ACF9 /* RuntimeApplicationChecks.h in Headers */ = {isa = PBXBuildFile; fileRef = 293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */; settings = {ATTRIBUTES = (Private, ); }; };
    698696                29489FC712C00F0300D83F0F /* AccessibilityScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */; };
     
    29382936                A14832C6187F668F00DA63A6 /* WKViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A14832AB187F508700DA63A6 /* WKViewPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
    29392937                A14832C7187F66C800DA63A6 /* WebCoreThread.h in Headers */ = {isa = PBXBuildFile; fileRef = A1483299187F508700DA63A6 /* WebCoreThread.h */; settings = {ATTRIBUTES = (Private, ); }; };
    2940                 A14832C9187F676B00DA63A6 /* WebCoreThreadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A148329B187F508700DA63A6 /* WebCoreThreadInternal.h */; };
     2938                A14832C9187F676B00DA63A6 /* WebCoreThreadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A148329B187F508700DA63A6 /* WebCoreThreadInternal.h */; settings = {ATTRIBUTES = (Private, ); }; };
    29412939                A14832CA187F678000DA63A6 /* WebCoreThreadMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = A148329C187F508700DA63A6 /* WebCoreThreadMessage.h */; settings = {ATTRIBUTES = (Private, ); }; };
    29422940                A14832CC187F67C400DA63A6 /* WebCoreThreadRun.h in Headers */ = {isa = PBXBuildFile; fileRef = A148329E187F508700DA63A6 /* WebCoreThreadRun.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    64996497                2914E3051CAB5A440049966F /* AccessibilityAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityAttachment.cpp; sourceTree = "<group>"; };
    65006498                2914E3061CAB5A440049966F /* AccessibilityAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityAttachment.h; sourceTree = "<group>"; };
    6501                 2917B55E1473496C0052C9D0 /* LayerFlushScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayerFlushScheduler.cpp; sourceTree = "<group>"; };
    6502                 2917B55F1473496C0052C9D0 /* LayerFlushScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerFlushScheduler.h; sourceTree = "<group>"; };
    6503                 2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerFlushSchedulerClient.h; sourceTree = "<group>"; };
    6504                 2917B565147349950052C9D0 /* LayerFlushSchedulerMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayerFlushSchedulerMac.cpp; sourceTree = "<group>"; };
    65056499                293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeApplicationChecks.h; sourceTree = "<group>"; };
    65066500                29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityScrollView.h; sourceTree = "<group>"; };
     
    1790217896                        isa = PBXGroup;
    1790317897                        children = (
    17904                                 2917B565147349950052C9D0 /* LayerFlushSchedulerMac.cpp */,
    1790517898                                0F5E200518E771FC003EC3E5 /* PlatformCAAnimationCocoa.h */,
    1790617899                                4958781F12A57DDF007238AC /* PlatformCAAnimationCocoa.mm */,
     
    1797717970                                499B3ED4128CD31400E726C2 /* GraphicsLayerCA.cpp */,
    1797817971                                499B3ED5128CD31400E726C2 /* GraphicsLayerCA.h */,
    17979                                 2917B55E1473496C0052C9D0 /* LayerFlushScheduler.cpp */,
    17980                                 2917B55F1473496C0052C9D0 /* LayerFlushScheduler.h */,
    17981                                 2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */,
    1798217972                                7AA3A69D194B59B6001CBD24 /* LayerPool.cpp */,
    1798317973                                7AA3A69E194B59B6001CBD24 /* LayerPool.h */,
     
    2979929789                                450CEBF115073BBE002BB149 /* LabelableElement.h in Headers */,
    2980029790                                A456FA2711AD4A830020B420 /* LabelsNodeList.h in Headers */,
    29801                                 2917B5621473496C0052C9D0 /* LayerFlushScheduler.h in Headers */,
    29802                                 2917B5631473496C0052C9D0 /* LayerFlushSchedulerClient.h in Headers */,
    2980329791                                E4916FF7195DF6A0005AB349 /* LayerFlushThrottleState.h in Headers */,
    2980429792                                580371641A66F1D300BAF519 /* LayerFragment.h in Headers */,
  • trunk/Source/WebCore/platform/RuntimeApplicationChecks.h

    r237266 r237636  
    8686WEBCORE_EXPORT bool isWebApp();
    8787WEBCORE_EXPORT bool isWebProcess();
    88 bool isIBooks();
     88WEBCORE_EXPORT bool isIBooks();
    8989bool isIBooksStorytime();
    9090WEBCORE_EXPORT bool isTheSecretSocietyHiddenMystery();
  • trunk/Source/WebCore/platform/ios/wak/WebCoreThreadInternal.h

    r212343 r237636  
    4343void WebThreadInitRunQueue();
    4444
    45 CFRunLoopRef WebThreadRunLoop(void);
     45WEBCORE_EXPORT CFRunLoopRef WebThreadRunLoop(void);
    4646WebThreadContext *WebThreadCurrentContext(void);
    4747
  • trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp

    r237281 r237636  
    3131#include "Logging.h"
    3232#include "RealtimeIncomingVideoSourceCocoa.h"
     33#include "RealtimeVideoUtilities.h"
    3334
    3435ALLOW_UNUSED_PARAMETERS_BEGIN
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r237610 r237636  
     12018-10-31  Antti Koivisto  <antti@apple.com>
     2
     3        Remove LayerFlushScheduler
     4        https://bugs.webkit.org/show_bug.cgi?id=191103
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Add a RunLoopObserver directly into WebViewLayerFlushScheduler and remove
     9        all the virtual cruft.
     10
     11        * WebView/WebViewData.h:
     12        (WebViewLayerFlushScheduler::~WebViewLayerFlushScheduler): Deleted.
     13        (): Deleted.
     14        * WebView/WebViewData.mm:
     15        (currentRunLoop):
     16        (WebViewLayerFlushScheduler::WebViewLayerFlushScheduler):
     17        (WebViewLayerFlushScheduler::~WebViewLayerFlushScheduler):
     18        (WebViewLayerFlushScheduler::schedule):
     19        (WebViewLayerFlushScheduler::invalidate):
     20        (WebViewLayerFlushScheduler::layerFlushCallback):
     21
    1222018-10-30  Alexey Proskuryakov  <ap@apple.com>
    223
  • trunk/Source/WebKitLegacy/mac/WebView/WebViewData.h

    r237266 r237636  
    3535#endif
    3636#import <WebCore/AlternativeTextClient.h>
    37 #import <WebCore/LayerFlushScheduler.h>
    38 #import <WebCore/LayerFlushSchedulerClient.h>
    3937#import <WebCore/WebCoreKeyboardUIMode.h>
    4038#import <wtf/HashMap.h>
     
    5250class HistoryItem;
    5351class Page;
     52class RunLoopObserver;
    5453class TextIndicatorWindow;
    5554class ValidationBubble;
     
    110109#endif
    111110
    112 class WebViewLayerFlushScheduler : public WebCore::LayerFlushScheduler {
     111class WebViewLayerFlushScheduler {
    113112public:
    114113    WebViewLayerFlushScheduler(LayerFlushController*);
    115     virtual ~WebViewLayerFlushScheduler() { }
     114    ~WebViewLayerFlushScheduler();
     115
     116    void schedule();
     117    void invalidate();
    116118
    117119private:
    118     void layerFlushCallback() override
    119     {
    120         RefPtr<LayerFlushController> protector = m_flushController;
    121         WebCore::LayerFlushScheduler::layerFlushCallback();
    122     }
     120    void layerFlushCallback();
    123121   
    124122    LayerFlushController* m_flushController;
     123    std::unique_ptr<WebCore::RunLoopObserver> m_runLoopObserver;
    125124};
    126125
    127 class LayerFlushController : public RefCounted<LayerFlushController>, public WebCore::LayerFlushSchedulerClient {
     126class LayerFlushController : public RefCounted<LayerFlushController> {
    128127public:
    129128    static Ref<LayerFlushController> create(WebView* webView)
     
    132131    }
    133132   
    134     virtual bool flushLayers();
     133    bool flushLayers();
    135134   
    136135    void scheduleLayerFlush();
  • trunk/Source/WebKitLegacy/mac/WebView/WebViewData.mm

    r237266 r237636  
    3838#import <WebCore/AlternativeTextUIController.h>
    3939#import <WebCore/HistoryItem.h>
     40#import <WebCore/RunLoopObserver.h>
    4041#import <WebCore/TextIndicatorWindow.h>
    4142#import <WebCore/ValidationBubble.h>
     
    4546#if PLATFORM(IOS_FAMILY)
    4647#import "WebGeolocationProviderIOS.h"
     48#import <WebCore/RuntimeApplicationChecks.h>
     49#import <WebCore/WebCoreThreadInternal.h>
    4750#endif
    4851
     
    5962int pluginDatabaseClientCount = 0;
    6063
     64static CFRunLoopRef currentRunLoop()
     65{
     66#if PLATFORM(IOS_FAMILY)
     67    // A race condition during WebView deallocation can lead to a crash if the layer sync run loop
     68    // observer is added to the main run loop <rdar://problem/9798550>. However, for responsiveness,
     69    // we still allow this, see <rdar://problem/7403328>. Since the race condition and subsequent
     70    // crash are especially troublesome for iBooks, we never allow the observer to be added to the
     71    // main run loop in iBooks.
     72    if (WebCore::IOSApplication::isIBooks())
     73        return WebThreadRunLoop();
     74#endif
     75    return CFRunLoopGetCurrent();
     76}
     77
    6178void LayerFlushController::scheduleLayerFlush()
    6279{
     
    7895
    7996WebViewLayerFlushScheduler::WebViewLayerFlushScheduler(LayerFlushController* flushController)
    80     : WebCore::LayerFlushScheduler(flushController)
    81     , m_flushController(flushController)
    82 {
     97    : m_flushController(flushController)
     98{
     99    m_runLoopObserver = std::make_unique<WebCore::RunLoopObserver>(static_cast<CFIndex>(WebCore::RunLoopObserver::WellKnownRunLoopOrders::LayerFlush), [this]() {
     100        this->layerFlushCallback();
     101    });
     102}
     103
     104WebViewLayerFlushScheduler::~WebViewLayerFlushScheduler()
     105{
     106}
     107
     108void WebViewLayerFlushScheduler::schedule()
     109{
     110    m_runLoopObserver->schedule(currentRunLoop());
     111}
     112
     113void WebViewLayerFlushScheduler::invalidate()
     114{
     115    m_runLoopObserver->invalidate();
     116}
     117
     118void WebViewLayerFlushScheduler::layerFlushCallback()
     119{
     120    @autoreleasepool {
     121        RefPtr<LayerFlushController> protector = m_flushController;
     122        if (m_flushController->flushLayers())
     123            invalidate();
     124    }
    83125}
    84126
Note: See TracChangeset for help on using the changeset viewer.