[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9
jorlow at chromium.org
jorlow at chromium.org
Thu Feb 4 21:25:03 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 6ac674cda94f56da7b1cf5e275031a349b142edd
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 22 20:33:41 2010 +0000
2010-01-21 Jeremy Orlow <jorlow at chromium.org>
Reviewed by Darin Fisher.
The Chromium WebKit API needs to expose storage event related data
https://bugs.webkit.org/show_bug.cgi?id=33985
setItem and removeItem on WebStorageArea need to expose what the previous
value was for the key being modified. Clear needs to return whether it
actually cleared anything.
* public/WebStorageArea.h:
(WebKit::WebStorageArea::setItem):
(WebKit::WebStorageArea::removeItem):
(WebKit::WebStorageArea::clear):
* src/StorageAreaProxy.cpp:
(WebCore::StorageAreaProxy::StorageAreaProxy):
(WebCore::StorageAreaProxy::setItem):
(WebCore::StorageAreaProxy::removeItem):
(WebCore::StorageAreaProxy::clear):
(WebCore::StorageAreaProxy::storageEvent):
* src/StorageAreaProxy.h:
* src/StorageNamespaceProxy.cpp:
(WebCore::StorageNamespace::localStorageNamespace):
(WebCore::StorageNamespace::sessionStorageNamespace):
(WebCore::StorageNamespaceProxy::StorageNamespaceProxy):
(WebCore::StorageNamespaceProxy::copy):
(WebCore::StorageNamespaceProxy::storageArea):
* src/StorageNamespaceProxy.h:
* src/WebStorageAreaImpl.cpp:
(WebKit::WebStorageAreaImpl::setItem):
(WebKit::WebStorageAreaImpl::removeItem):
(WebKit::WebStorageAreaImpl::clear):
* src/WebStorageAreaImpl.h:
2010-01-21 Jeremy Orlow <jorlow at chromium.org>
Reviewed by Darin Fisher.
The Chromium WebKit API needs to expose storage event related data
https://bugs.webkit.org/show_bug.cgi?id=33985
This change is not visible to layoutTests/web pages.
* storage/StorageArea.h:
* storage/StorageAreaImpl.cpp:
(WebCore::StorageAreaImpl::setItem): return the old value
(WebCore::StorageAreaImpl::removeItem): return the old value
(WebCore::StorageAreaImpl::clear): return whether there was anything to clear
* storage/StorageAreaImpl.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 225cda5..2f3d91b 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-01-21 Jeremy Orlow <jorlow at chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ The Chromium WebKit API needs to expose storage event related data
+ https://bugs.webkit.org/show_bug.cgi?id=33985
+
+ This change is not visible to layoutTests/web pages.
+
+ * storage/StorageArea.h:
+ * storage/StorageAreaImpl.cpp:
+ (WebCore::StorageAreaImpl::setItem): return the old value
+ (WebCore::StorageAreaImpl::removeItem): return the old value
+ (WebCore::StorageAreaImpl::clear): return whether there was anything to clear
+ * storage/StorageAreaImpl.h:
+
2010-01-22 Adele Peterson <adele at apple.com>
Reviewed by Dan Bernstein.
diff --git a/WebCore/storage/StorageArea.h b/WebCore/storage/StorageArea.h
index a64d44a..6081240 100644
--- a/WebCore/storage/StorageArea.h
+++ b/WebCore/storage/StorageArea.h
@@ -50,9 +50,9 @@ namespace WebCore {
virtual unsigned length() const = 0;
virtual String key(unsigned index) const = 0;
virtual String getItem(const String& key) const = 0;
- virtual void setItem(const String& key, const String& value, ExceptionCode& ec, Frame* sourceFrame) = 0;
- virtual void removeItem(const String& key, Frame* sourceFrame) = 0;
- virtual void clear(Frame* sourceFrame) = 0;
+ virtual String setItem(const String& key, const String& value, ExceptionCode& ec, Frame* sourceFrame) = 0;
+ virtual String removeItem(const String& key, Frame* sourceFrame) = 0;
+ virtual bool clear(Frame* sourceFrame) = 0;
virtual bool contains(const String& key) const = 0;
};
diff --git a/WebCore/storage/StorageAreaImpl.cpp b/WebCore/storage/StorageAreaImpl.cpp
index 8c2a29c..aa04781 100644
--- a/WebCore/storage/StorageAreaImpl.cpp
+++ b/WebCore/storage/StorageAreaImpl.cpp
@@ -128,7 +128,7 @@ String StorageAreaImpl::getItem(const String& key) const
return m_storageMap->getItem(key);
}
-void StorageAreaImpl::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame)
+String StorageAreaImpl::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame)
{
ASSERT(!m_isShutdown);
ASSERT(!value.isNull());
@@ -136,7 +136,7 @@ void StorageAreaImpl::setItem(const String& key, const String& value, ExceptionC
if (privateBrowsingEnabled(frame)) {
ec = QUOTA_EXCEEDED_ERR;
- return;
+ return String();
}
String oldValue;
@@ -147,24 +147,25 @@ void StorageAreaImpl::setItem(const String& key, const String& value, ExceptionC
if (quotaException) {
ec = QUOTA_EXCEEDED_ERR;
- return;
+ return oldValue;
}
if (oldValue == value)
- return;
+ return oldValue;
if (m_storageAreaSync)
m_storageAreaSync->scheduleItemForSync(key, value);
StorageEventDispatcher::dispatch(key, oldValue, value, m_storageType, m_securityOrigin.get(), frame);
+ return oldValue;
}
-void StorageAreaImpl::removeItem(const String& key, Frame* frame)
+String StorageAreaImpl::removeItem(const String& key, Frame* frame)
{
ASSERT(!m_isShutdown);
blockUntilImportComplete();
if (privateBrowsingEnabled(frame))
- return;
+ return String();
String oldValue;
RefPtr<StorageMap> newMap = m_storageMap->removeItem(key, oldValue);
@@ -172,23 +173,24 @@ void StorageAreaImpl::removeItem(const String& key, Frame* frame)
m_storageMap = newMap.release();
if (oldValue.isNull())
- return;
+ return oldValue;
if (m_storageAreaSync)
m_storageAreaSync->scheduleItemForSync(key, String());
StorageEventDispatcher::dispatch(key, oldValue, String(), m_storageType, m_securityOrigin.get(), frame);
+ return oldValue;
}
-void StorageAreaImpl::clear(Frame* frame)
+bool StorageAreaImpl::clear(Frame* frame)
{
ASSERT(!m_isShutdown);
blockUntilImportComplete();
if (privateBrowsingEnabled(frame))
- return;
+ return false;
if (!m_storageMap->length())
- return;
+ return false;
unsigned quota = m_storageMap->quota();
m_storageMap = StorageMap::create(quota);
@@ -196,6 +198,7 @@ void StorageAreaImpl::clear(Frame* frame)
if (m_storageAreaSync)
m_storageAreaSync->scheduleClear();
StorageEventDispatcher::dispatch(String(), String(), String(), m_storageType, m_securityOrigin.get(), frame);
+ return true;
}
bool StorageAreaImpl::contains(const String& key) const
diff --git a/WebCore/storage/StorageAreaImpl.h b/WebCore/storage/StorageAreaImpl.h
index 0b2d34d..60d72cb 100644
--- a/WebCore/storage/StorageAreaImpl.h
+++ b/WebCore/storage/StorageAreaImpl.h
@@ -48,9 +48,9 @@ namespace WebCore {
virtual unsigned length() 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);
- virtual void clear(Frame* sourceFrame);
+ virtual String setItem(const String& key, const String& value, ExceptionCode& ec, Frame* sourceFrame);
+ virtual String removeItem(const String& key, Frame* sourceFrame);
+ virtual bool clear(Frame* sourceFrame);
virtual bool contains(const String& key) const;
PassRefPtr<StorageAreaImpl> copy();
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 12e50ae..67d7278 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,38 @@
+2010-01-21 Jeremy Orlow <jorlow at chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ The Chromium WebKit API needs to expose storage event related data
+ https://bugs.webkit.org/show_bug.cgi?id=33985
+
+ setItem and removeItem on WebStorageArea need to expose what the previous
+ value was for the key being modified. Clear needs to return whether it
+ actually cleared anything.
+
+ * public/WebStorageArea.h:
+ (WebKit::WebStorageArea::setItem):
+ (WebKit::WebStorageArea::removeItem):
+ (WebKit::WebStorageArea::clear):
+ * src/StorageAreaProxy.cpp:
+ (WebCore::StorageAreaProxy::StorageAreaProxy):
+ (WebCore::StorageAreaProxy::setItem):
+ (WebCore::StorageAreaProxy::removeItem):
+ (WebCore::StorageAreaProxy::clear):
+ (WebCore::StorageAreaProxy::storageEvent):
+ * src/StorageAreaProxy.h:
+ * src/StorageNamespaceProxy.cpp:
+ (WebCore::StorageNamespace::localStorageNamespace):
+ (WebCore::StorageNamespace::sessionStorageNamespace):
+ (WebCore::StorageNamespaceProxy::StorageNamespaceProxy):
+ (WebCore::StorageNamespaceProxy::copy):
+ (WebCore::StorageNamespaceProxy::storageArea):
+ * src/StorageNamespaceProxy.h:
+ * src/WebStorageAreaImpl.cpp:
+ (WebKit::WebStorageAreaImpl::setItem):
+ (WebKit::WebStorageAreaImpl::removeItem):
+ (WebKit::WebStorageAreaImpl::clear):
+ * src/WebStorageAreaImpl.h:
+
2010-01-21 Darin Fisher <darin at chromium.org>
Reviewed by David Levin.
diff --git a/WebKit/chromium/public/WebStorageArea.h b/WebKit/chromium/public/WebStorageArea.h
index 71dc7a5..302e10c 100644
--- a/WebKit/chromium/public/WebStorageArea.h
+++ b/WebKit/chromium/public/WebStorageArea.h
@@ -32,10 +32,10 @@
#define WebStorageArea_h
#include "WebCommon.h"
+#include "WebString.h"
namespace WebKit {
-class WebString;
class WebURL;
// In WebCore, there's one distinct StorageArea per origin per StorageNamespace. This
@@ -60,14 +60,41 @@ public:
// 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. url is the url that should be used if a storage event fires.
- virtual void setItem(const WebString& key, const WebString& value, const WebURL& url, bool& quotaException) = 0;
+ // FIXME: The following is a hack to keep Chromium compiling until the other half is landed. Remove soon.
+ virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& url, bool& quotaException) // Deprecated.
+ {
+ WebString oldValue;
+ setItem(key, newValue, url, quotaException, oldValue);
+ }
+ virtual void setItem(const WebString& key, const WebString& newValue, const WebURL& url, bool& quotaException, WebString& oldValue)
+ {
+ setItem(key, newValue, url, quotaException);
+ }
// Remove the value associated with a particular key. url is the url that should be used
// if a storage event fires.
- virtual void removeItem(const WebString& key, const WebURL& url) = 0;
+ // FIXME: The following is a hack to keep Chromium compiling until the other half is landed. Remove soon.
+ virtual void removeItem(const WebString& key, const WebURL& url) // Deprecated.
+ {
+ WebString oldValue;
+ removeItem(key, url, oldValue);
+ }
+ virtual void removeItem(const WebString& key, const WebURL& url, WebString& oldValue)
+ {
+ removeItem(key, url);
+ }
// Clear all key/value pairs. url is the url that should be used if a storage event fires.
- virtual void clear(const WebURL& url) = 0;
+ // FIXME: The following is a hack to keep Chromium compiling until the other half is landed. Remove soon.
+ virtual void clear(const WebURL& url) // Deprecated.
+ {
+ bool somethingCleared;
+ clear(url, somethingCleared);
+ }
+ virtual void clear(const WebURL& url, bool& somethingCleared)
+ {
+ clear(url);
+ }
};
} // namespace WebKit
diff --git a/WebKit/chromium/src/StorageAreaProxy.cpp b/WebKit/chromium/src/StorageAreaProxy.cpp
index 551507f..5381850 100644
--- a/WebKit/chromium/src/StorageAreaProxy.cpp
+++ b/WebKit/chromium/src/StorageAreaProxy.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2009 Google Inc. All Rights Reserved.
+ * (C) 2008 Apple Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -28,11 +29,16 @@
#if ENABLE(DOM_STORAGE)
+#include "DOMWindow.h"
#include "Document.h"
+#include "EventNames.h"
#include "ExceptionCode.h"
#include "Frame.h"
+#include "Page.h"
+#include "PageGroup.h"
#include "SecurityOrigin.h"
#include "StorageAreaImpl.h"
+#include "StorageEvent.h"
#include "WebStorageArea.h"
#include "WebString.h"
@@ -40,8 +46,9 @@
namespace WebCore {
-StorageAreaProxy::StorageAreaProxy(WebKit::WebStorageArea* storageArea)
+StorageAreaProxy::StorageAreaProxy(WebKit::WebStorageArea* storageArea, StorageType storageType)
: m_storageArea(storageArea)
+ , m_storageType(storageType)
{
}
@@ -64,21 +71,34 @@ String StorageAreaProxy::getItem(const String& key) const
return m_storageArea->getItem(key);
}
-void StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame)
+String StorageAreaProxy::setItem(const String& key, const String& value, ExceptionCode& ec, Frame* frame)
{
bool quotaException = false;
- m_storageArea->setItem(key, value, frame->document()->url(), quotaException);
+ WebKit::WebString oldValue;
+ m_storageArea->setItem(key, value, frame->document()->url(), quotaException, oldValue);
ec = quotaException ? QUOTA_EXCEEDED_ERR : 0;
+ String oldValueString = oldValue;
+ if (oldValueString != value)
+ storageEvent(key, oldValue, value, m_storageType, frame->document()->securityOrigin(), frame);
+ return oldValue;
}
-void StorageAreaProxy::removeItem(const String& key, Frame* frame)
+String StorageAreaProxy::removeItem(const String& key, Frame* frame)
{
- m_storageArea->removeItem(key, frame->document()->url());
+ WebKit::WebString oldValue;
+ m_storageArea->removeItem(key, frame->document()->url(), oldValue);
+ if (!oldValue.isNull())
+ storageEvent(key, oldValue, String(), m_storageType, frame->document()->securityOrigin(), frame);
+ return oldValue;
}
-void StorageAreaProxy::clear(Frame* frame)
+bool StorageAreaProxy::clear(Frame* frame)
{
- m_storageArea->clear(frame->document()->url());
+ bool clearedSomething;
+ m_storageArea->clear(frame->document()->url(), clearedSomething);
+ if (clearedSomething)
+ storageEvent(String(), String(), String(), m_storageType, frame->document()->securityOrigin(), frame);
+ return clearedSomething;
}
bool StorageAreaProxy::contains(const String& key) const
@@ -86,6 +106,41 @@ bool StorageAreaProxy::contains(const String& key) const
return !getItem(key).isNull();
}
+// Copied from WebCore/storage/StorageEventDispatcher.cpp out of necessity. It's probably best to keep it current.
+void StorageAreaProxy::storageEvent(const String& key, const String& oldValue, const String& newValue, StorageType storageType, SecurityOrigin* securityOrigin, Frame* sourceFrame)
+{
+ Page* page = sourceFrame->page();
+ if (!page)
+ return;
+
+ // We need to copy all relevant frames from every page to a vector since sending the event to one frame might mutate the frame tree
+ // of any given page in the group or mutate the page group itself.
+ Vector<RefPtr<Frame> > frames;
+ if (storageType == SessionStorage) {
+ // Send events only to our page.
+ for (Frame* frame = page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+ if (frame->document()->securityOrigin()->equal(securityOrigin))
+ frames.append(frame);
+ }
+
+ for (unsigned i = 0; i < frames.size(); ++i)
+ frames[i]->document()->dispatchWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->sessionStorage()));
+ } else {
+ // Send events to every page.
+ const HashSet<Page*>& pages = page->group().pages();
+ HashSet<Page*>::const_iterator end = pages.end();
+ for (HashSet<Page*>::const_iterator it = pages.begin(); it != end; ++it) {
+ for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
+ if (frame->document()->securityOrigin()->equal(securityOrigin))
+ frames.append(frame);
+ }
+ }
+
+ for (unsigned i = 0; i < frames.size(); ++i)
+ frames[i]->document()->dispatchWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->localStorage()));
+ }
+}
+
} // namespace WebCore
#endif // ENABLE(DOM_STORAGE)
diff --git a/WebKit/chromium/src/StorageAreaProxy.h b/WebKit/chromium/src/StorageAreaProxy.h
index 5d09d82..b169828 100644
--- a/WebKit/chromium/src/StorageAreaProxy.h
+++ b/WebKit/chromium/src/StorageAreaProxy.h
@@ -34,22 +34,28 @@ namespace WebKit { class WebStorageArea; }
namespace WebCore {
+class Frame;
+class SecurityOrigin;
+
class StorageAreaProxy : public StorageArea {
public:
- StorageAreaProxy(WebKit::WebStorageArea* storageArea);
+ StorageAreaProxy(WebKit::WebStorageArea*, StorageType);
virtual ~StorageAreaProxy();
// The HTML5 DOM Storage API
virtual unsigned length() 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);
- virtual void clear(Frame* sourceFrame);
+ virtual String setItem(const String& key, const String& value, ExceptionCode& ec, Frame* sourceFrame);
+ virtual String removeItem(const String& key, Frame* sourceFrame);
+ virtual bool clear(Frame* sourceFrame);
virtual bool contains(const String& key) const;
private:
+ void storageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Frame* sourceFrame);
+
OwnPtr<WebKit::WebStorageArea> m_storageArea;
+ StorageType m_storageType;
};
} // namespace WebCore
diff --git a/WebKit/chromium/src/StorageNamespaceProxy.cpp b/WebKit/chromium/src/StorageNamespaceProxy.cpp
index cded509..8dca4ca 100644
--- a/WebKit/chromium/src/StorageNamespaceProxy.cpp
+++ b/WebKit/chromium/src/StorageNamespaceProxy.cpp
@@ -44,18 +44,19 @@ namespace WebCore {
PassRefPtr<StorageNamespace> StorageNamespace::localStorageNamespace(const String& path, unsigned quota)
{
- return adoptRef(new StorageNamespaceProxy(WebKit::webKitClient()->createLocalStorageNamespace(path, quota)));
+ return adoptRef(new StorageNamespaceProxy(WebKit::webKitClient()->createLocalStorageNamespace(path, quota), LocalStorage));
}
PassRefPtr<StorageNamespace> StorageNamespace::sessionStorageNamespace(Page* page)
{
WebKit::ChromeClientImpl* chromeClientImpl = static_cast<WebKit::ChromeClientImpl*>(page->chrome()->client());
WebKit::WebViewClient* webViewClient = chromeClientImpl->webView()->client();
- return adoptRef(new StorageNamespaceProxy(webViewClient->createSessionStorageNamespace()));
+ return adoptRef(new StorageNamespaceProxy(webViewClient->createSessionStorageNamespace(), SessionStorage));
}
-StorageNamespaceProxy::StorageNamespaceProxy(WebKit::WebStorageNamespace* storageNamespace)
+StorageNamespaceProxy::StorageNamespaceProxy(WebKit::WebStorageNamespace* storageNamespace, StorageType storageType)
: m_storageNamespace(storageNamespace)
+ , m_storageType(storageType)
{
}
@@ -65,12 +66,12 @@ StorageNamespaceProxy::~StorageNamespaceProxy()
PassRefPtr<StorageNamespace> StorageNamespaceProxy::copy()
{
- return adoptRef(new StorageNamespaceProxy(m_storageNamespace->copy()));
+ return adoptRef(new StorageNamespaceProxy(m_storageNamespace->copy(), m_storageType));
}
PassRefPtr<StorageArea> StorageNamespaceProxy::storageArea(PassRefPtr<SecurityOrigin> origin)
{
- return adoptRef(new StorageAreaProxy(m_storageNamespace->createStorageArea(origin->toString())));
+ return adoptRef(new StorageAreaProxy(m_storageNamespace->createStorageArea(origin->toString()), m_storageType));
}
void StorageNamespaceProxy::close()
diff --git a/WebKit/chromium/src/StorageNamespaceProxy.h b/WebKit/chromium/src/StorageNamespaceProxy.h
index 9ff624b..28d7a23 100644
--- a/WebKit/chromium/src/StorageNamespaceProxy.h
+++ b/WebKit/chromium/src/StorageNamespaceProxy.h
@@ -28,6 +28,7 @@
#if ENABLE(DOM_STORAGE)
+#include "StorageArea.h"
#include "StorageNamespace.h"
namespace WebKit { class WebStorageNamespace; }
@@ -36,7 +37,7 @@ namespace WebCore {
class StorageNamespaceProxy : public StorageNamespace {
public:
- StorageNamespaceProxy(WebKit::WebStorageNamespace* storageNamespace);
+ StorageNamespaceProxy(WebKit::WebStorageNamespace*, StorageType);
virtual ~StorageNamespaceProxy();
virtual PassRefPtr<StorageArea> storageArea(PassRefPtr<SecurityOrigin>);
virtual PassRefPtr<StorageNamespace> copy();
@@ -45,6 +46,7 @@ public:
private:
OwnPtr<WebKit::WebStorageNamespace> m_storageNamespace;
+ StorageType m_storageType;
};
} // namespace WebCore
diff --git a/WebKit/chromium/src/WebStorageAreaImpl.cpp b/WebKit/chromium/src/WebStorageAreaImpl.cpp
index f24bee3..92a923a 100644
--- a/WebKit/chromium/src/WebStorageAreaImpl.cpp
+++ b/WebKit/chromium/src/WebStorageAreaImpl.cpp
@@ -66,12 +66,12 @@ WebString WebStorageAreaImpl::getItem(const WebString& key)
return m_storageArea->getItem(key);
}
-void WebStorageAreaImpl::setItem(const WebString& key, const WebString& value, const WebURL& url, bool& quotaException)
+void WebStorageAreaImpl::setItem(const WebString& key, const WebString& value, const WebURL& url, bool& quotaException, WebString& oldValue)
{
int exceptionCode = 0;
ScopedStorageEventURL scope(url);
- m_storageArea->setItem(key, value, exceptionCode, 0);
+ oldValue = m_storageArea->setItem(key, value, exceptionCode, 0);
if (exceptionCode) {
ASSERT(exceptionCode == WebCore::QUOTA_EXCEEDED_ERR);
@@ -80,16 +80,16 @@ void WebStorageAreaImpl::setItem(const WebString& key, const WebString& value, c
quotaException = false;
}
-void WebStorageAreaImpl::removeItem(const WebString& key, const WebURL& url)
+void WebStorageAreaImpl::removeItem(const WebString& key, const WebURL& url, WebString& oldValue)
{
ScopedStorageEventURL scope(url);
- m_storageArea->removeItem(key, 0);
+ oldValue = m_storageArea->removeItem(key, 0);
}
-void WebStorageAreaImpl::clear(const WebURL& url)
+void WebStorageAreaImpl::clear(const WebURL& url, bool& somethingCleared)
{
ScopedStorageEventURL scope(url);
- m_storageArea->clear(0);
+ somethingCleared = m_storageArea->clear(0);
}
} // namespace WebKit
diff --git a/WebKit/chromium/src/WebStorageAreaImpl.h b/WebKit/chromium/src/WebStorageAreaImpl.h
index e1f74e0..7e90531 100644
--- a/WebKit/chromium/src/WebStorageAreaImpl.h
+++ b/WebKit/chromium/src/WebStorageAreaImpl.h
@@ -45,9 +45,9 @@ public:
virtual unsigned length();
virtual WebString key(unsigned index);
virtual WebString getItem(const WebString& key);
- virtual void setItem(const WebString& key, const WebString& value, const WebURL& url, bool& quotaException);
- virtual void removeItem(const WebString& key, const WebURL& url);
- virtual void clear(const WebURL& url);
+ virtual void setItem(const WebString& key, const WebString& value, const WebURL& url, bool& quotaException, WebString& oldValue);
+ virtual void removeItem(const WebString& key, const WebURL& url, WebString& oldValue);
+ virtual void clear(const WebURL& url, bool& somethingCleared);
// For storage events in single-process mode and test shell.
static const WebURL* currentStorageEventURL() { return storageEventURL; }
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list