void WorkerNavigator::GetAppVersion(nsString& aAppVersion) const { WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate(); MOZ_ASSERT(workerPrivate); if (!mProperties.mAppVersionOverridden.IsEmpty() && !workerPrivate->UsesSystemPrincipal()) { aAppVersion = mProperties.mAppVersionOverridden; } else { aAppVersion = mProperties.mAppVersion; } }
void WorkerNavigator::GetPlatform(nsString& aPlatform) const { WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate(); MOZ_ASSERT(workerPrivate); if (!mProperties.mPlatformOverridden.IsEmpty() && !workerPrivate->UsesSystemPrincipal()) { aPlatform = mProperties.mPlatformOverridden; } else { aPlatform = mProperties.mPlatform; } }
void BlobImplBase::GetMozFullPath(nsAString& aFileName, ErrorResult& aRv) const { NS_ASSERTION(mIsFile, "Should only be called on files"); aFileName.Truncate(); if (NS_IsMainThread()) { if (nsContentUtils::LegacyIsCallerChromeOrNativeCode()) { GetMozFullPathInternal(aFileName, aRv); } return; } WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate(); MOZ_ASSERT(workerPrivate); if (workerPrivate->UsesSystemPrincipal()) { GetMozFullPathInternal(aFileName, aRv); } }