Bug 1290218 Part 6: Generalize nsXULPrototypeCache to hold StyleSheet instead of CSSStyleSheet.
MozReview-Commit-ID: 5OdDzJMZ4lH
--- a/dom/xul/nsXULPrototypeCache.cpp
+++ b/dom/xul/nsXULPrototypeCache.cpp
@@ -185,17 +185,17 @@ nsXULPrototypeCache::PutPrototype(nsXULP
// Put() releases any old value and addrefs the new one
mPrototypeTable.Put(uri, aDocument);
return NS_OK;
}
nsresult
-nsXULPrototypeCache::PutStyleSheet(CSSStyleSheet* aStyleSheet)
+nsXULPrototypeCache::PutStyleSheet(StyleSheet* aStyleSheet)
{
nsIURI* uri = aStyleSheet->GetSheetURI();
mStyleSheetTable.Put(uri, aStyleSheet);
return NS_OK;
}
--- a/dom/xul/nsXULPrototypeCache.h
+++ b/dom/xul/nsXULPrototypeCache.h
@@ -15,17 +15,17 @@
#include "nsURIHashKey.h"
#include "nsXULPrototypeDocument.h"
#include "nsIInputStream.h"
#include "nsIStorageStream.h"
#include "mozilla/scache/StartupCache.h"
namespace mozilla {
-class CSSStyleSheet;
+class StyleSheet;
} // namespace mozilla
/**
* The XUL prototype cache can be used to store and retrieve shared data for
* XUL documents, style sheets, XBL, and scripts.
*
* The cache has two levels:
* 1. In-memory hashtables
@@ -69,25 +69,25 @@ public:
return mXBLDocTable.GetWeak(aURL);
}
nsresult PutXBLDocumentInfo(nsXBLDocumentInfo* aDocumentInfo);
/**
* Get a style sheet by URI. If the style sheet is not in the cache,
* returns nullptr.
*/
- mozilla::CSSStyleSheet* GetStyleSheet(nsIURI* aURI) {
+ mozilla::StyleSheet* GetStyleSheet(nsIURI* aURI) {
return mStyleSheetTable.GetWeak(aURI);
}
/**
* Store a style sheet in the cache. The key, style sheet's URI is obtained
* from the style sheet itself.
*/
- nsresult PutStyleSheet(mozilla::CSSStyleSheet* aStyleSheet);
+ nsresult PutStyleSheet(mozilla::StyleSheet* aStyleSheet);
/**
* Write the XUL prototype document to a cache file. The proto must be
* fully loaded.
*/
nsresult WritePrototype(nsXULPrototypeDocument* aPrototypeDocument);
/**
@@ -118,17 +118,17 @@ protected:
nsXULPrototypeCache();
virtual ~nsXULPrototypeCache();
static nsXULPrototypeCache* sInstance;
void FlushSkinFiles();
nsRefPtrHashtable<nsURIHashKey,nsXULPrototypeDocument> mPrototypeTable; // owns the prototypes
- nsRefPtrHashtable<nsURIHashKey,mozilla::CSSStyleSheet> mStyleSheetTable;
+ nsRefPtrHashtable<nsURIHashKey,mozilla::StyleSheet> mStyleSheetTable;
nsJSThingHashtable<nsURIHashKey, JSScript*> mScriptTable;
nsRefPtrHashtable<nsURIHashKey,nsXBLDocumentInfo> mXBLDocTable;
// URIs already written to the startup cache, to prevent double-caching.
nsTHashtable<nsURIHashKey> mStartupCacheURITable;
nsInterfaceHashtable<nsURIHashKey, nsIStorageStream> mOutputStreamTable;
nsInterfaceHashtable<nsURIHashKey, nsIObjectInputStream> mInputStreamTable;