Bug 1393150 Fix isParentProcess() logic
MozReview-Commit-ID: 5dpg21Y69Uk
--- a/toolkit/components/extensions/ExtensionPolicyService.cpp
+++ b/toolkit/components/extensions/ExtensionPolicyService.cpp
@@ -80,21 +80,24 @@ ExtensionPolicyService::ExtensionPolicyS
RegisterObservers();
}
bool
ExtensionPolicyService::IsExtensionProcess() const
{
- if (sRemoteExtensions && XRE_IsContentProcess()) {
- auto& remoteType = dom::ContentChild::GetSingleton()->GetRemoteType();
- return remoteType.EqualsLiteral(EXTENSION_REMOTE_TYPE);
+ if (!sRemoteExtensions) {
+ return XRE_IsParentProcess();
}
- return XRE_IsParentProcess();
+ if (!XRE_IsContentProcess()) {
+ return false;
+ }
+ auto& remoteType = dom::ContentChild::GetSingleton()->GetRemoteType();
+ return remoteType.EqualsLiteral(EXTENSION_REMOTE_TYPE);
}
WebExtensionPolicy*
ExtensionPolicyService::GetByURL(const URLInfo& aURL)
{
if (aURL.Scheme() == nsGkAtoms::moz_extension) {
return GetByHost(aURL.Host());