| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "WebStorageEventDispatcherImpl.h" | 32 #include "WebStorageEventDispatcherImpl.h" |
| 33 | 33 |
| 34 #if ENABLE(DOM_STORAGE) | 34 #if ENABLE(DOM_STORAGE) |
| 35 | 35 |
| 36 #include "SecurityOrigin.h" | 36 #include "SecurityOrigin.h" |
| 37 | 37 |
| 38 namespace WebKit { |
| 39 |
| 38 extern const char* pageGroupName; | 40 extern const char* pageGroupName; |
| 39 | 41 |
| 40 namespace WebKit { | |
| 41 | |
| 42 WebStorageEventDispatcher* WebStorageEventDispatcher::create() | 42 WebStorageEventDispatcher* WebStorageEventDispatcher::create() |
| 43 { | 43 { |
| 44 return new WebStorageEventDispatcherImpl(); | 44 return new WebStorageEventDispatcherImpl(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 WebStorageEventDispatcherImpl::WebStorageEventDispatcherImpl() | 47 WebStorageEventDispatcherImpl::WebStorageEventDispatcherImpl() |
| 48 : m_eventDispatcher(new WebCore::StorageEventDispatcherImpl(pageGroupName)) | 48 : m_eventDispatcher(new WebCore::StorageEventDispatcherImpl(pageGroupName)) |
| 49 { | 49 { |
| 50 ASSERT(m_eventDispatcher); | 50 ASSERT(m_eventDispatcher); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void WebStorageEventDispatcherImpl::dispatchStorageEvent(const WebString& key, const WebString& oldValue, | 53 void WebStorageEventDispatcherImpl::dispatchStorageEvent(const WebString& key, const WebString& oldValue, |
| 54 const WebString& newValue, const WebString& origin, | 54 const WebString& newValue, const WebString& origin, |
| 55 bool isLocalStorage) | 55 bool isLocalStorage) |
| 56 { | 56 { |
| 57 WebCore::StorageType storageType = isLocalStorage ? WebCore::LocalStorage : WebCore::SessionStorage; | 57 WebCore::StorageType storageType = isLocalStorage ? WebCore::LocalStorage : WebCore::SessionStorage; |
| 58 RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::createFromString(origin); | 58 RefPtr<WebCore::SecurityOrigin> securityOrigin = WebCore::SecurityOrigin::createFromString(origin); |
| 59 m_eventDispatcher->dispatchStorageEvent(key, oldValue, newValue, storageType, securityOrigin.get()); | 59 m_eventDispatcher->dispatchStorageEvent(key, oldValue, newValue, storageType, securityOrigin.get()); |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace WebKit | 62 } // namespace WebKit |
| 63 | 63 |
| 64 #endif // ENABLE(DOM_STORAGE) | 64 #endif // ENABLE(DOM_STORAGE) |
| OLD | NEW |