Bug 1543009 - Move layout debugger xpcom components to static registration. r=kmag

Differential Revision: https://phabricator.services.mozilla.com/D26894
This commit is contained in:
Mike Hommey 2019-04-10 16:36:45 +09:00
parent d89350611b
commit 0376919567
7 changed files with 26 additions and 81 deletions

View File

@ -0,0 +1,21 @@
# -*- 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': '{3f4c3b63-e640-4712-abbf-fff1301ceb60}',
'contract_ids': ['@mozilla.org/layout-debug/layout-debuggingtools;1'],
'type': 'nsLayoutDebuggingTools',
'headers': ['/layout/tools/layout-debug/src/nsLayoutDebuggingTools.h'],
},
{
'cid': '{a8f52633-5ecf-424a-a147-47c322f7bc2e}',
'contract_ids': ['@mozilla.org/commandlinehandler/general-startup;1?type=layoutdebug'],
'type': 'nsLayoutDebugCLH',
'headers': ['/layout/tools/layout-debug/src/nsLayoutDebugCLH.h'],
'categories': {'command-line-handler': 'm-layoutdebug'},
},
]

View File

@ -10,16 +10,15 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'layout_debug'
EXPORTS += [
'nsLayoutDebugCIID.h',
]
UNIFIED_SOURCES += [
'nsDebugFactory.cpp',
'nsLayoutDebugCLH.cpp',
'nsLayoutDebuggingTools.cpp',
]
XPCOM_MANIFESTS += [
'components.conf',
]
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'

View File

@ -1,40 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "nscore.h"
#include "nsLayoutDebugCIID.h"
#include "mozilla/ModuleUtils.h"
#include "nsIFactory.h"
#include "nsISupports.h"
#include "nsLayoutDebuggingTools.h"
#include "nsLayoutDebugCLH.h"
#include "nsIServiceManager.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLayoutDebuggingTools)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLayoutDebugCLH)
NS_DEFINE_NAMED_CID(NS_LAYOUT_DEBUGGINGTOOLS_CID);
NS_DEFINE_NAMED_CID(NS_LAYOUTDEBUGCLH_CID);
static const mozilla::Module::CIDEntry kLayoutDebugCIDs[] = {
{&kNS_LAYOUT_DEBUGGINGTOOLS_CID, false, nullptr,
nsLayoutDebuggingToolsConstructor},
{&kNS_LAYOUTDEBUGCLH_CID, false, nullptr, nsLayoutDebugCLHConstructor},
{nullptr}};
static const mozilla::Module::ContractIDEntry kLayoutDebugContracts[] = {
{NS_LAYOUT_DEBUGGINGTOOLS_CONTRACTID, &kNS_LAYOUT_DEBUGGINGTOOLS_CID},
{"@mozilla.org/commandlinehandler/general-startup;1?type=layoutdebug",
&kNS_LAYOUTDEBUGCLH_CID},
{nullptr}};
static const mozilla::Module::CategoryEntry kLayoutDebugCategories[] = {
{"command-line-handler", "m-layoutdebug",
"@mozilla.org/commandlinehandler/general-startup;1?type=layoutdebug"},
{nullptr}};
extern const mozilla::Module kLayoutDebugModule = {
mozilla::Module::kVersion, kLayoutDebugCIDs, kLayoutDebugContracts,
kLayoutDebugCategories};

View File

@ -1,23 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef nsFrameDebugCIID_h__
#define nsFrameDebugCIID_h__
#include "nsISupports.h"
#include "nsIFactory.h"
#include "nsIComponentManager.h"
#define NS_LAYOUT_DEBUGGINGTOOLS_CONTRACTID \
"@mozilla.org/layout-debug/layout-debuggingtools;1"
// 3f4c3b63-e640-4712-abbf-fff1301ceb60
#define NS_LAYOUT_DEBUGGINGTOOLS_CID \
{ \
0x3f4c3b68, 0xe640, 0x4712, { \
0xab, 0xbf, 0xff, 0xf1, 0x30, 0x1c, 0xeb, 0x60 \
} \
}
#endif // nsFrameDebugCIID_h__

View File

@ -14,6 +14,7 @@
#include "nsIDOMWindow.h"
#include "nsISupportsPrimitives.h"
#include "nsICommandLine.h"
#include "nsIURI.h"
nsLayoutDebugCLH::nsLayoutDebugCLH() {}

View File

@ -10,13 +10,6 @@
#include "nsICommandLineHandler.h"
#define ICOMMANDLINEHANDLER nsICommandLineHandler
#define NS_LAYOUTDEBUGCLH_CID \
{ \
0xa8f52633, 0x5ecf, 0x424a, { \
0xa1, 0x47, 0x47, 0xc3, 0x22, 0xf7, 0xbc, 0xe2 \
} \
}
class nsLayoutDebugCLH : public ICOMMANDLINEHANDLER {
public:
nsLayoutDebugCLH();

View File

@ -363,9 +363,6 @@ extern const mozilla::Module kEmbeddingModule;
#if defined(MOZ_WIDGET_ANDROID)
extern const mozilla::Module kBrowserModule;
#endif
#if defined(MOZ_LAYOUT_DEBUGGER) && !defined(MOZ_WIDGET_ANDROID)
extern const mozilla::Module kLayoutDebugModule;
#endif
static nsTArray<const mozilla::Module*>* sExtraStaticModules;
@ -454,9 +451,6 @@ nsresult nsComponentManagerImpl::Init() {
#if defined(MOZ_WIDGET_ANDROID)
RegisterModule(&kBrowserModule);
#endif
#if defined(MOZ_LAYOUT_DEBUGGER) && !defined(MOZ_WIDGET_ANDROID)
RegisterModule(&kLayoutDebugModule);
#endif
for (uint32_t i = 0; i < sExtraStaticModules->Length(); ++i) {
RegisterModule((*sExtraStaticModules)[i]);