diff options
author | Ben Murdoch <benm@google.com> | 2011-03-04 10:24:10 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-03-09 20:36:47 +0000 |
commit | 1d7cc17ccbeabb654e416c598e2631ff691166ca (patch) | |
tree | c6e3636a1799ccede01c9aebb0ca777e0fba09ab /WebCore/storage/StorageNamespaceImpl.cpp | |
parent | 12db9a6492824cedb54ec0cd640e686a7af09e91 (diff) | |
download | external_webkit-1d7cc17ccbeabb654e416c598e2631ff691166ca.zip external_webkit-1d7cc17ccbeabb654e416c598e2631ff691166ca.tar.gz external_webkit-1d7cc17ccbeabb654e416c598e2631ff691166ca.tar.bz2 |
Clear DOM storage when clearing other cached data.
Empty out DOM local and session storage in addition to HTML5
database and app cache when we get a request from java to
delete cached data.
Bug: 2117649
Change-Id: I5b6ee075d2a8fb44ee373ad4462a33623c9c2460
Diffstat (limited to 'WebCore/storage/StorageNamespaceImpl.cpp')
-rw-r--r-- | WebCore/storage/StorageNamespaceImpl.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/WebCore/storage/StorageNamespaceImpl.cpp b/WebCore/storage/StorageNamespaceImpl.cpp index 3a21489..68508a7 100644 --- a/WebCore/storage/StorageNamespaceImpl.cpp +++ b/WebCore/storage/StorageNamespaceImpl.cpp @@ -35,6 +35,10 @@ #include <wtf/StdLibExtras.h> #include <wtf/text/StringHash.h> +#ifdef ANDROID +#include "Page.h" +#endif + namespace WebCore { typedef HashMap<String, StorageNamespace*> LocalStorageNamespaceMap; @@ -139,6 +143,25 @@ void StorageNamespaceImpl::close() m_isShutdown = true; } +#ifdef ANDROID +void StorageNamespaceImpl::clear(Page* page) +{ + ASSERT(isMainThread()); + if (m_isShutdown) + return; + + // Clear all the keys for each of the storage areas. + StorageAreaMap::iterator end = m_storageAreaMap.end(); + for (StorageAreaMap::iterator it = m_storageAreaMap.begin(); it != end; ++it) { + // if there is no page provided, then the user tried to clear storage + // with only pages in private browsing mode open. So we do not need to + // provide a Frame* here (as the frame is only used to dispatch storage events + // and private browsing pages won't be using them). + it->second->clear(page ? page->mainFrame() : 0); + } +} +#endif + void StorageNamespaceImpl::unlock() { // Because there's a single event loop per-process, this is a no-op. |