summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/MutationObserverInterestGroup.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/MutationObserverInterestGroup.h')
-rw-r--r--Source/WebCore/dom/MutationObserverInterestGroup.h30
1 files changed, 15 insertions, 15 deletions
diff --git a/Source/WebCore/dom/MutationObserverInterestGroup.h b/Source/WebCore/dom/MutationObserverInterestGroup.h
index 84cef9920..00d3849e3 100644
--- a/Source/WebCore/dom/MutationObserverInterestGroup.h
+++ b/Source/WebCore/dom/MutationObserverInterestGroup.h
@@ -28,20 +28,23 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef MutationObserverInterestGroup_h
-#define MutationObserverInterestGroup_h
+#pragma once
#include "Document.h"
#include "MutationObserver.h"
-#include "QualifiedName.h"
+#include <memory>
#include <wtf/HashMap.h>
-#include <wtf/PassOwnPtr.h>
namespace WebCore {
+class QualifiedName;
+
class MutationObserverInterestGroup {
+ WTF_MAKE_FAST_ALLOCATED;
public:
- static PassOwnPtr<MutationObserverInterestGroup> createForChildListMutation(Node& target)
+ MutationObserverInterestGroup(HashMap<MutationObserver*, MutationRecordDeliveryOptions>&&, MutationRecordDeliveryOptions);
+
+ static std::unique_ptr<MutationObserverInterestGroup> createForChildListMutation(Node& target)
{
if (!target.document().hasMutationObserversOfType(MutationObserver::ChildList))
return nullptr;
@@ -50,7 +53,7 @@ public:
return createIfNeeded(target, MutationObserver::ChildList, oldValueFlag);
}
- static PassOwnPtr<MutationObserverInterestGroup> createForCharacterDataMutation(Node& target)
+ static std::unique_ptr<MutationObserverInterestGroup> createForCharacterDataMutation(Node& target)
{
if (!target.document().hasMutationObserversOfType(MutationObserver::CharacterData))
return nullptr;
@@ -58,7 +61,7 @@ public:
return createIfNeeded(target, MutationObserver::CharacterData, MutationObserver::CharacterDataOldValue);
}
- static PassOwnPtr<MutationObserverInterestGroup> createForAttributesMutation(Node& target, const QualifiedName& attributeName)
+ static std::unique_ptr<MutationObserverInterestGroup> createForAttributesMutation(Node& target, const QualifiedName& attributeName)
{
if (!target.document().hasMutationObserversOfType(MutationObserver::Attributes))
return nullptr;
@@ -66,19 +69,16 @@ public:
return createIfNeeded(target, MutationObserver::Attributes, MutationObserver::AttributeOldValue, &attributeName);
}
- bool isOldValueRequested();
- void enqueueMutationRecord(PassRefPtr<MutationRecord>);
+ bool isOldValueRequested() const;
+ void enqueueMutationRecord(Ref<MutationRecord>&&);
private:
- static PassOwnPtr<MutationObserverInterestGroup> createIfNeeded(Node& target, MutationObserver::MutationType, MutationRecordDeliveryOptions oldValueFlag, const QualifiedName* attributeName = 0);
- MutationObserverInterestGroup(HashMap<MutationObserver*, MutationRecordDeliveryOptions>& observers, MutationRecordDeliveryOptions oldValueFlag);
+ static std::unique_ptr<MutationObserverInterestGroup> createIfNeeded(Node& target, MutationObserver::MutationType, MutationRecordDeliveryOptions oldValueFlag, const QualifiedName* attributeName = nullptr);
- bool hasOldValue(MutationRecordDeliveryOptions options) { return options & m_oldValueFlag; }
+ bool hasOldValue(MutationRecordDeliveryOptions options) const { return options & m_oldValueFlag; }
HashMap<MutationObserver*, MutationRecordDeliveryOptions> m_observers;
MutationRecordDeliveryOptions m_oldValueFlag;
};
-}
-
-#endif // MutationObserverInterestGroup_h
+} // namespace WebCore