/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * vim: ft=cpp tw=78 sw=2 et ts=2 sts=2 cin * 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/. */ #include "nsISupports.idl" #include "nsIContentPolicy.idl" interface nsIDOMDocument; interface nsINode; interface nsIPrincipal; %{C++ #include "nsTArray.h" #include "mozilla/BasePrincipal.h" #include "mozilla/LoadTainting.h" class nsCString; %} [ref] native const_nsIPrincipalArray(const nsTArray>); native NeckoOriginAttributes(mozilla::NeckoOriginAttributes); [ref] native const_OriginAttributesRef(const mozilla::NeckoOriginAttributes); [ref] native StringArrayRef(const nsTArray); typedef unsigned long nsSecurityFlags; /** * An nsILoadOwner represents per-load information about who started the load. */ [scriptable, builtinclass, uuid(ddc65bf9-2f60-41ab-b22a-4f1ae9efcd36)] interface nsILoadInfo : nsISupports { /** * No special security flags: */ const unsigned long SEC_NORMAL = 0; /** * The following five flags determine the security mode and hence what kind of * security checks should be performed throughout the lifetime of the channel. * * * SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS * * SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED * * SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS * * SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL * * SEC_REQUIRE_CORS_DATA_INHERITS * * Exactly one of these flags are required to be set in order to allow * the channel to perform the correct security checks (SOP, CORS, ...) and * return the correct result principal. If none or more than one of these * flags are set AsyncOpen2 will fail. */ /* * Enforce the same origin policy where data: loads inherit * the principal. */ const unsigned long SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS = (1<<0); /* * Enforce the same origin policy but data: loads are blocked. */ const unsigned long SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED = (1<<1); /** * Allow loads from other origins. Loads from data: will inherit * the principal of the origin that triggered the load. * Commonly used by plain ,