summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/IdTargetObserverRegistry.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/dom/IdTargetObserverRegistry.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
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