Bug 694867 - Part d: Store a JSScript in nsXULPrototypeCache; r=volkmar

This commit is contained in:
Ms2ger 2011-10-29 22:14:13 +02:00
parent 2e196a5c20
commit be67644abb
2 changed files with 7 additions and 4 deletions

View File

@ -235,7 +235,7 @@ nsXULPrototypeCache::GetScript(nsIURI* aURI, PRUint32 *aLangID)
return nsnull;
}
*aLangID = entry.mScriptTypeID;
return static_cast<JSScript*>(entry.mScriptObject);
return entry.mScriptObject;
}
@ -250,7 +250,7 @@ ReleaseScriptObjectCallback(nsIURI* aKey, CacheScriptEntry &aData, void* aClosur
}
nsresult
nsXULPrototypeCache::PutScript(nsIURI* aURI, PRUint32 aLangID, void* aScriptObject)
nsXULPrototypeCache::PutScript(nsIURI* aURI, PRUint32 aLangID, JSScript* aScriptObject)
{
CacheScriptEntry existingEntry;
if (mScriptTable.Get(aURI, &existingEntry)) {

View File

@ -53,6 +53,9 @@
#include "nsXULPrototypeDocument.h"
#include "nsIInputStream.h"
#include "nsIStorageStream.h"
#include "jspubtd.h"
#include "mozilla/scache/StartupCache.h"
using namespace mozilla::scache;
@ -62,7 +65,7 @@ class nsCSSStyleSheet;
struct CacheScriptEntry
{
PRUint32 mScriptTypeID; // the script language ID.
void* mScriptObject; // the script object.
JSScript* mScriptObject; // the script object.
};
/**
@ -105,7 +108,7 @@ public:
nsresult PutPrototype(nsXULPrototypeDocument* aDocument);
JSScript* GetScript(nsIURI* aURI, PRUint32* langID);
nsresult PutScript(nsIURI* aURI, PRUint32 langID, void* aScriptObject);
nsresult PutScript(nsIURI* aURI, PRUint32 langID, JSScript* aScriptObject);
nsXBLDocumentInfo* GetXBLDocumentInfo(nsIURI* aURL) {
return mXBLDocTable.GetWeak(aURL);