summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-18 14:03:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-18 14:03:11 +0200
commit8d473cf9743f1d30a16a27114e93bd5af5648d23 (patch)
treecdca40d0353886b3ca52f33a2d7b8f1c0011aafc /Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
parent1b914638db989aaa98631a1c1e02c7b2d44805d8 (diff)
downloadqtwebkit-8d473cf9743f1d30a16a27114e93bd5af5648d23.tar.gz
Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578)
Weekly snapshot
Diffstat (limited to 'Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp')
-rw-r--r--Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp34
1 files changed, 28 insertions, 6 deletions
diff --git a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
index cd77cb46b..c8036aa74 100644
--- a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
+++ b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
@@ -29,20 +29,19 @@
*/
#include "config.h"
-#include "WebStorageEventDispatcher.h"
+#include "WebStorageEventDispatcherImpl.h"
#include "KURL.h"
#include "SecurityOrigin.h"
#include "StorageAreaProxy.h"
-#include "WebViewImpl.h"
#include "platform/WebURL.h"
#include <wtf/PassOwnPtr.h>
-// FIXME: move this file to WebStorageEventDispatcher.cpp
-
namespace WebKit {
+extern const char* pageGroupName;
+
void WebStorageEventDispatcher::dispatchLocalStorageEvent(
const WebString& key, const WebString& oldValue,
const WebString& newValue, const WebURL& origin,
@@ -51,7 +50,7 @@ void WebStorageEventDispatcher::dispatchLocalStorageEvent(
{
RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::create(origin);
WebCore::StorageAreaProxy::dispatchLocalStorageEvent(
- WebViewImpl::defaultPageGroup(), key, oldValue, newValue, securityOrigin.get(), pageURL,
+ pageGroupName, key, oldValue, newValue, securityOrigin.get(), pageURL,
sourceAreaInstance, originatedInProcess);
}
@@ -63,8 +62,31 @@ void WebStorageEventDispatcher::dispatchSessionStorageEvent(
{
RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::create(origin);
WebCore::StorageAreaProxy::dispatchSessionStorageEvent(
- WebViewImpl::defaultPageGroup(), key, oldValue, newValue, securityOrigin.get(), pageURL,
+ pageGroupName, key, oldValue, newValue, securityOrigin.get(), pageURL,
sessionNamespace, sourceAreaInstance, originatedInProcess);
}
+
+// FIXME: remove the WebStorageEventDispatcherImpl class soon.
+
+WebStorageEventDispatcher* WebStorageEventDispatcher::create()
+{
+ return new WebStorageEventDispatcherImpl();
+}
+
+WebStorageEventDispatcherImpl::WebStorageEventDispatcherImpl()
+ : m_eventDispatcher(adoptPtr(new WebCore::StorageEventDispatcherImpl(pageGroupName)))
+{
+ ASSERT(m_eventDispatcher);
+}
+
+void WebStorageEventDispatcherImpl::dispatchStorageEvent(const WebString& key, const WebString& oldValue,
+ const WebString& newValue, const WebString& origin,
+ const WebURL& pageURL, bool isLocalStorage)
+{
+ WebCore::StorageType storageType = isLocalStorage ? WebCore::LocalStorage : WebCore::SessionStorage;
+ RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::createFromString(origin);
+ m_eventDispatcher->dispatchStorageEvent(key, oldValue, newValue, securityOrigin.get(), pageURL, storageType);
+}
+
} // namespace WebKit