layout/tools/layout-debug/src/nsDebugFactory.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/tools/layout-debug/src/nsDebugFactory.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,50 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nscore.h"
    1.10 +#include "nsLayoutDebugCIID.h"
    1.11 +#include "mozilla/ModuleUtils.h"
    1.12 +#include "nsIFactory.h"
    1.13 +#include "nsISupports.h"
    1.14 +#include "nsRegressionTester.h"
    1.15 +#include "nsLayoutDebuggingTools.h"
    1.16 +#include "nsLayoutDebugCLH.h"
    1.17 +#include "nsIServiceManager.h"
    1.18 +
    1.19 +NS_GENERIC_FACTORY_CONSTRUCTOR(nsRegressionTester)
    1.20 +NS_GENERIC_FACTORY_CONSTRUCTOR(nsLayoutDebuggingTools)
    1.21 +NS_GENERIC_FACTORY_CONSTRUCTOR(nsLayoutDebugCLH)
    1.22 +
    1.23 +NS_DEFINE_NAMED_CID(NS_REGRESSION_TESTER_CID);
    1.24 +NS_DEFINE_NAMED_CID(NS_LAYOUT_DEBUGGINGTOOLS_CID);
    1.25 +NS_DEFINE_NAMED_CID(NS_LAYOUTDEBUGCLH_CID);
    1.26 +
    1.27 +static const mozilla::Module::CIDEntry kLayoutDebugCIDs[] = {
    1.28 +  { &kNS_REGRESSION_TESTER_CID, false, nullptr, nsRegressionTesterConstructor },
    1.29 +  { &kNS_LAYOUT_DEBUGGINGTOOLS_CID, false, nullptr, nsLayoutDebuggingToolsConstructor },
    1.30 +  { &kNS_LAYOUTDEBUGCLH_CID, false, nullptr, nsLayoutDebugCLHConstructor },
    1.31 +  { nullptr }
    1.32 +};
    1.33 +
    1.34 +static const mozilla::Module::ContractIDEntry kLayoutDebugContracts[] = {
    1.35 +  { "@mozilla.org/layout-debug/regressiontester;1", &kNS_REGRESSION_TESTER_CID },
    1.36 +  { NS_LAYOUT_DEBUGGINGTOOLS_CONTRACTID, &kNS_LAYOUT_DEBUGGINGTOOLS_CID },
    1.37 +  { "@mozilla.org/commandlinehandler/general-startup;1?type=layoutdebug", &kNS_LAYOUTDEBUGCLH_CID },
    1.38 +  { nullptr }
    1.39 +};
    1.40 +
    1.41 +static const mozilla::Module::CategoryEntry kLayoutDebugCategories[] = {
    1.42 +  { "command-line-handler", "m-layoutdebug", "@mozilla.org/commandlinehandler/general-startup;1?type=layoutdebug" },
    1.43 +  { nullptr }
    1.44 +};
    1.45 +
    1.46 +static const mozilla::Module kLayoutDebugModule = {
    1.47 +  mozilla::Module::kVersion,
    1.48 +  kLayoutDebugCIDs,
    1.49 +  kLayoutDebugContracts,
    1.50 +  kLayoutDebugCategories
    1.51 +};
    1.52 +
    1.53 +NSMODULE_DEFN(nsLayoutDebugModule) = &kLayoutDebugModule;

mercurial