| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010 Apple 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 18 matching lines...) Expand all Loading... |
| 29 #include "bindings/core/v8/ExceptionState.h" | 29 #include "bindings/core/v8/ExceptionState.h" |
| 30 #include "bindings/core/v8/ScriptWrappable.h" | 30 #include "bindings/core/v8/ScriptWrappable.h" |
| 31 #include "bindings/core/v8/V8Binding.h" | 31 #include "bindings/core/v8/V8Binding.h" |
| 32 #include "platform/heap/Handle.h" | 32 #include "platform/heap/Handle.h" |
| 33 #include "wtf/Noncopyable.h" | 33 #include "wtf/Noncopyable.h" |
| 34 #include "wtf/Vector.h" | 34 #include "wtf/Vector.h" |
| 35 #include "wtf/text/WTFString.h" | 35 #include "wtf/text/WTFString.h" |
| 36 | 36 |
| 37 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class Element; | |
| 40 | |
| 41 class DOMStringMap : public GarbageCollected<DOMStringMap>, | 39 class DOMStringMap : public GarbageCollected<DOMStringMap>, |
| 42 public ScriptWrappable { | 40 public ScriptWrappable { |
| 43 DEFINE_WRAPPERTYPEINFO(); | 41 DEFINE_WRAPPERTYPEINFO(); |
| 44 WTF_MAKE_NONCOPYABLE(DOMStringMap); | 42 WTF_MAKE_NONCOPYABLE(DOMStringMap); |
| 45 | 43 |
| 46 public: | 44 public: |
| 47 virtual void getNames(Vector<String>&) = 0; | 45 virtual void getNames(Vector<String>&) = 0; |
| 48 virtual String item(const String& name) = 0; | 46 virtual String item(const String& name) = 0; |
| 49 virtual bool contains(const String& name) = 0; | 47 virtual bool contains(const String& name) = 0; |
| 50 virtual void setItem(const String& name, | 48 virtual void setItem(const String& name, |
| 51 const String& value, | 49 const String& value, |
| 52 ExceptionState&) = 0; | 50 ExceptionState&) = 0; |
| 53 virtual bool deleteItem(const String& name) = 0; | 51 virtual bool deleteItem(const String& name) = 0; |
| 54 bool anonymousNamedSetter(const String& name, | 52 bool anonymousNamedSetter(const String& name, |
| 55 const String& value, | 53 const String& value, |
| 56 ExceptionState& exceptionState) { | 54 ExceptionState& exceptionState) { |
| 57 setItem(name, value, exceptionState); | 55 setItem(name, value, exceptionState); |
| 58 return true; | 56 return true; |
| 59 } | 57 } |
| 60 DeleteResult anonymousNamedDeleter(const AtomicString& name) { | 58 DeleteResult anonymousNamedDeleter(const AtomicString& name) { |
| 61 bool knownProperty = deleteItem(name); | 59 bool knownProperty = deleteItem(name); |
| 62 return knownProperty ? DeleteSuccess : DeleteUnknownProperty; | 60 return knownProperty ? DeleteSuccess : DeleteUnknownProperty; |
| 63 } | 61 } |
| 64 void namedPropertyEnumerator(Vector<String>& names, ExceptionState&) { | 62 void namedPropertyEnumerator(Vector<String>& names, ExceptionState&) { |
| 65 getNames(names); | 63 getNames(names); |
| 66 } | 64 } |
| 67 bool namedPropertyQuery(const AtomicString&, ExceptionState&); | 65 bool namedPropertyQuery(const AtomicString&, ExceptionState&); |
| 68 | 66 |
| 69 virtual Element* element() = 0; | |
| 70 | |
| 71 DEFINE_INLINE_VIRTUAL_TRACE() {} | 67 DEFINE_INLINE_VIRTUAL_TRACE() {} |
| 72 | 68 |
| 73 protected: | 69 protected: |
| 74 DOMStringMap() {} | 70 DOMStringMap() {} |
| 75 }; | 71 }; |
| 76 | 72 |
| 77 } // namespace blink | 73 } // namespace blink |
| 78 | 74 |
| 79 #endif // DOMStringMap_h | 75 #endif // DOMStringMap_h |
| OLD | NEW |