[ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserve...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Feb 2019 04:39:22 +0000 (04:39 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Feb 2019 04:39:22 +0000 (04:39 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195128
<rdar://problem/48456752>

Reviewed by Simon Fraser.

Move the final bits over to ContentChangeObserver and delete WKContentObservationInternal.h.

* WebCore.xcodeproj/project.pbxproj:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::setObservedContentChange):
* platform/ios/wak/WKContentObservation.cpp:
(WKSetObservedContentChange):
* platform/ios/wak/WKContentObservation.h:
* platform/ios/wak/WKContentObservationInternal.h: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242190 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/SourcesCocoa.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/page/ios/ContentChangeObserver.cpp [moved from Source/WebCore/page/ios/ContentChangeObserver.mm with 97% similarity]
Source/WebCore/platform/ios/wak/WKContentObservation.cpp
Source/WebCore/platform/ios/wak/WKContentObservation.h
Source/WebCore/platform/ios/wak/WKContentObservationInternal.h [deleted file]

index 26536b1..d966289 100644 (file)
@@ -1,3 +1,21 @@
+2019-02-27  Zalan Bujtas  <zalan@apple.com>
+
+        [ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserver class.
+        https://bugs.webkit.org/show_bug.cgi?id=195128
+        <rdar://problem/48456752>
+
+        Reviewed by Simon Fraser.
+
+        Move the final bits over to ContentChangeObserver and delete WKContentObservationInternal.h.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * page/ios/ContentChangeObserver.mm:
+        (WebCore::ContentChangeObserver::setObservedContentChange):
+        * platform/ios/wak/WKContentObservation.cpp:
+        (WKSetObservedContentChange):
+        * platform/ios/wak/WKContentObservation.h:
+        * platform/ios/wak/WKContentObservationInternal.h: Removed.
+
 2019-02-27  Simon Fraser  <simon.fraser@apple.com>
 
         Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
index 78a9f7a..fae30f8 100644 (file)
@@ -131,7 +131,7 @@ page/cocoa/ResourceUsageOverlayCocoa.mm
 page/cocoa/ResourceUsageThreadCocoa.mm
 page/cocoa/SettingsBaseCocoa.mm
 
-page/ios/ContentChangeObserver.mm
+page/ios/ContentChangeObserver.cpp
 page/ios/EventHandlerIOS.mm
 page/ios/FrameIOS.mm
 page/ios/WebEventRegion.mm
index c097936..2441959 100644 (file)
                EBF5121C1696496C0056BD25 /* JSTypeConversions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EBF5121A1696496C0056BD25 /* JSTypeConversions.cpp */; };
                EBF5121D1696496C0056BD25 /* JSTypeConversions.h in Headers */ = {isa = PBXBuildFile; fileRef = EBF5121B1696496C0056BD25 /* JSTypeConversions.h */; };
                ECA680C71E67724500731D20 /* StringUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = ECA680C61E67724500731D20 /* StringUtilities.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               ECCDB8811E4B8C5900A1AEA6 /* WKContentObservationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = ECCDB8801E4B8C5900A1AEA6 /* WKContentObservationInternal.h */; };
                ED2BA83C09A24B91006C0AC4 /* DocumentMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */; settings = {ATTRIBUTES = (Private, ); }; };
                EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE3A4FF0C7A430600956A37 /* ColorMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                EDEC98030AED7E170059137F /* WebCorePrefix.h in Headers */ = {isa = PBXBuildFile; fileRef = EDEC98020AED7E170059137F /* WebCorePrefix.h */; };
                6FE7CFA02177EEF1005B1573 /* InlineItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InlineItem.h; sourceTree = "<group>"; };
                6FE7CFA32177EF10005B1573 /* LayoutLineBreakBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutLineBreakBox.h; sourceTree = "<group>"; };
                6FE7CFA52177F069005B1573 /* LayoutLineBreakBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutLineBreakBox.cpp; sourceTree = "<group>"; };
-               6FE9F09222211035004C5082 /* ContentChangeObserver.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ContentChangeObserver.mm; sourceTree = "<group>"; };
+               6FE9F09222211035004C5082 /* ContentChangeObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentChangeObserver.cpp; sourceTree = "<group>"; };
                6FFDC43E212EFF1600A9CA91 /* FloatAvoider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FloatAvoider.cpp; sourceTree = "<group>"; };
                6FFDC440212EFF1600A9CA91 /* FloatAvoider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FloatAvoider.h; sourceTree = "<group>"; };
                709A01FD1E3D0BCC006B0D4C /* ModuleFetchFailureKind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ModuleFetchFailureKind.h; sourceTree = "<group>"; };
                EBF5121B1696496C0056BD25 /* JSTypeConversions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTypeConversions.h; sourceTree = "<group>"; };
                ECA680C61E67724500731D20 /* StringUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StringUtilities.h; sourceTree = "<group>"; };
                ECA680C81E67730B00731D20 /* StringUtilities.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = StringUtilities.mm; sourceTree = "<group>"; };
-               ECCDB8801E4B8C5900A1AEA6 /* WKContentObservationInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContentObservationInternal.h; sourceTree = "<group>"; };
                ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentMarker.h; sourceTree = "<group>"; };
                ED501DC50B249F2900AE18D9 /* EditorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = EditorMac.mm; sourceTree = "<group>"; };
                EDE3A4FF0C7A430600956A37 /* ColorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorMac.h; sourceTree = "<group>"; };
                18A6CD6F0D8F2025001DC3CE /* ios */ = {
                        isa = PBXGroup;
                        children = (
+                               6FE9F09222211035004C5082 /* ContentChangeObserver.cpp */,
                                6FB5E212221F2447003989CF /* ContentChangeObserver.h */,
-                               6FE9F09222211035004C5082 /* ContentChangeObserver.mm */,
                                FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */,
                                FED13D3B0CEA936A00D89466 /* FrameIOS.mm */,
                                225A16B30D5C11E900090295 /* WebEventRegion.h */,
                                A14832A1187F508700DA63A6 /* WebCoreThreadSystemInterface.h */,
                                A14832A2187F508700DA63A6 /* WKContentObservation.cpp */,
                                A14832A3187F508700DA63A6 /* WKContentObservation.h */,
-                               ECCDB8801E4B8C5900A1AEA6 /* WKContentObservationInternal.h */,
                                A14832A4187F508700DA63A6 /* WKGraphics.h */,
                                A14832A5187F508700DA63A6 /* WKGraphics.mm */,
                                A14832A6187F508700DA63A6 /* WKTypes.h */,
                                E1E1BF00115FF6FB006F52CA /* WindowsKeyboardCodes.h in Headers */,
                                501BAAA913950E2C00F7ACEB /* WindRule.h in Headers */,
                                A14832BE187F64CC00DA63A6 /* WKContentObservation.h in Headers */,
-                               ECCDB8811E4B8C5900A1AEA6 /* WKContentObservationInternal.h in Headers */,
                                A14832BF187F652C00DA63A6 /* WKGraphics.h in Headers */,
                                A14832C1187F657A00DA63A6 /* WKTypes.h in Headers */,
                                A14832C3187F65DF00DA63A6 /* WKUtilities.h in Headers */,
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "config.h"
-#import "ContentChangeObserver.h"
+#include "config.h"
+#include "ContentChangeObserver.h"
 
 #if PLATFORM(IOS_FAMILY)
-#import "Chrome.h"
-#import "ChromeClient.h"
-#import "DOMTimer.h"
-#import "Logging.h"
-#import "Page.h"
-#import "WKContentObservationInternal.h"
+#include "Chrome.h"
+#include "ChromeClient.h"
+#include "DOMTimer.h"
+#include "Logging.h"
+#include "NodeRenderStyle.h"
+#include "Page.h"
 
 namespace WebCore {
 
@@ -223,6 +223,8 @@ void ContentChangeObserver::clearObservedDOMTimers()
 
 void ContentChangeObserver::setObservedContentChange(WKContentChange change)
 {
+    if (observedContentChange() == WKContentVisibilityChange)
+        return;
     WKSetObservedContentChange(change);
 }
 
index ce5596e..3c61815 100644 (file)
 
 #include "config.h"
 #include "WKContentObservation.h"
-#include "WKContentObservationInternal.h"
 
 #if PLATFORM(IOS_FAMILY)
 
-#include "JSDOMBinding.h"
-#include "WebCoreThread.h"
-#include <wtf/HashMap.h>
-#include <wtf/NeverDestroyed.h>
-
 WKContentChange _WKContentChange = WKContentNoChange;
 
 WKContentChange WKObservedContentChange(void)
@@ -43,15 +37,7 @@ WKContentChange WKObservedContentChange(void)
 
 void WKSetObservedContentChange(WKContentChange change)
 {
-    // We've already have a definite answer.
-    if (_WKContentChange == WKContentVisibilityChange)
-        return;
-
-    if (change == WKContentVisibilityChange || change == WKContentIndeterminateChange) {
-        _WKContentChange = change;
-        return;
-    }
-    ASSERT_NOT_REACHED();
+    _WKContentChange = change;
 }
 
 #endif // PLATFORM(IOS_FAMILY)
index 6b12197..2fca894 100644 (file)
@@ -40,6 +40,7 @@ typedef enum
 }   WKContentChange;
 
 WEBCORE_EXPORT WKContentChange WKObservedContentChange(void);
+WEBCORE_EXPORT void WKSetObservedContentChange(WKContentChange);
 
 #ifdef __cplusplus
 }
diff --git a/Source/WebCore/platform/ios/wak/WKContentObservationInternal.h b/Source/WebCore/platform/ios/wak/WKContentObservationInternal.h
deleted file mode 100644 (file)
index d4afc8c..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2017 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. AND ITS CONTRIBUTORS ``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 ITS 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 WKContentObservationInternal_h
-#define WKContentObservationInternal_h
-
-#if TARGET_OS_IPHONE
-
-#import "WKContentObservation.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void WKSetObservedContentChange(WKContentChange);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // TARGET_OS_IPHONE
-
-#endif // WKContentObservationInternal_h