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

Unified Diff: third_party/WebKit/Source/modules/storage/StorageArea.cpp

Issue 1507633003: Clarify ordinary page handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: whitespace Created 4 years, 12 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: third_party/WebKit/Source/modules/storage/StorageArea.cpp
diff --git a/third_party/WebKit/Source/modules/storage/StorageArea.cpp b/third_party/WebKit/Source/modules/storage/StorageArea.cpp
index e8b98b800b482c5bc9549d023398e902cf869ba4..35e82b6892ea2475ad77daf42a0eb655cfaf743e 100644
--- a/third_party/WebKit/Source/modules/storage/StorageArea.cpp
+++ b/third_party/WebKit/Source/modules/storage/StorageArea.cpp
@@ -161,9 +161,8 @@ size_t StorageArea::memoryBytesUsedByCache()
void StorageArea::dispatchLocalStorageEvent(const String& key, const String& oldValue, const String& newValue, SecurityOrigin* securityOrigin, const KURL& pageURL, WebStorageArea* sourceAreaInstance, bool originatedInProcess)
{
- // FIXME: This looks suspicious. Why doesn't this use allPages instead?
- const WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& pages = Page::ordinaryPages();
- for (Page* page : pages) {
+ // Iterate over all pages that have a StorageNamespaceController supplement.
+ for (Page* page : Page::ordinaryPages()) {
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())
@@ -181,9 +180,8 @@ void StorageArea::dispatchLocalStorageEvent(const String& key, const String& old
static Page* findPageWithSessionStorageNamespace(const WebStorageNamespace& sessionNamespace)
{
- // FIXME: This looks suspicious. Why doesn't this use allPages instead?
- const WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& pages = Page::ordinaryPages();
- for (Page* page : pages) {
+ // Iterate over all pages that have a StorageNamespaceController supplement.
+ for (Page* page : Page::ordinaryPages()) {
const bool dontCreateIfMissing = false;
StorageNamespace* storageNamespace = StorageNamespaceController::from(page)->sessionStorage(dontCreateIfMissing);
if (storageNamespace && storageNamespace->isSameNamespace(sessionNamespace))

Powered by Google App Engine
This is Rietveld 408576698