diff --git a/xpinstall/public/nsISoftwareUpdate.h b/xpinstall/public/nsISoftwareUpdate.h index 3cdb0f79ba6..6507d231c34 100644 --- a/xpinstall/public/nsISoftwareUpdate.h +++ b/xpinstall/public/nsISoftwareUpdate.h @@ -65,10 +65,10 @@ #define XPI_NO_NEW_THREAD 0x1000 #define NS_ISOFTWAREUPDATE_IID \ -{ 0x18c2f992, \ - 0xb09f, \ - 0x11d2, \ - {0xbc, 0xde, 0x00, 0x80, 0x5f, 0x0e, 0x13, 0x53}\ +{ 0xfc7c086f, \ + 0xdae0, \ + 0x45e0, \ + {0x99, 0x10, 0xd5, 0xda, 0x91, 0xc8, 0x27, 0x46}\ } class nsIPrincipal; @@ -95,7 +95,7 @@ class nsISoftwareUpdate : public nsISupports NS_IMETHOD RegisterListener(nsIXPIListener *aListener) = 0; /* FIX: these should be in a private interface */ - NS_IMETHOD InstallJarCallBack() = 0; + NS_IMETHOD_(void) InstallJarCallBack() = 0; NS_IMETHOD GetMasterListener(nsIXPIListener **aListener) = 0; NS_IMETHOD SetActiveListener(nsIXPIListener *aListener) = 0; }; diff --git a/xpinstall/src/nsSoftwareUpdate.cpp b/xpinstall/src/nsSoftwareUpdate.cpp index aabe0b03dde..0590660f250 100644 --- a/xpinstall/src/nsSoftwareUpdate.cpp +++ b/xpinstall/src/nsSoftwareUpdate.cpp @@ -358,7 +358,7 @@ nsSoftwareUpdate::InstallChrome( PRUint32 aType, } -NS_IMETHODIMP +NS_IMETHODIMP_(void) nsSoftwareUpdate::InstallJarCallBack() { PR_Lock(mLock); @@ -375,7 +375,7 @@ nsSoftwareUpdate::InstallJarCallBack() PR_Unlock(mLock); - return RunNextInstall(); + RunNextInstall(); } diff --git a/xpinstall/src/nsSoftwareUpdate.h b/xpinstall/src/nsSoftwareUpdate.h index 9cef0c49641..e62a6a870ca 100644 --- a/xpinstall/src/nsSoftwareUpdate.h +++ b/xpinstall/src/nsSoftwareUpdate.h @@ -66,7 +66,7 @@ class nsSoftwareUpdate: public nsISoftwareUpdate, NS_IMETHOD RegisterListener(nsIXPIListener *aListener); - NS_IMETHOD InstallJarCallBack(); + NS_IMETHOD_(void) InstallJarCallBack(); NS_IMETHOD GetMasterListener(nsIXPIListener **aListener); NS_IMETHOD SetActiveListener(nsIXPIListener *aListener); diff --git a/xpinstall/src/nsSoftwareUpdateRun.cpp b/xpinstall/src/nsSoftwareUpdateRun.cpp index 6a3aa3b5dbb..e45976b30ee 100644 --- a/xpinstall/src/nsSoftwareUpdateRun.cpp +++ b/xpinstall/src/nsSoftwareUpdateRun.cpp @@ -582,7 +582,19 @@ extern "C" void PR_CALLBACK RunInstallOnThread(void *data) if (scriptBuffer) delete [] scriptBuffer; softwareUpdate->SetActiveListener(0); - softwareUpdate->InstallJarCallBack(); + + if (installInfo->GetFlags() & XPI_NO_NEW_THREAD) + { + softwareUpdate->InstallJarCallBack(); + } + else + { + // Proxy the callback to the main thread + nsCOMPtr callback = NS_NEW_RUNNABLE_METHOD(nsISoftwareUpdate, + softwareUpdate, + InstallJarCallBack); + NS_DispatchToMainThread(callback); + } }