Bug 992578, part 2 - Make nsXBLResourceLoader::mLoader private. r=mrbkap

This commit is contained in:
Andrew McCreight 2014-04-10 07:05:21 -07:00
Родитель a548c41b3b
Коммит 4161c5faf7
4 изменённых файлов: 29 добавлений и 8 удалений

Просмотреть файл

@ -148,8 +148,7 @@ nsXBLPrototypeBinding::Traverse(nsCycleCollectionTraversalCallback &cb) const
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "proto mBinding");
cb.NoteXPCOMChild(mBinding);
if (mResources) {
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "proto mResources mLoader");
cb.NoteXPCOMChild(mResources->mLoader);
mResources->Traverse(cb);
}
ImplCycleCollectionTraverse(cb, mInterfaceTable, "proto mInterfaceTable");
}

Просмотреть файл

@ -109,3 +109,16 @@ nsXBLPrototypeResources::Write(nsIObjectOutputStream* aStream)
return mLoader->Write(aStream);
return NS_OK;
}
void
nsXBLPrototypeResources::Traverse(nsCycleCollectionTraversalCallback &cb) const
{
NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "proto mResources mLoader");
cb.NoteXPCOMChild(mLoader);
}
void
nsXBLPrototypeResources::ClearLoader()
{
NS_RELEASE(mLoader);
}

Просмотреть файл

@ -22,6 +22,9 @@ class nsCSSStyleSheet;
class nsXBLPrototypeResources
{
public:
nsXBLPrototypeResources(nsXBLPrototypeBinding* aBinding);
~nsXBLPrototypeResources();
void LoadResources(bool* aResult);
void AddResource(nsIAtom* aResourceType, const nsAString& aSrc);
void AddResourceListener(nsIContent* aElement);
@ -29,13 +32,19 @@ public:
nsresult Write(nsIObjectOutputStream* aStream);
nsXBLPrototypeResources(nsXBLPrototypeBinding* aBinding);
~nsXBLPrototypeResources();
void Traverse(nsCycleCollectionTraversalCallback &cb) const;
void ClearLoader();
// MEMBER VARIABLES
nsXBLResourceLoader* mLoader; // A loader object. Exists only long enough to load resources, and then it dies.
typedef nsTArray<nsRefPtr<nsCSSStyleSheet> > sheet_array_type;
sheet_array_type mStyleSheetList; // A list of loaded stylesheets for this binding.
private:
// A loader object. Exists only long enough to load resources, and then it dies.
nsXBLResourceLoader* mLoader;
public:
// A list of loaded stylesheets for this binding.
sheet_array_type mStyleSheetList;
// The list of stylesheets converted to a rule processor.
nsCOMPtr<nsIStyleRuleProcessor> mRuleProcessor;

Просмотреть файл

@ -274,7 +274,7 @@ nsXBLResourceLoader::NotifyBoundElements()
mBoundElements.Clear();
// Delete ourselves.
NS_RELEASE(mResources->mLoader);
mResources->ClearLoader();
}
nsresult