summaryrefslogtreecommitdiffstats
path: root/WebCore/storage/StorageNamespaceImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/storage/StorageNamespaceImpl.cpp')
-rw-r--r--WebCore/storage/StorageNamespaceImpl.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/WebCore/storage/StorageNamespaceImpl.cpp b/WebCore/storage/StorageNamespaceImpl.cpp
index 19ff6b4..47b2958 100644
--- a/WebCore/storage/StorageNamespaceImpl.cpp
+++ b/WebCore/storage/StorageNamespaceImpl.cpp
@@ -35,6 +35,10 @@
#include "StorageSyncManager.h"
#include <wtf/StdLibExtras.h>
+#ifdef ANDROID
+#include "Page.h"
+#endif
+
namespace WebCore {
typedef HashMap<String, StorageNamespace*> LocalStorageNamespaceMap;
@@ -137,6 +141,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.