MOZ_WARN_UNUSED_RESULT bool CookieServiceParent::GetOriginAttributesFromParams(const IPC::SerializedLoadContext &aLoadContext, NeckoOriginAttributes& aAttrs, bool& aIsPrivate) { aIsPrivate = false; DocShellOriginAttributes docShellAttrs; const char* error = NeckoParent::GetValidatedAppInfo(aLoadContext, Manager()->Manager(), docShellAttrs); if (error) { NS_WARNING(nsPrintfCString("CookieServiceParent: GetOriginAttributesFromParams: " "FATAL error: %s: KILLING CHILD PROCESS\n", error).get()); return false; } if (aLoadContext.IsPrivateBitValid()) { aIsPrivate = aLoadContext.mUsePrivateBrowsing; } aAttrs.InheritFromDocShellToNecko(docShellAttrs); return true; }
LoadContextInfo * GetLoadContextInfo(nsILoadContext *aLoadContext, bool aIsAnonymous) { if (!aLoadContext) { return new LoadContextInfo(aIsAnonymous, NeckoOriginAttributes(nsILoadContextInfo::NO_APP_ID, false)); } DebugOnly<bool> pb = aLoadContext->UsePrivateBrowsing(); DocShellOriginAttributes doa; aLoadContext->GetOriginAttributes(doa); MOZ_ASSERT(pb == (doa.mPrivateBrowsingId > 0)); NeckoOriginAttributes noa; noa.InheritFromDocShellToNecko(doa); return new LoadContextInfo(aIsAnonymous, noa); }
LoadContextInfo * GetLoadContextInfo(nsILoadContext *aLoadContext, bool aIsAnonymous) { if (!aLoadContext) { return new LoadContextInfo(false, aIsAnonymous, NeckoOriginAttributes(nsILoadContextInfo::NO_APP_ID, false)); } bool pb = aLoadContext->UsePrivateBrowsing(); DocShellOriginAttributes doa; aLoadContext->GetOriginAttributes(doa); doa.SyncAttributesWithPrivateBrowsing(pb); NeckoOriginAttributes noa; noa.InheritFromDocShellToNecko(doa); return new LoadContextInfo(pb, aIsAnonymous, noa); }