content/base/src/ThirdPartyUtil.h
author David Anderson <danderson@mozilla.com>
Mon, 21 May 2012 14:40:04 -0700
changeset 106274 80e4ab0d24bc64ceaa7693ab5def36faffde7a40
parent 105314 f93960a93ad97a56d308bd9ce25d97cbc175d524
parent 94484 f4157e8c410708d76703f19e4dfb61859bfe32d8
child 106397 881c4b8e74045a4033f68ec402c245f5939481f8
permissions -rw-r--r--
Merge from mozilla-central.

/* 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/. */

#ifndef ThirdPartyUtil_h__
#define ThirdPartyUtil_h__

#include "nsCOMPtr.h"
#include "nsString.h"
#include "mozIThirdPartyUtil.h"
#include "nsIEffectiveTLDService.h"

class nsIURI;
class nsIChannel;
class nsIDOMWindow;

class ThirdPartyUtil : public mozIThirdPartyUtil
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_MOZITHIRDPARTYUTIL

  nsresult Init();

private:
  nsresult IsThirdPartyInternal(const nsCString& aFirstDomain,
    nsIURI* aSecondURI, bool* aResult);
  static already_AddRefed<nsIURI> GetURIFromWindow(nsIDOMWindow* aWin);

  nsCOMPtr<nsIEffectiveTLDService> mTLDService;
};

#endif