Title: [237636] trunk/Source
Revision
237636
Author
an...@apple.com
Date
2018-10-31 08:08:26 -0700 (Wed, 31 Oct 2018)

Log 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):

Modified Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (237635 => 237636)


--- trunk/Source/WebCore/ChangeLog	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebCore/ChangeLog	2018-10-31 15:08:26 UTC (rev 237636)
@@ -1,3 +1,19 @@
+2018-10-31  Antti Koivisto  <an...@apple.com>
+
+        Remove LayerFlushScheduler
+        https://bugs.webkit.org/show_bug.cgi?id=191103
+
+        Reviewed by Anders Carlsson.
+
+        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.
+
 2018-10-31  Zalan Bujtas  <za...@apple.com>
 
         Missing from r237634

Modified: trunk/Source/WebCore/PlatformAppleWin.cmake (237635 => 237636)


--- trunk/Source/WebCore/PlatformAppleWin.cmake	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebCore/PlatformAppleWin.cmake	2018-10-31 15:08:26 UTC (rev 237636)
@@ -92,7 +92,6 @@
         page/win/FrameCGWin.cpp
 
         platform/graphics/ca/GraphicsLayerCA.cpp
-        platform/graphics/ca/LayerFlushScheduler.cpp
         platform/graphics/ca/LayerPool.cpp
         platform/graphics/ca/PlatformCALayer.cpp
         platform/graphics/ca/TileController.cpp

Modified: trunk/Source/WebCore/PlatformMac.cmake (237635 => 237636)


--- trunk/Source/WebCore/PlatformMac.cmake	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebCore/PlatformMac.cmake	2018-10-31 15:08:26 UTC (rev 237636)
@@ -256,7 +256,6 @@
     platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm
 
     platform/graphics/ca/GraphicsLayerCA.cpp
-    platform/graphics/ca/LayerFlushScheduler.cpp
     platform/graphics/ca/LayerPool.cpp
     platform/graphics/ca/PlatformCAAnimation.cpp
     platform/graphics/ca/PlatformCALayer.cpp
@@ -265,7 +264,6 @@
     platform/graphics/ca/TileGrid.cpp
     platform/graphics/ca/TransformationMatrixCA.cpp
 
-    platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp
     platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm
     platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm
     platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm

Modified: trunk/Source/WebCore/SourcesCocoa.txt (237635 => 237636)


--- trunk/Source/WebCore/SourcesCocoa.txt	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebCore/SourcesCocoa.txt	2018-10-31 15:08:26 UTC (rev 237636)
@@ -255,7 +255,6 @@
 platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm @no-unify
 
 platform/graphics/ca/GraphicsLayerCA.cpp
-platform/graphics/ca/LayerFlushScheduler.cpp
 platform/graphics/ca/LayerPool.cpp
 platform/graphics/ca/PlatformCAAnimation.cpp
 platform/graphics/ca/PlatformCALayer.cpp
@@ -263,7 +262,6 @@
 platform/graphics/ca/TileCoverageMap.cpp
 platform/graphics/ca/TileGrid.cpp
 platform/graphics/ca/TransformationMatrixCA.cpp
-platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp
 platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm
 platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm
 platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (237635 => 237636)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2018-10-31 15:08:26 UTC (rev 237636)
@@ -692,8 +692,6 @@
 		26F9A83918A046AC00AEB88A /* ViewportConfiguration.h in Headers */ = {isa = PBXBuildFile; fileRef = 26F9A83718A046AC00AEB88A /* ViewportConfiguration.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		285D32082035D6560070D32F /* ServerTimingParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 288E82F02035D4ED00B0DCFF /* ServerTimingParser.h */; };
 		2914E3081CAB5A440049966F /* AccessibilityAttachment.h in Headers */ = {isa = PBXBuildFile; fileRef = 2914E3061CAB5A440049966F /* AccessibilityAttachment.h */; };
-		2917B5621473496C0052C9D0 /* LayerFlushScheduler.h in Headers */ = {isa = PBXBuildFile; fileRef = 2917B55F1473496C0052C9D0 /* LayerFlushScheduler.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		2917B5631473496C0052C9D0 /* LayerFlushSchedulerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		293EAE1F1356B2FE0067ACF9 /* RuntimeApplicationChecks.h in Headers */ = {isa = PBXBuildFile; fileRef = 293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		29489FC712C00F0300D83F0F /* AccessibilityScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */; };
 		297BE3D516C03C08003316BD /* PlatformSpeechSynthesisUtterance.h in Headers */ = {isa = PBXBuildFile; fileRef = 2527CC9116BF8BA1009DDAC0 /* PlatformSpeechSynthesisUtterance.h */; };
@@ -2937,7 +2935,7 @@
 		A14832C4187F663C00DA63A6 /* WKView.h in Headers */ = {isa = PBXBuildFile; fileRef = A14832A9187F508700DA63A6 /* WKView.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A14832C6187F668F00DA63A6 /* WKViewPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = A14832AB187F508700DA63A6 /* WKViewPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A14832C7187F66C800DA63A6 /* WebCoreThread.h in Headers */ = {isa = PBXBuildFile; fileRef = A1483299187F508700DA63A6 /* WebCoreThread.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		A14832C9187F676B00DA63A6 /* WebCoreThreadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A148329B187F508700DA63A6 /* WebCoreThreadInternal.h */; };
+		A14832C9187F676B00DA63A6 /* WebCoreThreadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A148329B187F508700DA63A6 /* WebCoreThreadInternal.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A14832CA187F678000DA63A6 /* WebCoreThreadMessage.h in Headers */ = {isa = PBXBuildFile; fileRef = A148329C187F508700DA63A6 /* WebCoreThreadMessage.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A14832CC187F67C400DA63A6 /* WebCoreThreadRun.h in Headers */ = {isa = PBXBuildFile; fileRef = A148329E187F508700DA63A6 /* WebCoreThreadRun.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		A14832CF187F684700DA63A6 /* WebCoreThreadSystemInterface.h in Headers */ = {isa = PBXBuildFile; fileRef = A14832A1187F508700DA63A6 /* WebCoreThreadSystemInterface.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -6498,10 +6496,6 @@
 		28DB9BC72020EA0400E54A07 /* PerformanceServerTiming.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PerformanceServerTiming.idl; sourceTree = "<group>"; };
 		2914E3051CAB5A440049966F /* AccessibilityAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityAttachment.cpp; sourceTree = "<group>"; };
 		2914E3061CAB5A440049966F /* AccessibilityAttachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityAttachment.h; sourceTree = "<group>"; };
-		2917B55E1473496C0052C9D0 /* LayerFlushScheduler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayerFlushScheduler.cpp; sourceTree = "<group>"; };
-		2917B55F1473496C0052C9D0 /* LayerFlushScheduler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerFlushScheduler.h; sourceTree = "<group>"; };
-		2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerFlushSchedulerClient.h; sourceTree = "<group>"; };
-		2917B565147349950052C9D0 /* LayerFlushSchedulerMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayerFlushSchedulerMac.cpp; sourceTree = "<group>"; };
 		293EAE1E1356B2FE0067ACF9 /* RuntimeApplicationChecks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeApplicationChecks.h; sourceTree = "<group>"; };
 		29489FC512C00F0300D83F0F /* AccessibilityScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityScrollView.h; sourceTree = "<group>"; };
 		29498681195341940072D2BD /* TextUndoInsertionMarkupMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextUndoInsertionMarkupMac.mm; sourceTree = "<group>"; };
@@ -17901,7 +17895,6 @@
 		4958781E12A57DBC007238AC /* cocoa */ = {
 			isa = PBXGroup;
 			children = (
-				2917B565147349950052C9D0 /* LayerFlushSchedulerMac.cpp */,
 				0F5E200518E771FC003EC3E5 /* PlatformCAAnimationCocoa.h */,
 				4958781F12A57DDF007238AC /* PlatformCAAnimationCocoa.mm */,
 				0F13163F16ED0CDE0035CC04 /* PlatformCAFiltersCocoa.mm */,
@@ -17976,9 +17969,6 @@
 				4958781E12A57DBC007238AC /* cocoa */,
 				499B3ED4128CD31400E726C2 /* GraphicsLayerCA.cpp */,
 				499B3ED5128CD31400E726C2 /* GraphicsLayerCA.h */,
-				2917B55E1473496C0052C9D0 /* LayerFlushScheduler.cpp */,
-				2917B55F1473496C0052C9D0 /* LayerFlushScheduler.h */,
-				2917B5601473496C0052C9D0 /* LayerFlushSchedulerClient.h */,
 				7AA3A69D194B59B6001CBD24 /* LayerPool.cpp */,
 				7AA3A69E194B59B6001CBD24 /* LayerPool.h */,
 				0FDF45A61BD1C6FD00E4FA8C /* PlatformCAAnimation.cpp */,
@@ -29798,8 +29788,6 @@
 				E15FF7D518C9553800FE4C87 /* KeypressCommand.h in Headers */,
 				450CEBF115073BBE002BB149 /* LabelableElement.h in Headers */,
 				A456FA2711AD4A830020B420 /* LabelsNodeList.h in Headers */,
-				2917B5621473496C0052C9D0 /* LayerFlushScheduler.h in Headers */,
-				2917B5631473496C0052C9D0 /* LayerFlushSchedulerClient.h in Headers */,
 				E4916FF7195DF6A0005AB349 /* LayerFlushThrottleState.h in Headers */,
 				580371641A66F1D300BAF519 /* LayerFragment.h in Headers */,
 				7AA3A6A0194B59B6001CBD24 /* LayerPool.h in Headers */,

Modified: trunk/Source/WebCore/platform/RuntimeApplicationChecks.h (237635 => 237636)


--- trunk/Source/WebCore/platform/RuntimeApplicationChecks.h	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecks.h	2018-10-31 15:08:26 UTC (rev 237636)
@@ -85,7 +85,7 @@
 bool isSpringBoard();
 WEBCORE_EXPORT bool isWebApp();
 WEBCORE_EXPORT bool isWebProcess();
-bool isIBooks();
+WEBCORE_EXPORT bool isIBooks();
 bool isIBooksStorytime();
 WEBCORE_EXPORT bool isTheSecretSocietyHiddenMystery();
 WEBCORE_EXPORT bool isCardiogram();

Deleted: trunk/Source/WebCore/platform/graphics/ca/LayerFlushScheduler.cpp (237635 => 237636)


--- trunk/Source/WebCore/platform/graphics/ca/LayerFlushScheduler.cpp	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebCore/platform/graphics/ca/LayerFlushScheduler.cpp	2018-10-31 15:08:26 UTC (rev 237636)
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-
-#include "LayerFlushScheduler.h"
-
-namespace WebCore {
-    
-void LayerFlushScheduler::suspend()
-{
-    if (m_isSuspended)
-        return;
-    
-    m_isSuspended = true;
-    invalidate();
-}
-    
-void LayerFlushScheduler::resume()
-{
-    if (!m_isSuspended)
-        return;
-    
-    m_isSuspended = false;
-    schedule();
-}
-
-} // namespace WebCore

Deleted: trunk/Source/WebCore/platform/graphics/ca/LayerFlushScheduler.h (237635 => 237636)


--- trunk/Source/WebCore/platform/graphics/ca/LayerFlushScheduler.h	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebCore/platform/graphics/ca/LayerFlushScheduler.h	2018-10-31 15:08:26 UTC (rev 237636)
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#pragma once
-
-#include "LayerFlushSchedulerClient.h"
-#include "RunLoopObserver.h"
-#include <wtf/Noncopyable.h>
-
-namespace WebCore {
-    
-class LayerFlushScheduler {
-    WTF_MAKE_NONCOPYABLE(LayerFlushScheduler);
-public:
-    WEBCORE_EXPORT LayerFlushScheduler(LayerFlushSchedulerClient*);
-    WEBCORE_EXPORT virtual ~LayerFlushScheduler();
-
-    WEBCORE_EXPORT void schedule();
-    WEBCORE_EXPORT void invalidate();
-
-    WEBCORE_EXPORT void suspend();
-    WEBCORE_EXPORT void resume();
-
-    bool isSuspended() const { return m_isSuspended; }
-
-#if PLATFORM(COCOA)
-    WEBCORE_EXPORT virtual void layerFlushCallback();
-#endif
-
-private:
-    bool m_isSuspended;
-    LayerFlushSchedulerClient* m_client;
-    
-#if PLATFORM(COCOA)
-    std::unique_ptr<RunLoopObserver> m_runLoopObserver;
-#endif
-};
-
-} // namespace WebCore
-

Deleted: trunk/Source/WebCore/platform/graphics/ca/LayerFlushSchedulerClient.h (237635 => 237636)


--- trunk/Source/WebCore/platform/graphics/ca/LayerFlushSchedulerClient.h	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebCore/platform/graphics/ca/LayerFlushSchedulerClient.h	2018-10-31 15:08:26 UTC (rev 237636)
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#ifndef LayerFlushSchedulerClient_h
-#define LayerFlushSchedulerClient_h
-
-namespace WebCore {
-
-class LayerFlushSchedulerClient {
-protected:
-    virtual ~LayerFlushSchedulerClient() = default;
-
-public:
-    // Flush the layers. Returns true on success.
-    virtual bool flushLayers() = 0;
-};
-
-} // namespace WebCore
-
-#endif // LayerFlushSchedulerClient_h

Deleted: trunk/Source/WebCore/platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp (237635 => 237636)


--- trunk/Source/WebCore/platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp	2018-10-31 15:08:26 UTC (rev 237636)
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
- */
-
-#include "config.h"
-#include "LayerFlushScheduler.h"
-
-#include <wtf/AutodrainedPool.h>
-
-#if PLATFORM(IOS_FAMILY)
-#include "RuntimeApplicationChecks.h"
-#include "WebCoreThreadInternal.h"
-#include <CoreFoundation/CFBundle.h>
-#endif
-
-namespace WebCore {
-
-static CFRunLoopRef currentRunLoop()
-{
-#if PLATFORM(IOS_FAMILY)
-    // A race condition during WebView deallocation can lead to a crash if the layer sync run loop
-    // observer is added to the main run loop <rdar://problem/9798550>. However, for responsiveness,
-    // we still allow this, see <rdar://problem/7403328>. Since the race condition and subsequent
-    // crash are especially troublesome for iBooks, we never allow the observer to be added to the
-    // main run loop in iBooks.
-    if (IOSApplication::isIBooks())
-        return WebThreadRunLoop();
-#endif
-    return CFRunLoopGetCurrent();
-}
-
-LayerFlushScheduler::LayerFlushScheduler(LayerFlushSchedulerClient* client)
-    : m_isSuspended(false)
-    , m_client(client)
-{
-    ASSERT_ARG(client, client);
-
-    m_runLoopObserver = std::make_unique<RunLoopObserver>(static_cast<CFIndex>(RunLoopObserver::WellKnownRunLoopOrders::LayerFlush), [this]() {
-        if (this->isSuspended())
-            return;
-        this->layerFlushCallback();
-    });
-}
-
-LayerFlushScheduler::~LayerFlushScheduler() = default;
-
-void LayerFlushScheduler::layerFlushCallback()
-{
-    ASSERT(!m_isSuspended);
-
-    AutodrainedPool pool;
-    if (m_client->flushLayers())
-        invalidate();
-}
-
-void LayerFlushScheduler::schedule()
-{
-    if (m_isSuspended)
-        return;
-
-    m_runLoopObserver->schedule(currentRunLoop());
-}
-
-void LayerFlushScheduler::invalidate()
-{
-    m_runLoopObserver->invalidate();
-}
-    
-} // namespace WebCore

Modified: trunk/Source/WebCore/platform/ios/wak/WebCoreThreadInternal.h (237635 => 237636)


--- trunk/Source/WebCore/platform/ios/wak/WebCoreThreadInternal.h	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebCore/platform/ios/wak/WebCoreThreadInternal.h	2018-10-31 15:08:26 UTC (rev 237636)
@@ -42,7 +42,7 @@
 
 void WebThreadInitRunQueue();
 
-CFRunLoopRef WebThreadRunLoop(void);
+WEBCORE_EXPORT CFRunLoopRef WebThreadRunLoop(void);
 WebThreadContext *WebThreadCurrentContext(void);
 
 #if defined(__cplusplus)

Modified: trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp (237635 => 237636)


--- trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp	2018-10-31 15:08:26 UTC (rev 237636)
@@ -30,6 +30,7 @@
 
 #include "Logging.h"
 #include "RealtimeIncomingVideoSourceCocoa.h"
+#include "RealtimeVideoUtilities.h"
 
 ALLOW_UNUSED_PARAMETERS_BEGIN
 

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (237635 => 237636)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2018-10-31 15:08:26 UTC (rev 237636)
@@ -1,3 +1,24 @@
+2018-10-31  Antti Koivisto  <an...@apple.com>
+
+        Remove LayerFlushScheduler
+        https://bugs.webkit.org/show_bug.cgi?id=191103
+
+        Reviewed by Anders Carlsson.
+
+        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):
+
 2018-10-30  Alexey Proskuryakov  <a...@apple.com>
 
         Enable InstallAPI for iOS unconditionally

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebViewData.h (237635 => 237636)


--- trunk/Source/WebKitLegacy/mac/WebView/WebViewData.h	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebViewData.h	2018-10-31 15:08:26 UTC (rev 237636)
@@ -34,8 +34,6 @@
 #import <pal/spi/cocoa/AVKitSPI.h>
 #endif
 #import <WebCore/AlternativeTextClient.h>
-#import <WebCore/LayerFlushScheduler.h>
-#import <WebCore/LayerFlushSchedulerClient.h>
 #import <WebCore/WebCoreKeyboardUIMode.h>
 #import <wtf/HashMap.h>
 #import <wtf/Lock.h>
@@ -51,6 +49,7 @@
 class AlternativeTextUIController;
 class HistoryItem;
 class Page;
+class RunLoopObserver;
 class TextIndicatorWindow;
 class ValidationBubble;
 #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
@@ -109,22 +108,22 @@
 @class WebTextTouchBarItemController;
 #endif
 
-class WebViewLayerFlushScheduler : public WebCore::LayerFlushScheduler {
+class WebViewLayerFlushScheduler {
 public:
     WebViewLayerFlushScheduler(LayerFlushController*);
-    virtual ~WebViewLayerFlushScheduler() { }
+    ~WebViewLayerFlushScheduler();
 
+    void schedule();
+    void invalidate();
+
 private:
-    void layerFlushCallback() override
-    {
-        RefPtr<LayerFlushController> protector = m_flushController;
-        WebCore::LayerFlushScheduler::layerFlushCallback();
-    }
+    void layerFlushCallback();
     
     LayerFlushController* m_flushController;
+    std::unique_ptr<WebCore::RunLoopObserver> m_runLoopObserver;
 };
 
-class LayerFlushController : public RefCounted<LayerFlushController>, public WebCore::LayerFlushSchedulerClient {
+class LayerFlushController : public RefCounted<LayerFlushController> {
 public:
     static Ref<LayerFlushController> create(WebView* webView)
     {
@@ -131,7 +130,7 @@
         return adoptRef(*new LayerFlushController(webView));
     }
     
-    virtual bool flushLayers();
+    bool flushLayers();
     
     void scheduleLayerFlush();
     void invalidate();

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebViewData.mm (237635 => 237636)


--- trunk/Source/WebKitLegacy/mac/WebView/WebViewData.mm	2018-10-31 14:21:57 UTC (rev 237635)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebViewData.mm	2018-10-31 15:08:26 UTC (rev 237636)
@@ -37,6 +37,7 @@
 #import <_javascript_Core/InitializeThreading.h>
 #import <WebCore/AlternativeTextUIController.h>
 #import <WebCore/HistoryItem.h>
+#import <WebCore/RunLoopObserver.h>
 #import <WebCore/TextIndicatorWindow.h>
 #import <WebCore/ValidationBubble.h>
 #import <wtf/MainThread.h>
@@ -44,6 +45,8 @@
 
 #if PLATFORM(IOS_FAMILY)
 #import "WebGeolocationProviderIOS.h"
+#import <WebCore/RuntimeApplicationChecks.h>
+#import <WebCore/WebCoreThreadInternal.h>
 #endif
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS_FAMILY)
@@ -58,6 +61,20 @@
 BOOL applicationIsTerminating = NO;
 int pluginDatabaseClientCount = 0;
 
+static CFRunLoopRef currentRunLoop()
+{
+#if PLATFORM(IOS_FAMILY)
+    // A race condition during WebView deallocation can lead to a crash if the layer sync run loop
+    // observer is added to the main run loop <rdar://problem/9798550>. However, for responsiveness,
+    // we still allow this, see <rdar://problem/7403328>. Since the race condition and subsequent
+    // crash are especially troublesome for iBooks, we never allow the observer to be added to the
+    // main run loop in iBooks.
+    if (WebCore::IOSApplication::isIBooks())
+        return WebThreadRunLoop();
+#endif
+    return CFRunLoopGetCurrent();
+}
+
 void LayerFlushController::scheduleLayerFlush()
 {
     m_layerFlushScheduler.schedule();
@@ -77,11 +94,36 @@
 }
 
 WebViewLayerFlushScheduler::WebViewLayerFlushScheduler(LayerFlushController* flushController)
-    : WebCore::LayerFlushScheduler(flushController)
-    , m_flushController(flushController)
+    : m_flushController(flushController)
 {
+    m_runLoopObserver = std::make_unique<WebCore::RunLoopObserver>(static_cast<CFIndex>(WebCore::RunLoopObserver::WellKnownRunLoopOrders::LayerFlush), [this]() {
+        this->layerFlushCallback();
+    });
 }
 
+WebViewLayerFlushScheduler::~WebViewLayerFlushScheduler()
+{
+}
+
+void WebViewLayerFlushScheduler::schedule()
+{
+    m_runLoopObserver->schedule(currentRunLoop());
+}
+
+void WebViewLayerFlushScheduler::invalidate()
+{
+    m_runLoopObserver->invalidate();
+}
+
+void WebViewLayerFlushScheduler::layerFlushCallback()
+{
+    @autoreleasepool {
+        RefPtr<LayerFlushController> protector = m_flushController;
+        if (m_flushController->flushLayers())
+            invalidate();
+    }
+}
+
 #if PLATFORM(MAC)
 
 @implementation WebWindowVisibilityObserver
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to