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

Unified Diff: Source/core/storage/StorageArea.cpp

Issue 683013002: Extract a DOMWindow interface from LocalDOMWindow and use it in the idl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix incorrect assumption Created 6 years, 1 month 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/core/storage/StorageArea.cpp
diff --git a/Source/core/storage/StorageArea.cpp b/Source/core/storage/StorageArea.cpp
index fadd88cf026e46548409ad3134790e33781177e1..55b762449078b16976dafcff42f0a5217ea5ccbd 100644
--- a/Source/core/storage/StorageArea.cpp
+++ b/Source/core/storage/StorageArea.cpp
@@ -164,9 +164,10 @@ void StorageArea::dispatchLocalStorageEvent(const String& key, const String& old
// 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 && toLocalFrame(frame)->document()->securityOrigin()->canAccess(securityOrigin) && !isEventSource(storage, sourceAreaInstance))
- frame->domWindow()->enqueueWindowEvent(StorageEvent::create(EventTypeNames::storage, key, oldValue, newValue, pageURL, storage));
+ LocalFrame* localFrame = toLocalFrame(frame);
+ Storage* storage = localFrame->localDOMWindow()->optionalLocalStorage();
+ if (storage && localFrame->document()->securityOrigin()->canAccess(securityOrigin) && !isEventSource(storage, sourceAreaInstance))
+ localFrame->localDOMWindow()->enqueueWindowEvent(StorageEvent::create(EventTypeNames::storage, key, oldValue, newValue, pageURL, storage));
}
InspectorInstrumentation::didDispatchDOMStorageEvent(page, key, oldValue, newValue, LocalStorage, securityOrigin);
}
@@ -195,9 +196,10 @@ void StorageArea::dispatchSessionStorageEvent(const String& key, const String& o
// 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 && toLocalFrame(frame)->document()->securityOrigin()->canAccess(securityOrigin) && !isEventSource(storage, sourceAreaInstance))
- frame->domWindow()->enqueueWindowEvent(StorageEvent::create(EventTypeNames::storage, key, oldValue, newValue, pageURL, storage));
+ LocalFrame* localFrame = toLocalFrame(frame);
+ Storage* storage = localFrame->localDOMWindow()->optionalSessionStorage();
+ if (storage && localFrame->document()->securityOrigin()->canAccess(securityOrigin) && !isEventSource(storage, sourceAreaInstance))
+ localFrame->localDOMWindow()->enqueueWindowEvent(StorageEvent::create(EventTypeNames::storage, key, oldValue, newValue, pageURL, storage));
}
InspectorInstrumentation::didDispatchDOMStorageEvent(page, key, oldValue, newValue, SessionStorage, securityOrigin);
}

Powered by Google App Engine
This is Rietveld 408576698