void DOMStorage::GetSupportedNames(nsTArray<nsString>& aKeys) { if (!CanUseStorage(*nsContentUtils::SubjectPrincipal())) { // return just an empty array aKeys.Clear(); return; } mCache->GetKeys(this, aKeys); }
void DOMStorage::GetSupportedNames(unsigned, nsTArray<nsString>& aKeys) { if (!CanUseStorage(this)) { // return just an empty array aKeys.Clear(); return; } mCache->GetKeys(this, aKeys); }
PRBool nsDOMStorage::CacheStoragePermissions() { // Bug 488446, disallowing storage use when in session only mode. // This is temporary fix before we find complete solution for storage // behavior in private browsing mode or session-only cookies mode. if (!CanUseStorage(&mSessionOnly)) return PR_FALSE; nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager(); if (!ssm) return PR_FALSE; nsCOMPtr<nsIPrincipal> subjectPrincipal; ssm->GetSubjectPrincipal(getter_AddRefs(subjectPrincipal)); NS_ASSERTION(mSecurityChecker, "Has non-null mSecurityChecker"); return mSecurityChecker->CanAccess(subjectPrincipal); }