mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-15 14:30:47 +00:00
Bug 1067229 - allow nsIXULAppInfo::ID and ::Vendor to work in a content process. r=jdm
This commit is contained in:
parent
72ff2b430b
commit
431a53e553
@ -1830,12 +1830,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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -2046,9 +2046,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();
|
||||
|
@ -432,7 +432,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();
|
||||
|
@ -644,7 +644,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);
|
||||
|
||||
@ -668,7 +670,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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user