diff options
Diffstat (limited to 'webkit/api')
-rw-r--r-- | webkit/api/public/WebStorageArea.h | 7 | ||||
-rw-r--r-- | webkit/api/src/StorageAreaProxy.cpp | 7 | ||||
-rw-r--r-- | webkit/api/src/StorageAreaProxy.h | 2 | ||||
-rw-r--r-- | webkit/api/src/WebStorageAreaImpl.cpp | 12 | ||||
-rw-r--r-- | webkit/api/src/WebStorageAreaImpl.h | 2 |
5 files changed, 9 insertions, 21 deletions
diff --git a/webkit/api/public/WebStorageArea.h b/webkit/api/public/WebStorageArea.h index 6febe35..664b418 100644 --- a/webkit/api/public/WebStorageArea.h +++ b/webkit/api/public/WebStorageArea.h @@ -59,10 +59,9 @@ namespace WebKit { 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; + // Indexes may change on any set/removeItem call. Will return null if the index + // provided is out of range. + virtual WebString key(unsigned index) = 0; // Get the value that corresponds to a specific key. This returns null if there is // no entry for that key. diff --git a/webkit/api/src/StorageAreaProxy.cpp b/webkit/api/src/StorageAreaProxy.cpp index 0709a2b..4e56372 100644 --- a/webkit/api/src/StorageAreaProxy.cpp +++ b/webkit/api/src/StorageAreaProxy.cpp @@ -51,12 +51,9 @@ unsigned StorageAreaProxy::length() const return m_storageArea->length(); } -String StorageAreaProxy::key(unsigned index, ExceptionCode& ec) const +String StorageAreaProxy::key(unsigned index) const { - bool keyException = false; - String value = m_storageArea->key(index, keyException); - ec = keyException ? INDEX_SIZE_ERR : 0; - return value; + return m_storageArea->key(index); } String StorageAreaProxy::getItem(const String& key) const diff --git a/webkit/api/src/StorageAreaProxy.h b/webkit/api/src/StorageAreaProxy.h index 6b6b565..172bd49 100644 --- a/webkit/api/src/StorageAreaProxy.h +++ b/webkit/api/src/StorageAreaProxy.h @@ -41,7 +41,7 @@ namespace WebCore { // The HTML5 DOM Storage API virtual unsigned length() const; - virtual String key(unsigned index, ExceptionCode& ec) const; + virtual String key(unsigned index) const; virtual String getItem(const String& key) const; virtual void setItem(const String& key, const String& value, ExceptionCode& ec, Frame* sourceFrame); virtual void removeItem(const String& key, Frame* sourceFrame); diff --git a/webkit/api/src/WebStorageAreaImpl.cpp b/webkit/api/src/WebStorageAreaImpl.cpp index 6a5a762..13f79d2 100644 --- a/webkit/api/src/WebStorageAreaImpl.cpp +++ b/webkit/api/src/WebStorageAreaImpl.cpp @@ -65,17 +65,9 @@ unsigned WebStorageAreaImpl::length() return m_storageArea->length(); } -WebString WebStorageAreaImpl::key(unsigned index, bool& keyException) +WebString WebStorageAreaImpl::key(unsigned index) { - 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; + return m_storageArea->key(index); } WebString WebStorageAreaImpl::getItem(const WebString& key) diff --git a/webkit/api/src/WebStorageAreaImpl.h b/webkit/api/src/WebStorageAreaImpl.h index 5e5ffc4..648ee3e 100644 --- a/webkit/api/src/WebStorageAreaImpl.h +++ b/webkit/api/src/WebStorageAreaImpl.h @@ -45,7 +45,7 @@ namespace WebKit { virtual void lock(bool& invalidateCache, size_t& bytesLeftInQuota); virtual void unlock(); virtual unsigned length(); - virtual WebString key(unsigned index, bool& keyException); + virtual WebString key(unsigned index); virtual WebString getItem(const WebString& key); virtual void setItem(const WebString& key, const WebString& value, bool& quotaException); virtual void removeItem(const WebString& key); |