Skip to content
Snippets Groups Projects
Commit ae5e2614 authored by Kris Maglione's avatar Kris Maglione
Browse files

Bug 1773770: Part 7 - Migrate PowerManagerService to static component registration. r=mccr8

parent 197caa5c
No related branches found
No related tags found
No related merge requests found
......@@ -136,35 +136,3 @@ PowerManagerService::NewWakeLock(const nsAString& aTopic,
}
} // namespace mozilla::dom::power
NS_DEFINE_NAMED_CID(NS_POWERMANAGERSERVICE_CID);
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(
nsIPowerManagerService,
mozilla::dom::power::PowerManagerService::GetInstance)
static const mozilla::Module::CIDEntry kPowerManagerCIDs[] = {
// clang-format off
{ &kNS_POWERMANAGERSERVICE_CID, false, nullptr, nsIPowerManagerServiceConstructor, mozilla::Module::ALLOW_IN_GPU_RDD_AND_SOCKET_PROCESS },
{ nullptr }
// clang-format on
};
static const mozilla::Module::ContractIDEntry kPowerManagerContracts[] = {
// clang-format off
{ POWERMANAGERSERVICE_CONTRACTID, &kNS_POWERMANAGERSERVICE_CID, mozilla::Module::ALLOW_IN_GPU_RDD_AND_SOCKET_PROCESS },
{ nullptr }
// clang-format on
};
// We mark the power module as being available in the GPU process because the
// appshell depends on the power manager service.
extern const mozilla::Module kPowerManagerModule = {
mozilla::Module::kVersion,
kPowerManagerCIDs,
kPowerManagerContracts,
nullptr,
nullptr,
nullptr,
nullptr,
mozilla::Module::ALLOW_IN_GPU_RDD_AND_SOCKET_PROCESS};
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
Classes = [
{
'cid': '{18c2e238-3a0a-4153-89fc-166b3b1465a1}',
'contract_ids': ['@mozilla.org/power/powermanagerservice;1'],
'type': 'mozilla::dom::power::PowerManagerService',
'constructor': 'mozilla::dom::power::PowerManagerService::GetInstance',
'headers': ['mozilla/dom/power/PowerManagerService.h'],
'singleton': True,
'processes': ProcessSelector.ALLOW_IN_GPU_RDD_AND_SOCKET_PROCESS,
},
]
......@@ -15,6 +15,10 @@ XPIDL_SOURCES += [
XPIDL_MODULE = "dom_power"
XPCOM_MANIFESTS += [
"components.conf",
]
EXPORTS.mozilla.dom += [
"WakeLock.h",
]
......
......@@ -6,7 +6,6 @@
#include "nsISupports.idl"
%{C++
#define NS_POWERMANAGERSERVICE_CID { 0x18c2e238, 0x3a0a, 0x4153, {0x89, 0xfc, 0x16, 0x6b, 0x3b, 0x14, 0x65, 0xa1 } }
#define POWERMANAGERSERVICE_CONTRACTID "@mozilla.org/power/powermanagerservice;1"
%}
......
......@@ -271,7 +271,6 @@ nsComponentManagerImpl::nsComponentManagerImpl()
mLock("nsComponentManagerImpl.mLock"),
mStatus(NOT_INITIALIZED) {}
extern const mozilla::Module kPowerManagerModule;
extern const mozilla::Module kContentProcessWidgetModule;
#if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_UIKIT)
extern const mozilla::Module kWidgetModule;
......@@ -360,7 +359,6 @@ nsresult nsComponentManagerImpl::Init() {
nsCategoryManager::GetSingleton()->SuppressNotifications(true);
RegisterModule(&kPowerManagerModule);
RegisterModule(&kContentProcessWidgetModule);
#if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_UIKIT)
RegisterModule(&kWidgetModule);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment