Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp

Issue 10377148: Revert 116712 - Source/WebCore: [chromium] DomStorage events handling needs TLC (2) (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1137/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp
===================================================================
--- Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp (revision 117067)
+++ Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.cpp (working copy)
@@ -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 @@
{
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 @@
{
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
« no previous file with comments | « Source/WebKit/chromium/src/WebStorageEventDispatcherImpl.h ('k') | Source/WebKit/chromium/src/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698