/* -*- 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" #include "nsIScriptSecurityManager.idl" interface nsIChannel; interface nsIContentSecurityPolicy; interface nsICookieJarSettings; interface nsICSPEventListener; interface nsINode; interface nsIPrincipal; interface nsIRedirectHistoryEntry; interface nsIURI; webidl Document; webidl BrowsingContext; native LoadContextRef(already_AddRefed); %{C++ #include "nsTArray.h" #include "mozilla/BasePrincipal.h" #include "mozilla/LoadTainting.h" #include "mozilla/UniquePtr.h" #include "nsStringFwd.h" namespace mozilla { namespace dom { class ClientInfo; class ClientSource; class PerformanceStorage; class ServiceWorkerDescriptor; } // namespace dom } // namespace mozilla %} [ref] native nsIRedirectHistoryEntryArray(const nsTArray>); native OriginAttributes(mozilla::OriginAttributes); [ref] native const_OriginAttributesRef(const mozilla::OriginAttributes); [ref] native CStringArrayRef(const nsTArray); [ref] native StringArrayRef(const nsTArray); [ref] native Uint64ArrayRef(const nsTArray); [ref] native PrincipalArrayRef(const nsTArray>); [ref] native const_ClientInfoRef(const mozilla::dom::ClientInfo); native UniqueClientSource(mozilla::UniquePtr); native UniqueClientSourceMove(mozilla::UniquePtr&&); [ref] native const_MaybeClientInfoRef(const mozilla::Maybe); [ref] native const_ServiceWorkerDescriptorRef(const mozilla::dom::ServiceWorkerDescriptor); [ref] native const_MaybeServiceWorkerDescriptorRef(const mozilla::Maybe); [ptr] native PerformanceStoragePtr(mozilla::dom::PerformanceStorage); native LoadTainting(mozilla::LoadTainting); native CSPRef(already_AddRefed); typedef unsigned long nsSecurityFlags; /** * The LoadInfo object contains information about a network load, why it * was started, and how we plan on using the resulting response. * If a network request is redirected, the new channel will receive a new * LoadInfo object. The new object will contain mostly the same * information as the pre-redirect one, but updated as appropriate. * For detailed information about what parts of LoadInfo are updated on * redirect, see documentation on individual properties. */ [scriptable, builtinclass, uuid(ddc65bf9-2f60-41ab-b22a-4f1ae9efcd36)] interface nsILoadInfo : nsISupports { /** * 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_INHERITS_SEC_CONTEXT * * SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED * * SEC_ALLOW_CROSS_ORIGIN_INHERITS_SEC_CONTEXT * * SEC_ALLOW_CROSS_ORIGIN_SEC_CONTEXT_IS_NULL * * SEC_REQUIRE_CORS_INHERITS_SEC_CONTEXT * * 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 AsyncOpen will fail. */ /** * Warning: Never use this flag when creating a new channel! * Only use this flag if you have to create a temporary LoadInfo * for performing an explicit nsIContentPolicy check, like e.g. * when loading something from the cache that needs an explicit * nsIContentPolicy check. In all other cases pick one of the * security flags underneath. */ const unsigned long SEC_ONLY_FOR_EXPLICIT_CONTENTSEC_CHECK = 0; /* * Enforce the same origin policy where loads inherit the principal. * See the documentation for principalToInherit, which describes exactly what * principal is inherited. */ const unsigned long SEC_REQUIRE_SAME_ORIGIN_INHERITS_SEC_CONTEXT = (1<<0); /* * Enforce the same origin policy and data: loads are blocked. */ const unsigned long SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED = (1<<1); /** * Allow loads from other origins. Loads which inherit the principal should * see the documentation for principalToInherit, which describes exactly what * principal is inherited. * * Commonly used by plain ,