Commit ddfe27a8 authored by beidson@apple.com's avatar beidson@apple.com

2008-05-05 Brady Eidson <beidson@apple.com>

        Reviewed by Sam Weinig

        Fix a bug in StorageMap iterator tracking where the iterator was not successfully
        invalidated at an appropriate time.

        * storage/StorageMap.cpp:
        (WebCore::StorageMap::setItem): ALWAYS invalidate it here



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32884 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 692743d4
2008-05-05 Brady Eidson <beidson@apple.com>
Reviewed by Sam Weinig
Fix a bug in StorageMap iterator tracking where the iterator was not successfully
invalidated at an appropriate time.
* storage/StorageMap.cpp:
(WebCore::StorageMap::setItem): ALWAYS invalidate it here
2008-05-05 Justin Garcia <justin.garcia@apple.com>
Reviewed by Darin.
......@@ -111,16 +111,15 @@ PassRefPtr<StorageMap> StorageMap::setItem(const String& key, const String& valu
pair<HashMap<String, String>::iterator, bool> addResult = m_map.add(key, value);
if (addResult.second) {
// If the add succeeded, the map has been mutated and the iterator needs to be invalidated
invalidateIterator();
// Plus, there was no "oldValue" so null it out.
// There was no "oldValue" so null it out.
oldValue = String();
} else {
oldValue = addResult.first->second;
m_map.set(key, value);
}
invalidateIterator();
return 0;
}
......
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