зеркало из https://github.com/mozilla/pjs.git
Bug 694867 - Part c: Return a JSScript from nsXULPrototypeCache::GetScript; r=volkmar
This commit is contained in:
Родитель
cfab3c7112
Коммит
4fb7228b86
|
@ -3040,7 +3040,7 @@ nsXULPrototypeScript::DeserializeOutOfLine(nsIObjectInputStream* aInput,
|
|||
if (useXULCache) {
|
||||
PRUint32 newLangID = nsIProgrammingLanguage::UNKNOWN;
|
||||
JSScript* newScriptObject =
|
||||
static_cast<JSScript*>(cache->GetScript(mSrcURI, &newLangID));
|
||||
cache->GetScript(mSrcURI, &newLangID);
|
||||
if (newScriptObject) {
|
||||
// Things may blow here if we simply change the script
|
||||
// language - other code may already have pre-fetched the
|
||||
|
|
|
@ -3384,10 +3384,9 @@ nsXULDocument::LoadScript(nsXULPrototypeScript* aScriptProto, bool* aBlock)
|
|||
if (isChromeDoc && useXULCache) {
|
||||
PRUint32 fetchedLang = nsIProgrammingLanguage::UNKNOWN;
|
||||
JSScript* newScriptObject =
|
||||
static_cast<JSScript*>(
|
||||
nsXULPrototypeCache::GetInstance()->GetScript(
|
||||
nsXULPrototypeCache::GetInstance()->GetScript(
|
||||
aScriptProto->mSrcURI,
|
||||
&fetchedLang));
|
||||
&fetchedLang);
|
||||
if (newScriptObject) {
|
||||
// The script language for a proto must remain constant - we
|
||||
// can't just change it for this unexpected language.
|
||||
|
|
|
@ -226,7 +226,7 @@ nsXULPrototypeCache::PutStyleSheet(nsCSSStyleSheet* aStyleSheet)
|
|||
}
|
||||
|
||||
|
||||
void*
|
||||
JSScript*
|
||||
nsXULPrototypeCache::GetScript(nsIURI* aURI, PRUint32 *aLangID)
|
||||
{
|
||||
CacheScriptEntry entry;
|
||||
|
@ -235,7 +235,7 @@ nsXULPrototypeCache::GetScript(nsIURI* aURI, PRUint32 *aLangID)
|
|||
return nsnull;
|
||||
}
|
||||
*aLangID = entry.mScriptTypeID;
|
||||
return entry.mScriptObject;
|
||||
return static_cast<JSScript*>(entry.mScriptObject);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ public:
|
|||
nsXULPrototypeDocument* GetPrototype(nsIURI* aURI);
|
||||
nsresult PutPrototype(nsXULPrototypeDocument* aDocument);
|
||||
|
||||
void* GetScript(nsIURI* aURI, PRUint32* langID);
|
||||
JSScript* GetScript(nsIURI* aURI, PRUint32* langID);
|
||||
nsresult PutScript(nsIURI* aURI, PRUint32 langID, void* aScriptObject);
|
||||
|
||||
nsXBLDocumentInfo* GetXBLDocumentInfo(nsIURI* aURL) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче