#include "config.h"
#include "core/storage/StorageArea.h"
-#include "bindings/v8/ExceptionState.h"
+#include "bindings/core/v8/ExceptionState.h"
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
-#include "core/frame/DOMWindow.h"
+#include "core/frame/LocalDOMWindow.h"
#include "core/frame/LocalFrame.h"
#include "core/inspector/InspectorInstrumentation.h"
#include "core/page/Page.h"
#include "public/platform/WebString.h"
#include "public/platform/WebURL.h"
-namespace WebCore {
+namespace blink {
StorageArea::StorageArea(PassOwnPtr<blink::WebStorageArea> storageArea, StorageType storageType)
: m_storageArea(storageArea)
// FIXME: This looks suspicious. Why doesn't this use allPages instead?
const HashSet<Page*>& pages = Page::ordinaryPages();
for (HashSet<Page*>::const_iterator it = pages.begin(); it != pages.end(); ++it) {
- for (LocalFrame* frame = (*it)->mainFrame(); frame; frame = frame->tree().traverseNext()) {
+ for (Frame* frame = (*it)->mainFrame(); frame; frame = frame->tree().traverseNext()) {
+ // FIXME: We do not yet have a way to dispatch events to out-of-process frames.
+ if (!frame->isLocalFrame())
+ continue;
Storage* storage = frame->domWindow()->optionalLocalStorage();
- if (storage && frame->document()->securityOrigin()->canAccess(securityOrigin) && !isEventSource(storage, sourceAreaInstance))
+ if (storage && toLocalFrame(frame)->document()->securityOrigin()->canAccess(securityOrigin) && !isEventSource(storage, sourceAreaInstance))
frame->domWindow()->enqueueWindowEvent(StorageEvent::create(EventTypeNames::storage, key, oldValue, newValue, pageURL, storage));
}
InspectorInstrumentation::didDispatchDOMStorageEvent(*it, key, oldValue, newValue, LocalStorage, securityOrigin);
if (!page)
return;
- for (LocalFrame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
+ for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
+ // FIXME: We do not yet have a way to dispatch events to out-of-process frames.
+ if (!frame->isLocalFrame())
+ continue;
Storage* storage = frame->domWindow()->optionalSessionStorage();
- if (storage && frame->document()->securityOrigin()->canAccess(securityOrigin) && !isEventSource(storage, sourceAreaInstance))
+ if (storage && toLocalFrame(frame)->document()->securityOrigin()->canAccess(securityOrigin) && !isEventSource(storage, sourceAreaInstance))
frame->domWindow()->enqueueWindowEvent(StorageEvent::create(EventTypeNames::storage, key, oldValue, newValue, pageURL, storage));
}
InspectorInstrumentation::didDispatchDOMStorageEvent(page, key, oldValue, newValue, SessionStorage, securityOrigin);
return area->m_storageArea == sourceAreaInstance;
}
-} // namespace WebCore
+} // namespace blink