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

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

Issue 317493002: Change FrameTree to return Frames instead of LocalFrames. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: dcheng's comment addressed Created 6 years, 6 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
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/storage/StorageArea.cpp
diff --git a/Source/core/storage/StorageArea.cpp b/Source/core/storage/StorageArea.cpp
index 38a629a0ac03ded3516f472aeb3ca4142c994322..1b8c07f86899f81cfe148015797115f686d10c06 100644
--- a/Source/core/storage/StorageArea.cpp
+++ b/Source/core/storage/StorageArea.cpp
@@ -145,9 +145,12 @@ void StorageArea::dispatchLocalStorageEvent(const String& key, const String& old
// 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);
@@ -173,9 +176,12 @@ void StorageArea::dispatchSessionStorageEvent(const String& key, const String& o
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);
« no previous file with comments | « Source/core/rendering/compositing/RenderLayerCompositor.cpp ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698