/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
RefPtr<StorageNotifierService> service = gStorageNotifierService; if (!service) { return;
}
RefPtr<StorageEvent> event = aEvent;
for (constauto& observer : service->mObservers.ForwardRange()) { // Enforce that the source storage area's private browsing state matches // this window's state. These flag checks and their maintenance independent // from the principal's OriginAttributes matter because chrome docshells // that are part of private browsing windows can be private browsing without // having their OriginAttributes set (because they have the system // principal). if (aPrivateBrowsing != observer->IsPrivateBrowsing()) { continue;
}
// No reasons to continue if the principal of the event doesn't match with // the window's one. if (!StorageUtils::PrincipalsEqual(
aEvent->GetPrincipal(), observer->GetEffectiveStoragePrincipal())) { continue;
}
constauto pinnedObserver = observer;
RefPtr<Runnable> r = NS_NewRunnableFunction( "StorageNotifierService::Broadcast",
[pinnedObserver, event, aStorageType, aPrivateBrowsing,
aImmediateDispatch]() { // Check principals again. EffectiveStoragePrincipal may be changed // when relaxed. if (!aImmediateDispatch &&
!StorageUtils::PrincipalsEqual(
event->GetPrincipal(),
pinnedObserver->GetEffectiveStoragePrincipal())) { return;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.