зеркало из https://github.com/mozilla/gecko-dev.git
Bug 886903 - Send correct UserAgent data for content process. r=jdm
This commit is contained in:
Родитель
c6c8f740f8
Коммит
a2ae0d76c3
|
@ -1181,10 +1181,13 @@ PreloadSlowThings()
|
|||
}
|
||||
|
||||
bool
|
||||
ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID)
|
||||
ContentChild::RecvAppInfo(const nsCString& version, const nsCString& buildID,
|
||||
const nsCString& name, const nsCString& UAName)
|
||||
{
|
||||
mAppInfo.version.Assign(version);
|
||||
mAppInfo.buildID.Assign(buildID);
|
||||
mAppInfo.name.Assign(name);
|
||||
mAppInfo.UAName.Assign(UAName);
|
||||
// If we're part of the mozbrowser machinery, go ahead and start
|
||||
// preloading things. We can only do this for mozbrowser because
|
||||
// PreloadSlowThings() may set the docshell of the first TabChild
|
||||
|
|
|
@ -60,6 +60,8 @@ public:
|
|||
{
|
||||
nsCString version;
|
||||
nsCString buildID;
|
||||
nsCString name;
|
||||
nsCString UAName;
|
||||
};
|
||||
|
||||
bool Init(MessageLoop* aIOLoop,
|
||||
|
@ -194,7 +196,8 @@ public:
|
|||
virtual bool RecvGarbageCollect();
|
||||
virtual bool RecvCycleCollect();
|
||||
|
||||
virtual bool RecvAppInfo(const nsCString& version, const nsCString& buildID);
|
||||
virtual bool RecvAppInfo(const nsCString& version, const nsCString& buildID,
|
||||
const nsCString& name, const nsCString& UAName);
|
||||
|
||||
virtual bool RecvLastPrivateDocShellDestroyed();
|
||||
|
||||
|
|
|
@ -1133,9 +1133,11 @@ ContentParent::ContentParent(mozIApplication* aApp,
|
|||
if (gAppData) {
|
||||
nsCString version(gAppData->version);
|
||||
nsCString buildID(gAppData->buildID);
|
||||
nsCString name(gAppData->name);
|
||||
nsCString UAName(gAppData->UAName);
|
||||
|
||||
//Sending all information to content process
|
||||
unused << SendAppInfo(version, buildID);
|
||||
unused << SendAppInfo(version, buildID, name, UAName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -258,7 +258,7 @@ child:
|
|||
*/
|
||||
ActivateA11y();
|
||||
|
||||
AppInfo(nsCString version, nsCString buildID);
|
||||
AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName);
|
||||
|
||||
// Notify child that last-pb-context-exited notification was observed
|
||||
LastPrivateDocShellDestroyed();
|
||||
|
|
|
@ -632,7 +632,9 @@ NS_IMETHODIMP
|
|||
nsXULAppInfo::GetName(nsACString& aResult)
|
||||
{
|
||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
ContentChild* cc = ContentChild::GetSingleton();
|
||||
aResult = cc->GetAppInfo().name;
|
||||
return NS_OK;
|
||||
}
|
||||
aResult.Assign(gAppData->name);
|
||||
|
||||
|
@ -696,7 +698,9 @@ NS_IMETHODIMP
|
|||
nsXULAppInfo::GetUAName(nsACString& aResult)
|
||||
{
|
||||
if (XRE_GetProcessType() == GeckoProcessType_Content) {
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
ContentChild* cc = ContentChild::GetSingleton();
|
||||
aResult = cc->GetAppInfo().UAName;
|
||||
return NS_OK;
|
||||
}
|
||||
aResult.Assign(gAppData->UAName);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче