Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: third_party/WebKit/Source/core/dom/SynchronousMutationNotifier.h

Issue 2692093003: Rewrite DocumentMarkerController to use SynchronousMutationObserver (Closed)
Patch Set: Don't try to use -1 as default value for unsigned int Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/SynchronousMutationNotifier.h
diff --git a/third_party/WebKit/Source/core/dom/SynchronousMutationNotifier.h b/third_party/WebKit/Source/core/dom/SynchronousMutationNotifier.h
index 813f2097cbe8aba08c885c1cf40476beab0389b2..9045dbeb55edaaadc215c94a242425ddd46ff143 100644
--- a/third_party/WebKit/Source/core/dom/SynchronousMutationNotifier.h
+++ b/third_party/WebKit/Source/core/dom/SynchronousMutationNotifier.h
@@ -22,6 +22,19 @@ class Text;
class CORE_EXPORT SynchronousMutationNotifier
: public LifecycleNotifier<Document, SynchronousMutationObserver> {
public:
+ class ScopedNotificationSuppressor {
+ public:
+ ScopedNotificationSuppressor(SynchronousMutationNotifier*);
+ ~ScopedNotificationSuppressor();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ScopedNotificationSuppressor);
+
+ Persistent<SynchronousMutationNotifier> m_notifier;
+ };
+
+ DECLARE_VIRTUAL_TRACE();
+
// TODO(yosin): We will have |notifyXXX()| functions defined in
// |SynchronousMutationObserver|.
void notifyChangeChildren(const ContainerNode&);
@@ -37,11 +50,28 @@ class CORE_EXPORT SynchronousMutationNotifier
void notifyNodeChildrenWillBeRemoved(ContainerNode&);
void notifyNodeWillBeRemoved(Node&);
+ void incrementSuppressorCount();
+ void decrementSuppressorCount();
+
protected:
SynchronousMutationNotifier();
private:
DISALLOW_COPY_AND_ASSIGN(SynchronousMutationNotifier);
+
+ void notifyUpdateCharacterDataImmediately(CharacterData*,
+ unsigned offset,
+ unsigned oldLength,
+ unsigned newLength);
+ void flushPendingCharacterDataUpdate();
+
+ int m_suppressorCount;
+
+ // Data for pending character data update
+ Member<CharacterData> m_pendingCharacterData;
+ unsigned m_pendingOffset;
+ unsigned m_pendingOldLength;
+ unsigned m_pendingNewLength;
};
} // namespace dom

Powered by Google App Engine
This is Rietveld 408576698