gecko/layout/style/nsLayoutStylesheetCache.h
Nicholas Nethercote c25fbec4b1 Bug 831193 (part 14) - Don't use NS_MEMORY_REPORTER_IMPLEMENT in layout/. r=jlebar.
--HG--
extra : rebase_source : 371e32e98e3c36daa5d70c40bace457d7072ddaa
2013-01-17 16:45:12 -08:00

70 lines
2.0 KiB
C++

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* 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 nsCSSStyleSheet;
class nsIFile;
class nsIMemoryReporter;
class nsIURI;
namespace mozilla {
namespace css {
class Loader;
}
}
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;
nsCOMPtr<nsIMemoryReporter> mReporter;
};
#endif