diff options
Diffstat (limited to 'Source/WebCore/dom/DOMNamedFlowCollection.h')
-rw-r--r-- | Source/WebCore/dom/DOMNamedFlowCollection.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/Source/WebCore/dom/DOMNamedFlowCollection.h b/Source/WebCore/dom/DOMNamedFlowCollection.h index 62c8ca022..bbd74a099 100644 --- a/Source/WebCore/dom/DOMNamedFlowCollection.h +++ b/Source/WebCore/dom/DOMNamedFlowCollection.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. + * Copyright (C) 2016 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,42 +27,41 @@ * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ -#ifndef DOMNamedFlowCollection_h -#define DOMNamedFlowCollection_h -#include "NamedFlowCollection.h" -#include <wtf/ListHashSet.h> -#include <wtf/PassRefPtr.h> +#pragma once + +#include <wtf/Forward.h> +#include <wtf/HashSet.h> #include <wtf/RefCounted.h> #include <wtf/Vector.h> namespace WebCore { -class Document; class WebKitNamedFlow; class DOMNamedFlowCollection : public RefCounted<DOMNamedFlowCollection> { public: - static PassRefPtr<DOMNamedFlowCollection> create(const Vector<WebKitNamedFlow*>& namedFlows) - { - return adoptRef(new DOMNamedFlowCollection(namedFlows)); - } - - unsigned long length() const; - PassRefPtr<WebKitNamedFlow> item(unsigned long index) const; - PassRefPtr<WebKitNamedFlow> namedItem(const AtomicString& name) const; + static Ref<DOMNamedFlowCollection> create(Vector<Ref<WebKitNamedFlow>>&&); + ~DOMNamedFlowCollection(); - bool hasNamedItem(const AtomicString& name) const; + unsigned length() const; + WebKitNamedFlow* item(unsigned index) const; + WebKitNamedFlow* namedItem(const AtomicString& name) const; + const Vector<AtomicString>& supportedPropertyNames(); private: - struct DOMNamedFlowHashFunctions; - struct DOMNamedFlowHashTranslator; + struct HashFunctions; + + explicit DOMNamedFlowCollection(Vector<Ref<WebKitNamedFlow>>&&); - typedef ListHashSet<RefPtr<WebKitNamedFlow>, 1, DOMNamedFlowHashFunctions> DOMNamedFlowSet; - explicit DOMNamedFlowCollection(const Vector<WebKitNamedFlow*>&); - DOMNamedFlowSet m_namedFlows; + const Vector<Ref<WebKitNamedFlow>> m_flows; + mutable HashSet<WebKitNamedFlow*, HashFunctions> m_flowsByName; + mutable Vector<AtomicString> m_flowNames; }; -} // namespace WebCore -#endif +inline unsigned DOMNamedFlowCollection::length() const +{ + return m_flows.size(); +} +} // namespace WebCore |