content/base/src/ThirdPartyUtil.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/src/ThirdPartyUtil.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#ifndef ThirdPartyUtil_h__
     1.9 +#define ThirdPartyUtil_h__
    1.10 +
    1.11 +#include "nsCOMPtr.h"
    1.12 +#include "nsString.h"
    1.13 +#include "mozIThirdPartyUtil.h"
    1.14 +#include "nsIEffectiveTLDService.h"
    1.15 +#include "nsICookiePermission.h"
    1.16 +#include "mozilla/Attributes.h"
    1.17 +
    1.18 +class nsIURI;
    1.19 +class nsIChannel;
    1.20 +class nsIDOMWindow;
    1.21 +
    1.22 +class ThirdPartyUtil MOZ_FINAL : public mozIThirdPartyUtil
    1.23 +{
    1.24 +public:
    1.25 +  NS_DECL_ISUPPORTS
    1.26 +  NS_DECL_MOZITHIRDPARTYUTIL
    1.27 +
    1.28 +  nsresult Init();
    1.29 +
    1.30 +private:
    1.31 +  nsresult IsThirdPartyInternal(const nsCString& aFirstDomain,
    1.32 +    nsIURI* aSecondURI, bool* aResult);
    1.33 +  bool IsFirstPartyIsolationActive(nsIChannel* aChannel, nsIDocument* aDoc);
    1.34 +  bool SchemeIsWhiteListed(nsIURI *aURI);
    1.35 +  static already_AddRefed<nsIURI> GetURIFromWindow(nsIDOMWindow* aWin);
    1.36 +  static nsresult GetOriginatingURI(nsIChannel  *aChannel, nsIURI **aURI);
    1.37 +  nsresult GetFirstPartyURIInternal(nsIChannel *aChannel, nsIDocument *aDoc,
    1.38 +                                    bool aLogErrors, nsIURI **aOutput);
    1.39 +
    1.40 +  nsCOMPtr<nsIEffectiveTLDService> mTLDService;
    1.41 +  nsCOMPtr<nsICookiePermission> mCookiePermissions;
    1.42 +};
    1.43 +
    1.44 +#endif
    1.45 +

mercurial