summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/IdTargetObserverRegistry.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/IdTargetObserverRegistry.h')
-rw-r--r--Source/WebCore/dom/IdTargetObserverRegistry.h15
1 files changed, 6 insertions, 9 deletions
diff --git a/Source/WebCore/dom/IdTargetObserverRegistry.h b/Source/WebCore/dom/IdTargetObserverRegistry.h
index 29c40f763..edac13dd6 100644
--- a/Source/WebCore/dom/IdTargetObserverRegistry.h
+++ b/Source/WebCore/dom/IdTargetObserverRegistry.h
@@ -23,13 +23,12 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef IdTargetObserverRegistry_h
-#define IdTargetObserverRegistry_h
+#pragma once
+#include <memory>
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
#include <wtf/HashSet.h>
-#include <wtf/PassOwnPtr.h>
#include <wtf/text/AtomicString.h>
namespace WebCore {
@@ -40,20 +39,20 @@ class IdTargetObserverRegistry {
WTF_MAKE_FAST_ALLOCATED;
friend class IdTargetObserver;
public:
- static PassOwnPtr<IdTargetObserverRegistry> create();
+ IdTargetObserverRegistry() { }
+
void notifyObservers(const AtomicString& id);
void notifyObservers(const AtomicStringImpl& id);
private:
- IdTargetObserverRegistry() : m_notifyingObserversInSet(0) { }
void addObserver(const AtomicString& id, IdTargetObserver*);
void removeObserver(const AtomicString& id, IdTargetObserver*);
void notifyObserversInternal(const AtomicStringImpl& id);
typedef HashSet<IdTargetObserver*> ObserverSet;
- typedef HashMap<const AtomicStringImpl*, OwnPtr<ObserverSet>> IdToObserverSetMap;
+ typedef HashMap<const AtomicStringImpl*, std::unique_ptr<ObserverSet>> IdToObserverSetMap;
IdToObserverSetMap m_registry;
- ObserverSet* m_notifyingObserversInSet;
+ ObserverSet* m_notifyingObserversInSet { nullptr };
};
inline void IdTargetObserverRegistry::notifyObservers(const AtomicString& id)
@@ -72,5 +71,3 @@ inline void IdTargetObserverRegistry::notifyObservers(const AtomicStringImpl& id
}
} // namespace WebCore
-
-#endif // IdTargetObserverRegistry_h