michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef ThirdPartyUtil_h__ michael@0: #define ThirdPartyUtil_h__ michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsString.h" michael@0: #include "mozIThirdPartyUtil.h" michael@0: #include "nsIEffectiveTLDService.h" michael@0: #include "nsICookiePermission.h" michael@0: #include "mozilla/Attributes.h" michael@0: michael@0: class nsIURI; michael@0: class nsIChannel; michael@0: class nsIDOMWindow; michael@0: michael@0: class ThirdPartyUtil MOZ_FINAL : public mozIThirdPartyUtil michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_MOZITHIRDPARTYUTIL michael@0: michael@0: nsresult Init(); michael@0: michael@0: private: michael@0: nsresult IsThirdPartyInternal(const nsCString& aFirstDomain, michael@0: nsIURI* aSecondURI, bool* aResult); michael@0: bool IsFirstPartyIsolationActive(nsIChannel* aChannel, nsIDocument* aDoc); michael@0: bool SchemeIsWhiteListed(nsIURI *aURI); michael@0: static already_AddRefed GetURIFromWindow(nsIDOMWindow* aWin); michael@0: static nsresult GetOriginatingURI(nsIChannel *aChannel, nsIURI **aURI); michael@0: nsresult GetFirstPartyURIInternal(nsIChannel *aChannel, nsIDocument *aDoc, michael@0: bool aLogErrors, nsIURI **aOutput); michael@0: michael@0: nsCOMPtr mTLDService; michael@0: nsCOMPtr mCookiePermissions; michael@0: }; michael@0: michael@0: #endif michael@0: