| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "core/dom/DOMTokenList.h" | 28 #include "core/dom/DOMTokenList.h" |
| 29 #include "core/dom/SpaceSplitString.h" | 29 #include "core/dom/SpaceSplitString.h" |
| 30 #include "platform/heap/Handle.h" | 30 #include "platform/heap/Handle.h" |
| 31 #include "wtf/RefCounted.h" | 31 #include "wtf/RefCounted.h" |
| 32 #include "wtf/text/AtomicString.h" | 32 #include "wtf/text/AtomicString.h" |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class ExceptionState; | 36 class ExceptionState; |
| 37 | 37 |
| 38 class DOMSettableTokenListObserver { | 38 class DOMSettableTokenListObserver : public WillBeGarbageCollectedMixin { |
| 39 public: | 39 public: |
| 40 virtual void valueChanged() = 0; | 40 virtual void valueChanged() = 0; |
| 41 |
| 42 DEFINE_INLINE_VIRTUAL_TRACE() { } |
| 41 }; | 43 }; |
| 42 | 44 |
| 43 class DOMSettableTokenList final | 45 class DOMSettableTokenList final |
| 44 : public DOMTokenList | 46 : public DOMTokenList |
| 45 #if !ENABLE(OILPAN) | 47 #if !ENABLE(OILPAN) |
| 46 , public RefCounted<DOMSettableTokenList> | 48 , public RefCounted<DOMSettableTokenList> |
| 47 #endif | 49 #endif |
| 48 { | 50 { |
| 49 DEFINE_WRAPPERTYPEINFO(); | 51 DEFINE_WRAPPERTYPEINFO(); |
| 50 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(DOMSettableTokenList); | 52 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(DOMSettableTokenList); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 65 | 67 |
| 66 virtual void add(const Vector<String>&, ExceptionState&) override; | 68 virtual void add(const Vector<String>&, ExceptionState&) override; |
| 67 virtual void remove(const Vector<String>&, ExceptionState&) override; | 69 virtual void remove(const Vector<String>&, ExceptionState&) override; |
| 68 | 70 |
| 69 virtual const AtomicString& value() const override { return m_value; } | 71 virtual const AtomicString& value() const override { return m_value; } |
| 70 virtual void setValue(const AtomicString&) override; | 72 virtual void setValue(const AtomicString&) override; |
| 71 | 73 |
| 72 const SpaceSplitString& tokens() const { return m_tokens; } | 74 const SpaceSplitString& tokens() const { return m_tokens; } |
| 73 void setObserver(DOMSettableTokenListObserver* observer) { m_observer = obse
rver; }; | 75 void setObserver(DOMSettableTokenListObserver* observer) { m_observer = obse
rver; }; |
| 74 | 76 |
| 77 DECLARE_VIRTUAL_TRACE(); |
| 78 |
| 75 protected: | 79 protected: |
| 76 DOMSettableTokenList(DOMSettableTokenListObserver*); | 80 explicit DOMSettableTokenList(DOMSettableTokenListObserver*); |
| 77 | 81 |
| 78 private: | 82 private: |
| 79 virtual void addInternal(const AtomicString&) override; | 83 virtual void addInternal(const AtomicString&) override; |
| 80 virtual bool containsInternal(const AtomicString&) const override; | 84 virtual bool containsInternal(const AtomicString&) const override; |
| 81 virtual void removeInternal(const AtomicString&) override; | 85 virtual void removeInternal(const AtomicString&) override; |
| 82 | 86 |
| 83 AtomicString m_value; | 87 AtomicString m_value; |
| 84 SpaceSplitString m_tokens; | 88 SpaceSplitString m_tokens; |
| 85 DOMSettableTokenListObserver* m_observer; | 89 RawPtrWillBeWeakMember<DOMSettableTokenListObserver> m_observer; |
| 86 }; | 90 }; |
| 87 | 91 |
| 88 } // namespace blink | 92 } // namespace blink |
| 89 | 93 |
| 90 #endif // DOMSettableTokenList_h | 94 #endif // DOMSettableTokenList_h |
| OLD | NEW |