2007-07-26 10:31:49 +04:00
|
|
|
//* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* 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/. */
|
2006-06-09 22:23:10 +04:00
|
|
|
|
2013-12-11 23:03:51 +04:00
|
|
|
#ifndef EffectiveTLDService_h
|
|
|
|
#define EffectiveTLDService_h
|
|
|
|
|
2006-06-09 22:23:10 +04:00
|
|
|
#include "nsIEffectiveTLDService.h"
|
|
|
|
|
2013-01-16 09:26:44 +04:00
|
|
|
#include "nsIMemoryReporter.h"
|
2007-07-26 10:31:49 +04:00
|
|
|
#include "nsString.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2012-06-06 07:18:25 +04:00
|
|
|
#include "mozilla/Attributes.h"
|
2017-07-18 02:10:18 +03:00
|
|
|
#include "mozilla/Dafsa.h"
|
2013-06-23 16:03:39 +04:00
|
|
|
#include "mozilla/MemoryReporting.h"
|
2007-07-26 10:31:49 +04:00
|
|
|
|
|
|
|
class nsIIDNService;
|
2008-02-15 01:57:20 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class nsEffectiveTLDService final
|
2013-12-08 10:09:10 +04:00
|
|
|
: public nsIEffectiveTLDService
|
|
|
|
, public nsIMemoryReporter
|
2006-06-09 22:23:10 +04:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIEFFECTIVETLDSERVICE
|
2013-12-08 10:09:10 +04:00
|
|
|
NS_DECL_NSIMEMORYREPORTER
|
2006-06-09 22:23:10 +04:00
|
|
|
|
2013-09-02 12:41:57 +04:00
|
|
|
nsEffectiveTLDService();
|
2006-06-09 22:23:10 +04:00
|
|
|
nsresult Init();
|
|
|
|
|
2013-06-23 16:03:39 +04:00
|
|
|
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
|
2012-10-19 16:07:13 +04:00
|
|
|
|
2006-06-09 22:23:10 +04:00
|
|
|
private:
|
2013-02-04 21:59:49 +04:00
|
|
|
nsresult GetBaseDomainInternal(nsCString &aHostname, int32_t aAdditionalParts, nsACString &aBaseDomain);
|
2007-07-26 10:31:49 +04:00
|
|
|
nsresult NormalizeHostname(nsCString &aHostname);
|
2012-10-19 16:07:13 +04:00
|
|
|
~nsEffectiveTLDService();
|
2007-07-26 10:31:49 +04:00
|
|
|
|
|
|
|
nsCOMPtr<nsIIDNService> mIDNService;
|
2017-07-18 02:10:18 +03:00
|
|
|
mozilla::Dafsa mGraph;
|
2006-06-09 22:23:10 +04:00
|
|
|
};
|
2013-12-11 23:03:51 +04:00
|
|
|
|
|
|
|
#endif // EffectiveTLDService_h
|