summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-07 11:21:11 +0200
commit2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (patch)
tree988e8c5b116dd0466244ae2fe5af8ee9be926d76 /Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
parentdd91e772430dc294e3bf478c119ef8d43c0a3358 (diff)
downloadqtwebkit-2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47.tar.gz
Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286)
Diffstat (limited to 'Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp')
-rw-r--r--Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp37
1 files changed, 30 insertions, 7 deletions
diff --git a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
index f1548cd66..c8036aa74 100644
--- a/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
+++ b/Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
@@ -33,8 +33,8 @@
#include "KURL.h"
#include "SecurityOrigin.h"
+#include "StorageAreaProxy.h"
-#include "WebStorageAreaImpl.h"
#include "platform/WebURL.h"
#include <wtf/PassOwnPtr.h>
@@ -42,6 +42,33 @@ namespace WebKit {
extern const char* pageGroupName;
+void WebStorageEventDispatcher::dispatchLocalStorageEvent(
+ const WebString& key, const WebString& oldValue,
+ const WebString& newValue, const WebURL& origin,
+ const WebURL& pageURL, WebStorageArea* sourceAreaInstance,
+ bool originatedInProcess)
+{
+ RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::create(origin);
+ WebCore::StorageAreaProxy::dispatchLocalStorageEvent(
+ pageGroupName, key, oldValue, newValue, securityOrigin.get(), pageURL,
+ sourceAreaInstance, originatedInProcess);
+}
+
+void WebStorageEventDispatcher::dispatchSessionStorageEvent(
+ const WebString& key, const WebString& oldValue,
+ const WebString& newValue, const WebURL& origin,
+ const WebURL& pageURL, const WebStorageNamespace& sessionNamespace,
+ WebStorageArea* sourceAreaInstance, bool originatedInProcess)
+{
+ RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::create(origin);
+ WebCore::StorageAreaProxy::dispatchSessionStorageEvent(
+ pageGroupName, key, oldValue, newValue, securityOrigin.get(), pageURL,
+ sessionNamespace, sourceAreaInstance, originatedInProcess);
+}
+
+
+// FIXME: remove the WebStorageEventDispatcherImpl class soon.
+
WebStorageEventDispatcher* WebStorageEventDispatcher::create()
{
return new WebStorageEventDispatcherImpl();
@@ -55,15 +82,11 @@ WebStorageEventDispatcherImpl::WebStorageEventDispatcherImpl()
void WebStorageEventDispatcherImpl::dispatchStorageEvent(const WebString& key, const WebString& oldValue,
const WebString& newValue, const WebString& origin,
- const WebURL& passedInURL, bool isLocalStorage)
+ const WebURL& pageURL, bool isLocalStorage)
{
- // Hack for single-process mode and test shell.
- const WebURL* storageAreaImplURL = WebStorageAreaImpl::currentStorageEventURL();
- const WebURL& url = storageAreaImplURL ? *storageAreaImplURL : passedInURL;
-
WebCore::StorageType storageType = isLocalStorage ? WebCore::LocalStorage : WebCore::SessionStorage;
RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::createFromString(origin);
- m_eventDispatcher->dispatchStorageEvent(key, oldValue, newValue, securityOrigin.get(), url, storageType);
+ m_eventDispatcher->dispatchStorageEvent(key, oldValue, newValue, securityOrigin.get(), pageURL, storageType);
}
} // namespace WebKit