Commit 20eb50ca authored by alice.liu@apple.com's avatar alice.liu@apple.com

Add api for "remove" to WKMutableDictionary

https://bugs.webkit.org/show_bug.cgi?id=56157

Reviewed by Sam Weinig.

* Shared/API/c/WKMutableDictionary.cpp:
(WKDictionaryRemoveItem): Added; call remove on MutableDictionary impl.
* Shared/API/c/WKMutableDictionary.h:
* Shared/MutableDictionary.cpp:
(WebKit::MutableDictionary::remove): Added; call remove on the underlying hashmap.
* Shared/MutableDictionary.h:



git-svn-id: svn://svn.chromium.org/blink/trunk@80920 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 22b1d4fa
2011-03-11 Alice Liu <alice.liu@apple.com>
Reviewed by Sam Weinig.
Add api for "remove" to WKMutableDictionary
https://bugs.webkit.org/show_bug.cgi?id=56157
* Shared/API/c/WKMutableDictionary.cpp:
(WKDictionaryRemoveItem): Added; call remove on MutableDictionary impl.
* Shared/API/c/WKMutableDictionary.h:
* Shared/MutableDictionary.cpp:
(WebKit::MutableDictionary::remove): Added; call remove on the underlying hashmap.
* Shared/MutableDictionary.h:
2011-03-11 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r80899 and r80912.
......
......@@ -51,3 +51,8 @@ bool WKDictionarySetItem(WKMutableDictionaryRef dictionaryRef, WKStringRef keyRe
{
return toImpl(dictionaryRef)->set(toImpl(keyRef)->string(), toImpl(itemRef));
}
void WKDictionaryRemoveItem(WKMutableDictionaryRef dictionaryRef, WKStringRef keyRef)
{
toImpl(dictionaryRef)->remove(toImpl(keyRef)->string());
}
......@@ -42,6 +42,7 @@ WK_EXPORT bool WKDictionaryIsMutable(WKDictionaryRef dictionary);
WK_EXPORT bool WKDictionaryAddItem(WKMutableDictionaryRef dictionary, WKStringRef key, WKTypeRef item);
WK_EXPORT bool WKDictionarySetItem(WKMutableDictionaryRef dictionary, WKStringRef key, WKTypeRef item);
WK_EXPORT void WKDictionaryRemoveItem(WKMutableDictionaryRef dictionary, WKStringRef key);
#ifdef __cplusplus
}
......
......@@ -48,4 +48,9 @@ bool MutableDictionary::set(const String& key, APIObject* item)
return result.second;
}
void MutableDictionary::remove(const String& key)
{
m_map.remove(key);
}
} // namespace WebKit
......@@ -43,6 +43,7 @@ public:
bool add(const String& key, APIObject*);
bool set(const String& key, APIObject*);
void remove(const String& key);
virtual bool isMutable() { return true; }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment