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

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nscore.h"
michael@0 7 #include "nsLayoutDebugCIID.h"
michael@0 8 #include "mozilla/ModuleUtils.h"
michael@0 9 #include "nsIFactory.h"
michael@0 10 #include "nsISupports.h"
michael@0 11 #include "nsRegressionTester.h"
michael@0 12 #include "nsLayoutDebuggingTools.h"
michael@0 13 #include "nsLayoutDebugCLH.h"
michael@0 14 #include "nsIServiceManager.h"
michael@0 15
michael@0 16 NS_GENERIC_FACTORY_CONSTRUCTOR(nsRegressionTester)
michael@0 17 NS_GENERIC_FACTORY_CONSTRUCTOR(nsLayoutDebuggingTools)
michael@0 18 NS_GENERIC_FACTORY_CONSTRUCTOR(nsLayoutDebugCLH)
michael@0 19
michael@0 20 NS_DEFINE_NAMED_CID(NS_REGRESSION_TESTER_CID);
michael@0 21 NS_DEFINE_NAMED_CID(NS_LAYOUT_DEBUGGINGTOOLS_CID);
michael@0 22 NS_DEFINE_NAMED_CID(NS_LAYOUTDEBUGCLH_CID);
michael@0 23
michael@0 24 static const mozilla::Module::CIDEntry kLayoutDebugCIDs[] = {
michael@0 25 { &kNS_REGRESSION_TESTER_CID, false, nullptr, nsRegressionTesterConstructor },
michael@0 26 { &kNS_LAYOUT_DEBUGGINGTOOLS_CID, false, nullptr, nsLayoutDebuggingToolsConstructor },
michael@0 27 { &kNS_LAYOUTDEBUGCLH_CID, false, nullptr, nsLayoutDebugCLHConstructor },
michael@0 28 { nullptr }
michael@0 29 };
michael@0 30
michael@0 31 static const mozilla::Module::ContractIDEntry kLayoutDebugContracts[] = {
michael@0 32 { "@mozilla.org/layout-debug/regressiontester;1", &kNS_REGRESSION_TESTER_CID },
michael@0 33 { NS_LAYOUT_DEBUGGINGTOOLS_CONTRACTID, &kNS_LAYOUT_DEBUGGINGTOOLS_CID },
michael@0 34 { "@mozilla.org/commandlinehandler/general-startup;1?type=layoutdebug", &kNS_LAYOUTDEBUGCLH_CID },
michael@0 35 { nullptr }
michael@0 36 };
michael@0 37
michael@0 38 static const mozilla::Module::CategoryEntry kLayoutDebugCategories[] = {
michael@0 39 { "command-line-handler", "m-layoutdebug", "@mozilla.org/commandlinehandler/general-startup;1?type=layoutdebug" },
michael@0 40 { nullptr }
michael@0 41 };
michael@0 42
michael@0 43 static const mozilla::Module kLayoutDebugModule = {
michael@0 44 mozilla::Module::kVersion,
michael@0 45 kLayoutDebugCIDs,
michael@0 46 kLayoutDebugContracts,
michael@0 47 kLayoutDebugCategories
michael@0 48 };
michael@0 49
michael@0 50 NSMODULE_DEFN(nsLayoutDebugModule) = &kLayoutDebugModule;

mercurial