[ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeO...
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Feb 2019 00:58:13 +0000 (00:58 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Feb 2019 00:58:13 +0000 (00:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195091
<rdar://problem/48427271>

Reviewed by Tim Horton.

* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::stopObservingContentChanges):
(WebCore::ContentChangeObserver::isObservingContentChanges):
* platform/ios/wak/WKContentObservation.cpp:
(WKObservingContentChanges): Deleted.
(WKStartObservingContentChanges): Deleted.
(WKStopObservingContentChanges): Deleted.
* platform/ios/wak/WKContentObservation.h:
* platform/ios/wak/WKContentObservationInternal.h:

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

Source/WebCore/ChangeLog
Source/WebCore/page/ios/ContentChangeObserver.h
Source/WebCore/page/ios/ContentChangeObserver.mm
Source/WebCore/platform/ios/wak/WKContentObservation.cpp
Source/WebCore/platform/ios/wak/WKContentObservation.h
Source/WebCore/platform/ios/wak/WKContentObservationInternal.h

index 21536ae..5cd8731 100644 (file)
@@ -1,3 +1,23 @@
+2019-02-27  Zalan Bujtas  <zalan@apple.com>
+
+        [ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeObserver class
+        https://bugs.webkit.org/show_bug.cgi?id=195091
+        <rdar://problem/48427271>
+
+        Reviewed by Tim Horton.
+
+        * page/ios/ContentChangeObserver.h:
+        * page/ios/ContentChangeObserver.mm:
+        (WebCore::ContentChangeObserver::startObservingContentChanges):
+        (WebCore::ContentChangeObserver::stopObservingContentChanges):
+        (WebCore::ContentChangeObserver::isObservingContentChanges):
+        * platform/ios/wak/WKContentObservation.cpp:
+        (WKObservingContentChanges): Deleted.
+        (WKStartObservingContentChanges): Deleted.
+        (WKStopObservingContentChanges): Deleted.
+        * platform/ios/wak/WKContentObservation.h:
+        * platform/ios/wak/WKContentObservationInternal.h:
+
 2019-02-27  Brady Eidson  <beidson@apple.com>
 
         Universal links from Google search results pages don't open the app.
index 75f5edb..d6795df 100644 (file)
@@ -98,6 +98,7 @@ private:
     bool m_observingNextStyleRecalc { false };
     bool m_observingStyleRecalcScheduling { false };
     bool m_observingDOMTimerScheduling { false };
+    bool m_observingContentChanges { false };
 };
 
 }
index 5a2bcfc..8646de7 100644 (file)
@@ -60,8 +60,8 @@ void ContentChangeObserver::startObservingDOMTimerExecute(const DOMTimer& timer)
     if (!containsObservedDOMTimer(timer))
         return;
     LOG_WITH_STREAM(ContentObservation, stream << "startObservingDOMTimerExecute: start observing (" << &timer << ") timer callback.");
-    WKStartObservingContentChanges();
     startObservingStyleRecalcScheduling();
+    m_observingContentChanges = true;
 }
 
 void ContentChangeObserver::stopObservingDOMTimerExecute(const DOMTimer& timer)
@@ -99,7 +99,7 @@ void ContentChangeObserver::startObservingStyleResolve()
     if (!shouldObserveNextStyleRecalc())
         return;
     LOG(ContentObservation, "startObservingStyleResolve: start observing style resolve.");
-    WKStartObservingContentChanges();
+    m_observingContentChanges = true;
 }
 
 void ContentChangeObserver::stopObservingStyleResolve()
@@ -150,18 +150,19 @@ void ContentChangeObserver::willDetachPage()
 void ContentChangeObserver::startObservingContentChanges()
 {
     startObservingDOMTimerScheduling();
-    WKStartObservingContentChanges();
+    setObservedContentChange(WKContentNoChange);
+    m_observingContentChanges = true;
 }
 
 void ContentChangeObserver::stopObservingContentChanges()
 {
     stopObservingDOMTimerScheduling();
-    WKStopObservingContentChanges();
+    m_observingContentChanges = false;
 }
 
 bool ContentChangeObserver::isObservingContentChanges()
 {
-    return WKObservingContentChanges();
+    return m_observingContentChanges;
 }
 
 void ContentChangeObserver::startObservingDOMTimerScheduling()
index ebb8ac6..ce5596e 100644 (file)
 #include <wtf/HashMap.h>
 #include <wtf/NeverDestroyed.h>
 
-WKContentChange _WKContentChange                    = WKContentNoChange;
-bool            _WKObservingContentChanges          = false;
-
-bool WKObservingContentChanges(void)
-{
-    return _WKObservingContentChanges;
-}
-
-void WKStartObservingContentChanges()
-{
-    _WKContentChange = WKContentNoChange;
-    _WKObservingContentChanges = true;
-}
-
-void WKStopObservingContentChanges(void)
-{
-    _WKObservingContentChanges = false;
-}
+WKContentChange _WKContentChange = WKContentNoChange;
 
 WKContentChange WKObservedContentChange(void)
 {
index 3c33784..6b12197 100644 (file)
@@ -39,9 +39,6 @@ typedef enum
     WKContentIndeterminateChange    = 1
 }   WKContentChange;
 
-WEBCORE_EXPORT void WKStartObservingContentChanges(void);
-WEBCORE_EXPORT void WKStopObservingContentChanges(void);
-
 WEBCORE_EXPORT WKContentChange WKObservedContentChange(void);
 
 #ifdef __cplusplus
index cccf633..d4afc8c 100644 (file)
@@ -34,7 +34,6 @@
 extern "C" {
 #endif
 
-bool WKObservingContentChanges(void);
 void WKSetObservedContentChange(WKContentChange);
 
 #ifdef __cplusplus