summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DEPS2
-rw-r--r--chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc6
-rw-r--r--chrome/common/render_messages_internal.h4
-rw-r--r--chrome/renderer/renderer_webstoragearea_impl.cc8
-rw-r--r--chrome/renderer/renderer_webstoragearea_impl.h2
-rw-r--r--webkit/api/public/WebStorageArea.h7
-rw-r--r--webkit/api/src/StorageAreaProxy.cpp7
-rw-r--r--webkit/api/src/StorageAreaProxy.h2
-rw-r--r--webkit/api/src/WebStorageAreaImpl.cpp12
-rw-r--r--webkit/api/src/WebStorageAreaImpl.h2
10 files changed, 20 insertions, 32 deletions
diff --git a/DEPS b/DEPS
index 90309ef..f4543e5 100644
--- a/DEPS
+++ b/DEPS
@@ -1,7 +1,7 @@
vars = {
"webkit_trunk":
"http://svn.webkit.org/repository/webkit/trunk",
- "webkit_revision": "47010",
+ "webkit_revision": "47020",
}
diff --git a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
index 5a7c169..d6aff32 100644
--- a/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
+++ b/chrome/browser/in_process_webkit/dom_storage_dispatcher_host.cc
@@ -261,11 +261,11 @@ void DOMStorageDispatcherHost::OnKey(int64 storage_area_id, unsigned index,
}
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::WEBKIT));
- bool key_exception = false;
WebStorageArea* storage_area = GetStorageArea(storage_area_id);
CHECK(storage_area); // TODO(jorlow): Do better than this.
- string16 key = storage_area->key(index, key_exception);
- ViewHostMsg_DOMStorageKey::WriteReplyParams(reply_msg, key_exception, key);
+ WebString key = storage_area->key(index);
+ ViewHostMsg_DOMStorageKey::WriteReplyParams(reply_msg, (string16)key,
+ key.isNull());
Send(reply_msg);
}
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 22cd1c0..d831654 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -1575,8 +1575,8 @@ IPC_BEGIN_MESSAGES(ViewHost)
IPC_SYNC_MESSAGE_CONTROL2_2(ViewHostMsg_DOMStorageKey,
int64 /* storage_area_id */,
unsigned /* index */,
- bool /* key_exception */,
- string16 /* key */)
+ string16 /* key */,
+ bool /* key_is_null */)
// Get a value based on a key from a storage area.
// TODO(jorlow): Convert value + value_is_null over to a NullableString16
diff --git a/chrome/renderer/renderer_webstoragearea_impl.cc b/chrome/renderer/renderer_webstoragearea_impl.cc
index c438cdfe..14f2273 100644
--- a/chrome/renderer/renderer_webstoragearea_impl.cc
+++ b/chrome/renderer/renderer_webstoragearea_impl.cc
@@ -45,18 +45,18 @@ unsigned RendererWebStorageAreaImpl::length() {
return length;
}
-WebKit::WebString RendererWebStorageAreaImpl::key(unsigned index,
- bool& key_exception) {
+WebKit::WebString RendererWebStorageAreaImpl::key(unsigned index) {
EnsureInitializedAndLocked();
// Right now this is always sync. We may want to optimize this by fetching
// chunks of keys rather than single keys (and flushing the cache on every
// mutation of the storage area) since this will most often be used to fetch
// all the keys at once.
string16 key;
+ bool key_is_null;
RenderThread::current()->Send(
new ViewHostMsg_DOMStorageKey(storage_area_id_, index,
- &key_exception, &key));
- return key;
+ &key, &key_is_null));
+ return key_is_null ? WebKit::WebString() : WebKit::WebString(key);
}
WebKit::WebString RendererWebStorageAreaImpl::getItem(
diff --git a/chrome/renderer/renderer_webstoragearea_impl.h b/chrome/renderer/renderer_webstoragearea_impl.h
index 0a313c2..0b734e8 100644
--- a/chrome/renderer/renderer_webstoragearea_impl.h
+++ b/chrome/renderer/renderer_webstoragearea_impl.h
@@ -21,7 +21,7 @@ class RendererWebStorageAreaImpl : public WebKit::WebStorageArea {
virtual void lock(bool& invalidate_cache, size_t& bytes_left_in_quota);
virtual void unlock();
virtual unsigned length();
- virtual WebKit::WebString key(unsigned index, bool& key_exception);
+ virtual WebKit::WebString key(unsigned index);
virtual WebKit::WebString getItem(const WebKit::WebString& key);
virtual void setItem(const WebKit::WebString& key,
const WebKit::WebString& value,
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);