Bug 1067229 - allow nsIXULAppInfo::ID and ::Vendor to work in a content process. r=jdm

This commit is contained in:
Mark Hammond 2014-09-24 16:14:55 +10:00
parent 70e40b7096
commit ad92e3d7a8
5 changed files with 20 additions and 7 deletions

View File

@ -1827,12 +1827,15 @@ PreloadSlowThings()
bool
ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID,
const nsCString& name, const nsCString& UAName)
const nsCString& name, const nsCString& UAName,
const nsCString& ID, const nsCString& vendor)
{
mAppInfo.version.Assign(version);
mAppInfo.buildID.Assign(buildID);
mAppInfo.name.Assign(name);
mAppInfo.UAName.Assign(UAName);
mAppInfo.ID.Assign(ID);
mAppInfo.vendor.Assign(vendor);
if (!Preferences::GetBool("dom.ipc.processPrelaunch.enabled", false)) {
return true;

View File

@ -70,6 +70,8 @@ public:
nsCString buildID;
nsCString name;
nsCString UAName;
nsCString ID;
nsCString vendor;
};
bool Init(MessageLoop* aIOLoop,
@ -297,7 +299,8 @@ public:
virtual bool RecvCycleCollect() MOZ_OVERRIDE;
virtual bool RecvAppInfo(const nsCString& version, const nsCString& buildID,
const nsCString& name, const nsCString& UAName) MOZ_OVERRIDE;
const nsCString& name, const nsCString& UAName,
const nsCString& ID, const nsCString& vendor) MOZ_OVERRIDE;
virtual bool RecvLastPrivateDocShellDestroyed() MOZ_OVERRIDE;

View File

@ -2044,9 +2044,11 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority,
nsCString buildID(gAppData->buildID);
nsCString name(gAppData->name);
nsCString UAName(gAppData->UAName);
nsCString ID(gAppData->ID);
nsCString vendor(gAppData->vendor);
// Sending all information to content process.
unused << SendAppInfo(version, buildID, name, UAName);
unused << SendAppInfo(version, buildID, name, UAName, ID, vendor);
}
nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance();

View File

@ -438,7 +438,8 @@ child:
*/
ActivateA11y();
AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName);
AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName,
nsCString ID, nsCString vendor);
// Notify child that last-pb-context-exited notification was observed
LastPrivateDocShellDestroyed();

View File

@ -669,7 +669,9 @@ NS_IMETHODIMP
nsXULAppInfo::GetVendor(nsACString& aResult)
{
if (XRE_GetProcessType() == GeckoProcessType_Content) {
return NS_ERROR_NOT_AVAILABLE;
ContentChild* cc = ContentChild::GetSingleton();
aResult = cc->GetAppInfo().vendor;
return NS_OK;
}
aResult.Assign(gAppData->vendor);
@ -693,7 +695,9 @@ NS_IMETHODIMP
nsXULAppInfo::GetID(nsACString& aResult)
{
if (XRE_GetProcessType() == GeckoProcessType_Content) {
return NS_ERROR_NOT_AVAILABLE;
ContentChild* cc = ContentChild::GetSingleton();
aResult = cc->GetAppInfo().ID;
return NS_OK;
}
aResult.Assign(gAppData->ID);
@ -4593,7 +4597,7 @@ mozilla::BrowserTabsRemoteAutostart()
!Preferences::GetBool("layers.acceleration.force-enabled", false);
// Check env flags
if (!accelDisabled) {
const char *acceleratedEnv = PR_GetEnv("MOZ_ACCELERATED");
const char *acceleratedEnv = PR_GetEnv("MOZ_ACCELERATED");
if (acceleratedEnv && (*acceleratedEnv != '0')) {
accelDisabled = false;
}