[ContentChangeObserver] Rename members and move implementation to header.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2019 19:23:50 +0000 (19:23 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2019 19:23:50 +0000 (19:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195198
<rdar://problem/48499967>

Reviewed by Simon Fraser.

* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::startObservingStyleRecalc):
(WebCore::ContentChangeObserver::stopObservingStyleRecalc):
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::stopObservingContentChanges):
(WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
(WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
(WebCore::ContentChangeObserver::startObservingStyleResolve): Deleted.
(WebCore::ContentChangeObserver::stopObservingStyleResolve): Deleted.
(WebCore::ContentChangeObserver::isObservingContentChanges): Deleted.
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc): Deleted.
(WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc): Deleted.
(WebCore::ContentChangeObserver::countOfObservedDOMTimers): Deleted.
(WebCore::ContentChangeObserver::clearObservedDOMTimers): Deleted.
(WebCore::ContentChangeObserver::containsObservedDOMTimer): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
(WebCore::ContentChangeObserver::containsObservedDOMTimer const):
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const):
(WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
(WebCore::ContentChangeObserver::shouldObserveStyleRecalc const):
(WebCore::ContentChangeObserver::isObservingContentChanges const):
(WebCore::ContentChangeObserver::countOfObservedDOMTimers const):
(WebCore::ContentChangeObserver::clearObservedDOMTimers):

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

Source/WebCore/ChangeLog
Source/WebCore/page/ios/ContentChangeObserver.cpp
Source/WebCore/page/ios/ContentChangeObserver.h

index 9334a6e..0f6e746 100644 (file)
@@ -1,5 +1,50 @@
 2019-03-01  Zalan Bujtas  <zalan@apple.com>
 
+        [ContentChangeObserver] Rename members and move implementation to header.
+        https://bugs.webkit.org/show_bug.cgi?id=195198
+        <rdar://problem/48499967>
+
+        Reviewed by Simon Fraser.
+
+        * page/ios/ContentChangeObserver.cpp:
+        (WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
+        (WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
+        (WebCore::ContentChangeObserver::startObservingStyleRecalc):
+        (WebCore::ContentChangeObserver::stopObservingStyleRecalc):
+        (WebCore::ContentChangeObserver::startObservingContentChanges):
+        (WebCore::ContentChangeObserver::stopObservingContentChanges):
+        (WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
+        (WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
+        (WebCore::ContentChangeObserver::startObservingStyleResolve): Deleted.
+        (WebCore::ContentChangeObserver::stopObservingStyleResolve): Deleted.
+        (WebCore::ContentChangeObserver::isObservingContentChanges): Deleted.
+        (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
+        (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
+        (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling): Deleted.
+        (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
+        (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
+        (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling): Deleted.
+        (WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc): Deleted.
+        (WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc): Deleted.
+        (WebCore::ContentChangeObserver::countOfObservedDOMTimers): Deleted.
+        (WebCore::ContentChangeObserver::clearObservedDOMTimers): Deleted.
+        (WebCore::ContentChangeObserver::containsObservedDOMTimer): Deleted.
+        * page/ios/ContentChangeObserver.h:
+        (WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
+        (WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
+        (WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
+        (WebCore::ContentChangeObserver::containsObservedDOMTimer const):
+        (WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
+        (WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
+        (WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const):
+        (WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
+        (WebCore::ContentChangeObserver::shouldObserveStyleRecalc const):
+        (WebCore::ContentChangeObserver::isObservingContentChanges const):
+        (WebCore::ContentChangeObserver::countOfObservedDOMTimers const):
+        (WebCore::ContentChangeObserver::clearObservedDOMTimers):
+
+2019-03-01  Zalan Bujtas  <zalan@apple.com>
+
         [ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKContentVisibilityChange directly
         https://bugs.webkit.org/show_bug.cgi?id=195197
         <rdar://problem/48498332>
index 006be89..dec9b0e 100644 (file)
@@ -72,7 +72,7 @@ void ContentChangeObserver::startObservingDOMTimerExecute(const DOMTimer& timer)
         return;
     LOG_WITH_STREAM(ContentObservation, stream << "startObservingDOMTimerExecute: start observing (" << &timer << ") timer callback.");
     startObservingStyleRecalcScheduling();
-    m_observingContentChanges = true;
+    m_isObservingContentChanges = true;
 }
 
 void ContentChangeObserver::stopObservingDOMTimerExecute(const DOMTimer& timer)
@@ -93,7 +93,7 @@ void ContentChangeObserver::stopObservingDOMTimerExecute(const DOMTimer& timer)
     } else if (observedContentChange == WKContentIndeterminateChange) {
         // An async style recalc has been scheduled. Let's observe it.
         LOG_WITH_STREAM(ContentObservation, stream << "stopObservingDOMTimerExecute: (" << &timer << ") wait until next style recalc fires.");
-        setShouldObserveNextStyleRecalc(true);
+        setShouldObserveStyleRecalc(true);
     }
 }
 
@@ -105,26 +105,26 @@ void ContentChangeObserver::didScheduleStyleRecalc()
     setObservedContentChange(WKContentIndeterminateChange);
 }
 
-void ContentChangeObserver::startObservingStyleResolve()
+void ContentChangeObserver::startObservingStyleRecalc()
 {
-    if (!shouldObserveNextStyleRecalc())
+    if (!shouldObserveStyleRecalc())
         return;
-    LOG(ContentObservation, "startObservingStyleResolve: start observing style resolve.");
-    m_observingContentChanges = true;
+    LOG(ContentObservation, "startObservingStyleRecalc: start observing style recalc.");
+    m_isObservingContentChanges = true;
 }
 
-void ContentChangeObserver::stopObservingStyleResolve()
+void ContentChangeObserver::stopObservingStyleRecalc()
 {
-    if (!shouldObserveNextStyleRecalc())
+    if (!shouldObserveStyleRecalc())
         return;
-    LOG(ContentObservation, "stopObservingStyleResolve: stop observing style resolve");
-    setShouldObserveNextStyleRecalc(false);
+    LOG(ContentObservation, "stopObservingStyleRecalc: stop observing style recalc");
+    setShouldObserveStyleRecalc(false);
     auto inDeterminedState = observedContentChange() == WKContentVisibilityChange || !countOfObservedDOMTimers();
     if (!inDeterminedState) {
-        LOG(ContentObservation, "stopObservingStyleResolve: can't decided it yet.");
+        LOG(ContentObservation, "stopObservingStyleRecalc: can't decided it yet.");
         return;
     }
-    LOG(ContentObservation, "stopObservingStyleResolve: notify the pending synthetic click handler.");
+    LOG(ContentObservation, "stopObservingStyleRecalc: notify the pending synthetic click handler.");
     m_page.chrome().client().observedContentChange(m_page.mainFrame());
 }
 
@@ -156,59 +156,14 @@ void ContentChangeObserver::startObservingContentChanges()
 {
     startObservingDOMTimerScheduling();
     resetObservedContentChange();
-    m_observingContentChanges = true;
+    clearObservedDOMTimers();
+    m_isObservingContentChanges = true;
 }
 
 void ContentChangeObserver::stopObservingContentChanges()
 {
     stopObservingDOMTimerScheduling();
-    m_observingContentChanges = false;
-}
-
-bool ContentChangeObserver::isObservingContentChanges()
-{
-    return m_observingContentChanges;
-}
-
-void ContentChangeObserver::startObservingDOMTimerScheduling()
-{
-    m_observingDOMTimerScheduling = true;
-    clearObservedDOMTimers();
-}
-
-void ContentChangeObserver::stopObservingDOMTimerScheduling()
-{
-    m_observingDOMTimerScheduling = false;
-}
-
-bool ContentChangeObserver::isObservingDOMTimerScheduling()
-{
-    return m_observingDOMTimerScheduling;
-}
-
-void ContentChangeObserver::startObservingStyleRecalcScheduling()
-{
-    m_observingStyleRecalcScheduling = true;
-}
-
-void ContentChangeObserver::stopObservingStyleRecalcScheduling()
-{
-    m_observingStyleRecalcScheduling = false;
-}
-
-bool ContentChangeObserver::isObservingStyleRecalcScheduling()
-{
-    return m_observingStyleRecalcScheduling;
-}
-
-void ContentChangeObserver::setShouldObserveNextStyleRecalc(bool observe)
-{
-    m_observingNextStyleRecalc = observe;
-}
-
-bool ContentChangeObserver::shouldObserveNextStyleRecalc()
-{
-    return m_observingNextStyleRecalc;
+    m_isObservingContentChanges = false;
 }
 
 WKContentChange ContentChangeObserver::observedContentChange()
@@ -216,16 +171,6 @@ WKContentChange ContentChangeObserver::observedContentChange()
     return WKObservedContentChange();
 }
 
-unsigned ContentChangeObserver::countOfObservedDOMTimers()
-{
-    return m_DOMTimerList.size();
-}
-
-void ContentChangeObserver::clearObservedDOMTimers()
-{
-    m_DOMTimerList.clear();
-}
-
 void ContentChangeObserver::resetObservedContentChange()
 {
     WKSetObservedContentChange(WKContentNoChange);
@@ -238,11 +183,6 @@ void ContentChangeObserver::setObservedContentChange(WKContentChange change)
     WKSetObservedContentChange(change);
 }
 
-bool ContentChangeObserver::containsObservedDOMTimer(const DOMTimer& timer)
-{
-    return m_DOMTimerList.contains(&timer);
-}
-
 void ContentChangeObserver::addObservedDOMTimer(const DOMTimer& timer)
 {
     ASSERT(isObservingDOMTimerScheduling());
@@ -323,13 +263,13 @@ ContentChangeObserver::StyleRecalcScope::StyleRecalcScope(Page* page)
     : m_contentChangeObserver(page ? &page->contentChangeObserver() : nullptr)
 {
     if (m_contentChangeObserver)
-        m_contentChangeObserver->startObservingStyleResolve();
+        m_contentChangeObserver->startObservingStyleRecalc();
 }
 
 ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope()
 {
     if (m_contentChangeObserver)
-        m_contentChangeObserver->stopObservingStyleResolve();
+        m_contentChangeObserver->stopObservingStyleRecalc();
 }
 
 ContentChangeObserver::DOMTimerScope::DOMTimerScope(Page* page, const DOMTimer& domTimer)
index c244c24..67b5f2a 100644 (file)
@@ -81,43 +81,42 @@ public:
     };
 
 private:
-    void startObservingDOMTimerScheduling();
-    void stopObservingDOMTimerScheduling();
+    void startObservingDOMTimerScheduling() { m_isObservingDOMTimerScheduling = true; }
+    void stopObservingDOMTimerScheduling() { m_isObservingDOMTimerScheduling = false; }
 
     void startObservingDOMTimerExecute(const DOMTimer&);
     void stopObservingDOMTimerExecute(const DOMTimer&);
 
-    void startObservingStyleResolve();
-    void stopObservingStyleResolve();
+    void startObservingStyleRecalc();
+    void stopObservingStyleRecalc();
 
     void addObservedDOMTimer(const DOMTimer&);
-    bool isObservingDOMTimerScheduling();
+    bool isObservingDOMTimerScheduling() const { return m_isObservingDOMTimerScheduling; }
     void removeObservedDOMTimer(const DOMTimer&);
-    bool containsObservedDOMTimer(const DOMTimer&);
+    bool containsObservedDOMTimer(const DOMTimer& timer) const { return m_DOMTimerList.contains(&timer); }
 
-    void startObservingStyleRecalcScheduling();
-    void stopObservingStyleRecalcScheduling();
+    void startObservingStyleRecalcScheduling() { m_isObservingStyleRecalcScheduling = true; }
+    void stopObservingStyleRecalcScheduling() { m_isObservingStyleRecalcScheduling = false; }
+    bool isObservingStyleRecalcScheduling() const { return m_isObservingStyleRecalcScheduling; }
 
-    void setShouldObserveNextStyleRecalc(bool);
-    bool shouldObserveNextStyleRecalc();
-
-    bool isObservingContentChanges();
-    bool isObservingStyleRecalcScheduling();
+    void setShouldObserveStyleRecalc(bool shouldObserve) { m_shouldObserveStyleRecalc = shouldObserve; }
+    bool shouldObserveStyleRecalc() const { return m_shouldObserveStyleRecalc; }
 
     void setObservedContentChange(WKContentChange);
     void resetObservedContentChange();
+    bool isObservingContentChanges() const { return m_isObservingContentChanges; }
 
-    unsigned countOfObservedDOMTimers();
-    void clearObservedDOMTimers();
+    unsigned countOfObservedDOMTimers() const { return m_DOMTimerList.size(); }
+    void clearObservedDOMTimers() { m_DOMTimerList.clear(); }
 
     void clearTimersAndReportContentChange();
 
     Page& m_page;
     HashSet<const DOMTimer*> m_DOMTimerList;
-    bool m_observingNextStyleRecalc { false };
-    bool m_observingStyleRecalcScheduling { false };
-    bool m_observingDOMTimerScheduling { false };
-    bool m_observingContentChanges { false };
+    bool m_shouldObserveStyleRecalc { false };
+    bool m_isObservingStyleRecalcScheduling { false };
+    bool m_isObservingDOMTimerScheduling { false };
+    bool m_isObservingContentChanges { false };
 };
 
 }