summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-16 23:48:33 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-16 23:48:33 +0000
commit9b9f2e5d435484c6cb05c6a47604cbd0022455df (patch)
treeb0599078f3d10885d1857026343e18df1d7b5a98
parentbee5aebd4e8059b96005feb913c0cf5833528b90 (diff)
downloadchromium_src-9b9f2e5d435484c6cb05c6a47604cbd0022455df.zip
chromium_src-9b9f2e5d435484c6cb05c6a47604cbd0022455df.tar.gz
chromium_src-9b9f2e5d435484c6cb05c6a47604cbd0022455df.tar.bz2
Add the WebKit API for DOM Storage. This is used to re-enter WebKit. A later patch will implement the WebKitClient version of it.
BUG=4360 TEST=none Review URL: http://codereview.chromium.org/149716 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20918 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/api/public/WebStorageArea.h85
-rw-r--r--webkit/api/public/WebStorageNamespace.h69
-rw-r--r--webkit/api/src/WebStorageAreaImpl.cpp113
-rw-r--r--webkit/api/src/WebStorageAreaImpl.h62
-rw-r--r--webkit/api/src/WebStorageNamespaceImpl.cpp80
-rw-r--r--webkit/api/src/WebStorageNamespaceImpl.h57
-rw-r--r--webkit/webkit.gyp6
7 files changed, 472 insertions, 0 deletions
diff --git a/webkit/api/public/WebStorageArea.h b/webkit/api/public/WebStorageArea.h
new file mode 100644
index 0000000..6febe35
--- /dev/null
+++ b/webkit/api/public/WebStorageArea.h
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebStorageArea_h
+#define WebStorageArea_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+ class WebString;
+
+ // In WebCore, there's one distinct StorageArea per origin per StorageNamespace. This
+ // class wraps a StorageArea. With the possible exception of lock/unlock all of these
+ // methods map very obviously to the WebStorage (often called DOM Storage) spec.
+ // http://dev.w3.org/html5/webstorage/
+ class WebStorageArea {
+ public:
+ virtual ~WebStorageArea() { }
+
+ // Lock the storage area. Before calling any other other methods on this interface,
+ // you should always call lock and wait for it to return. InvalidateCache tells you
+ // that since the last time you locked the cache, someone else has modified it.
+ // BytesLeftInQuota tells you how many bytes are currently unused in the quota.
+ // These are both optimizations and can be ignored if you'd like.
+ virtual void lock(bool& invalidateCache, size_t& bytesLeftInQuota) = 0;
+
+ // Unlock the storage area. You should call this at the end of the JavaScript context
+ // or when you're about to execute anything synchronous per the DOM Storage spec.
+ virtual void unlock() = 0;
+
+ // The number of key/value pairs in the storage area.
+ virtual unsigned length() = 0;
+
+ // Get a value for a specific key. Valid key indices are 0 through length() - 1.
+ // Indexes may change on any set/removeItem call. KeyException is true if the
+ // index provided was out of range. When KeyException is true, the returned
+ // string is undefined.
+ virtual WebString key(unsigned index, bool& keyException) = 0;
+
+ // Get the value that corresponds to a specific key. This returns null if there is
+ // no entry for that key.
+ virtual WebString getItem(const WebString& key) = 0;
+
+ // Set the value that corresponds to a specific key. QuotaException is set if we've
+ // the StorageArea would have exceeded its quota. The value is NOT set when there's
+ // an exception.
+ virtual void setItem(const WebString& key, const WebString& value, bool& quotaException) = 0;
+
+ // Remove the value associated with a particular key.
+ virtual void removeItem(const WebString& key) = 0;
+
+ // Clear all key/value pairs.
+ virtual void clear() = 0;
+ };
+
+} // namespace WebKit
+
+#endif // WebStorageArea_h
diff --git a/webkit/api/public/WebStorageNamespace.h b/webkit/api/public/WebStorageNamespace.h
new file mode 100644
index 0000000..362e41e1
--- /dev/null
+++ b/webkit/api/public/WebStorageNamespace.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebStorageNamespace_h
+#define WebStorageNamespace_h
+
+#include "WebCommon.h"
+
+namespace WebKit {
+ class WebStorageArea;
+ class WebString;
+
+ // WebStorageNamespace represents a collection of StorageAreas. Typically, you'll have
+ // multiple StorageNamespaces to represent the SessionStorage for each tab and a single
+ // StorageNamespace to represent LocalStorage for the entire browser.
+ class WebStorageNamespace {
+ public:
+ // Create a new WebStorageNamespace. LocalStorageNamespaces require a path to specify
+ // where the SQLite databases that make LocalStorage data persistent are located.
+ // If path is empty, data will not persist. You should call delete on the returned
+ // object when you're finished.
+ WEBKIT_API static WebStorageNamespace* createLocalStorageNamespace(const WebString& backingDirectoryPath);
+ WEBKIT_API static WebStorageNamespace* createSessionStorageNamespace();
+
+ virtual ~WebStorageNamespace() { }
+
+ // Create a new WebStorageArea object. Two subsequent calls with the same origin
+ // will return two different WebStorageArea objects that share the same backing store.
+ // You should call delete on the returned object when you're finished.
+ virtual WebStorageArea* createStorageArea(const WebString& origin) = 0;
+
+ // Copy a StorageNamespace. This only makes sense in the case of SessionStorage.
+ virtual WebStorageNamespace* copy() = 0;
+
+ // Shutdown the StorageNamespace. Write all StorageArea's to disk and disallow new
+ // write activity.
+ virtual void close() = 0;
+ };
+
+} // namespace WebKit
+
+#endif // WebStorageNamespace_h
diff --git a/webkit/api/src/WebStorageAreaImpl.cpp b/webkit/api/src/WebStorageAreaImpl.cpp
new file mode 100644
index 0000000..6a5a762
--- /dev/null
+++ b/webkit/api/src/WebStorageAreaImpl.cpp
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebStorageAreaImpl.h"
+
+#if ENABLE(DOM_STORAGE)
+
+#include "ExceptionCode.h"
+#include "WebString.h"
+
+namespace WebKit {
+
+WebStorageAreaImpl::WebStorageAreaImpl(PassRefPtr<WebCore::StorageArea> storageArea)
+ : m_storageArea(storageArea)
+{
+}
+
+WebStorageAreaImpl::~WebStorageAreaImpl()
+{
+}
+
+void WebStorageAreaImpl::lock(bool& invalidateCache, size_t& bytesLeftInQuota)
+{
+ // FIXME: Enable locking. http://crbug.com/16877
+ invalidateCache = false;
+ // FIXME: Enable quota support. http://crbug.com/16876
+ bytesLeftInQuota = 0;
+}
+
+void WebStorageAreaImpl::unlock()
+{
+ // FIXME: Enable locking. http://crbug.com/16877
+}
+
+unsigned WebStorageAreaImpl::length()
+{
+ return m_storageArea->length();
+}
+
+WebString WebStorageAreaImpl::key(unsigned index, bool& keyException)
+{
+ int exceptionCode = 0;
+ WebString value = m_storageArea->key(index, exceptionCode);
+ if (exceptionCode != 0) {
+ ASSERT(exceptionCode == WebCore::INDEX_SIZE_ERR);
+ keyException = true;
+ } else {
+ keyException = false;
+ }
+ return value;
+}
+
+WebString WebStorageAreaImpl::getItem(const WebString& key)
+{
+ return m_storageArea->getItem(key);
+}
+
+void WebStorageAreaImpl::setItem(const WebString& key, const WebString& value, bool& quotaException)
+{
+ int exceptionCode = 0;
+ // FIXME: Can we do any better than just passing 0 for the frame?
+ m_storageArea->setItem(key, value, exceptionCode, 0);
+ if (exceptionCode != 0) {
+ ASSERT(exceptionCode == WebCore::QUOTA_EXCEEDED_ERR);
+ quotaException = true;
+ } else {
+ quotaException = false;
+ }
+}
+
+void WebStorageAreaImpl::removeItem(const WebString& key)
+{
+ // FIXME: Can we do any better than just passing 0 for the frame?
+ m_storageArea->removeItem(key, 0);
+}
+
+void WebStorageAreaImpl::clear()
+{
+ // FIXME: Can we do any better than just passing 0 for the frame?
+ m_storageArea->clear(0);
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(DOM_STORAGE)
diff --git a/webkit/api/src/WebStorageAreaImpl.h b/webkit/api/src/WebStorageAreaImpl.h
new file mode 100644
index 0000000..5e5ffc4
--- /dev/null
+++ b/webkit/api/src/WebStorageAreaImpl.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebStorageAreaImpl_h
+#define WebStorageAreaImpl_h
+
+#if ENABLE(DOM_STORAGE)
+
+#include "StorageAreaImpl.h"
+#include "WebStorageArea.h"
+
+namespace WebKit {
+
+ class WebStorageAreaImpl : public WebStorageArea {
+ public:
+ WebStorageAreaImpl(PassRefPtr<WebCore::StorageArea> storageArea);
+ virtual ~WebStorageAreaImpl();
+ virtual void lock(bool& invalidateCache, size_t& bytesLeftInQuota);
+ virtual void unlock();
+ virtual unsigned length();
+ virtual WebString key(unsigned index, bool& keyException);
+ virtual WebString getItem(const WebString& key);
+ virtual void setItem(const WebString& key, const WebString& value, bool& quotaException);
+ virtual void removeItem(const WebString& key);
+ virtual void clear();
+
+ private:
+ RefPtr<WebCore::StorageArea> m_storageArea;
+ };
+
+} // namespace WebKit
+
+#endif // ENABLE(DOM_STORAGE)
+
+#endif // WebStorageAreaImpl_h
diff --git a/webkit/api/src/WebStorageNamespaceImpl.cpp b/webkit/api/src/WebStorageNamespaceImpl.cpp
new file mode 100644
index 0000000..e6fa684
--- /dev/null
+++ b/webkit/api/src/WebStorageNamespaceImpl.cpp
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebStorageNamespaceImpl.h"
+
+#if ENABLE(DOM_STORAGE)
+
+#include "SecurityOrigin.h"
+
+#include "WebStorageAreaImpl.h"
+#include "WebString.h"
+
+namespace WebKit {
+
+WebStorageNamespace* WebStorageNamespace::createLocalStorageNamespace(const WebString& path)
+{
+ return new WebStorageNamespaceImpl(WebCore::StorageNamespaceImpl::localStorageNamespace(path));
+}
+
+WebStorageNamespace* WebStorageNamespace::createSessionStorageNamespace()
+{
+ return new WebStorageNamespaceImpl(WebCore::StorageNamespaceImpl::sessionStorageNamespace());
+}
+
+WebStorageNamespaceImpl::WebStorageNamespaceImpl(PassRefPtr<WebCore::StorageNamespace> storageNamespace)
+ : m_storageNamespace(storageNamespace)
+{
+}
+
+WebStorageNamespaceImpl::~WebStorageNamespaceImpl()
+{
+}
+
+WebStorageArea* WebStorageNamespaceImpl::createStorageArea(const WebString& originString)
+{
+ RefPtr<WebCore::SecurityOrigin> origin = WebCore::SecurityOrigin::createFromString(originString);
+ return new WebStorageAreaImpl(m_storageNamespace->storageArea(origin.get()));
+}
+
+WebStorageNamespace* WebStorageNamespaceImpl::copy()
+{
+ return new WebStorageNamespaceImpl(m_storageNamespace->copy());
+}
+
+void WebStorageNamespaceImpl::close()
+{
+ m_storageNamespace->close();
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(DOM_STORAGE)
diff --git a/webkit/api/src/WebStorageNamespaceImpl.h b/webkit/api/src/WebStorageNamespaceImpl.h
new file mode 100644
index 0000000..a0a3b6e
--- /dev/null
+++ b/webkit/api/src/WebStorageNamespaceImpl.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebStorageNamespaceImpl_h
+#define WebStorageNamespaceImpl_h
+
+#if ENABLE(DOM_STORAGE)
+
+#include "StorageNamespaceImpl.h"
+#include "WebStorageNamespace.h"
+
+namespace WebKit {
+
+ class WebStorageNamespaceImpl : public WebStorageNamespace {
+ public:
+ WebStorageNamespaceImpl(PassRefPtr<WebCore::StorageNamespace> storageNamespace);
+ virtual ~WebStorageNamespaceImpl();
+ virtual WebStorageArea* createStorageArea(const WebString& origin);
+ virtual WebStorageNamespace* copy();
+ virtual void close();
+
+ private:
+ RefPtr<WebCore::StorageNamespace> m_storageNamespace;
+ };
+
+} // namespace WebKit
+
+#endif // ENABLE(DOM_STORAGE)
+
+#endif // WebStorageNamespaceImpl_h
diff --git a/webkit/webkit.gyp b/webkit/webkit.gyp
index 5c9c718..52c33ff 100644
--- a/webkit/webkit.gyp
+++ b/webkit/webkit.gyp
@@ -1024,6 +1024,8 @@
'api/public/WebScreenInfo.h',
'api/public/WebScriptSource.h',
'api/public/WebSize.h',
+ 'api/public/WebStorageArea.h',
+ 'api/public/WebStorageNamespace.h',
'api/public/WebString.h',
'api/public/WebTextDirection.h',
'api/public/WebURL.h',
@@ -1067,6 +1069,10 @@
'api/src/WebMediaPlayerClientImpl.h',
'api/src/WebPluginListBuilderImpl.cpp',
'api/src/WebPluginListBuilderImpl.h',
+ 'api/src/WebStorageAreaImpl.cpp',
+ 'api/src/WebStorageAreaImpl.h',
+ 'api/src/WebStorageNamespaceImpl.cpp',
+ 'api/src/WebStorageNamespaceImpl.h',
'api/src/WebString.cpp',
'api/src/WebURL.cpp',
'api/src/WebURLRequest.cpp',