gecko/layout/style/nsLayoutStylesheetCache.h
Catalin Iacob 83b78343dc Bug 798914 (part 5) - Use newly introduced mozilla::MallocSizeOf instead of nsMallocSizeOfFun. r=njn.
--HG--
extra : rebase_source : fc472490dd978d165f02f77ed37f07aed6e5bb61
2013-06-23 14:03:39 +02:00

70 lines
1.9 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 nsLayoutStylesheetCache_h__
#define nsLayoutStylesheetCache_h__
#include "nsIObserver.h"
#include "nsAutoPtr.h"
#include "mozilla/Attributes.h"
#include "mozilla/MemoryReporting.h"
class nsIFile;
class nsCSSStyleSheet;
class nsIURI;
namespace mozilla {
namespace css {
class Loader;
}
}
class nsIMemoryReporter;
class nsLayoutStylesheetCache MOZ_FINAL
: public nsIObserver
{
NS_DECL_ISUPPORTS
NS_DECL_NSIOBSERVER
static nsCSSStyleSheet* ScrollbarsSheet();
static nsCSSStyleSheet* FormsSheet();
static nsCSSStyleSheet* UserContentSheet();
static nsCSSStyleSheet* UserChromeSheet();
static nsCSSStyleSheet* UASheet();
static nsCSSStyleSheet* QuirkSheet();
static nsCSSStyleSheet* FullScreenOverrideSheet();
static void Shutdown();
static size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf);
private:
nsLayoutStylesheetCache();
~nsLayoutStylesheetCache();
static void EnsureGlobal();
void InitFromProfile();
static void LoadSheetFile(nsIFile* aFile, nsRefPtr<nsCSSStyleSheet> &aSheet);
static void LoadSheet(nsIURI* aURI, nsRefPtr<nsCSSStyleSheet> &aSheet,
bool aEnableUnsafeRules);
size_t SizeOfIncludingThisHelper(mozilla::MallocSizeOf aMallocSizeOf) const;
static nsLayoutStylesheetCache* gStyleCache;
static mozilla::css::Loader* gCSSLoader;
nsRefPtr<nsCSSStyleSheet> mScrollbarsSheet;
nsRefPtr<nsCSSStyleSheet> mFormsSheet;
nsRefPtr<nsCSSStyleSheet> mUserContentSheet;
nsRefPtr<nsCSSStyleSheet> mUserChromeSheet;
nsRefPtr<nsCSSStyleSheet> mUASheet;
nsRefPtr<nsCSSStyleSheet> mQuirkSheet;
nsRefPtr<nsCSSStyleSheet> mFullScreenOverrideSheet;
nsIMemoryReporter* mReporter;
};
#endif