js/xpconnect/tests/components/native/xpctest_module.cpp

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 2 *
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 /* module registration and factory code. */
michael@0 8
michael@0 9 #include "mozilla/ModuleUtils.h"
michael@0 10 #include "xpctest_private.h"
michael@0 11
michael@0 12 #define NS_XPCTESTOBJECTREADONLY_CID \
michael@0 13 { 0x492609a7, 0x2582, 0x436b, \
michael@0 14 { 0xb0, 0xef, 0x92, 0xe2, 0x9b, 0xb9, 0xe1, 0x43 } }
michael@0 15
michael@0 16 #define NS_XPCTESTOBJECTREADWRITE_CID \
michael@0 17 { 0x8f37f760, 0x3686, 0x4dbb, \
michael@0 18 { 0xb1, 0x21, 0x96, 0x93, 0xba, 0x81, 0x3f, 0x8f } }
michael@0 19
michael@0 20 #define NS_XPCTESTPARAMS_CID \
michael@0 21 { 0x1f11076a, 0x0fa2, 0x4f07, \
michael@0 22 { 0xb4, 0x7a, 0xa1, 0x54, 0x31, 0xf2, 0xce, 0xf7 } }
michael@0 23
michael@0 24 NS_GENERIC_FACTORY_CONSTRUCTOR(xpcTestObjectReadOnly)
michael@0 25 NS_GENERIC_FACTORY_CONSTRUCTOR(xpcTestObjectReadWrite)
michael@0 26 NS_GENERIC_FACTORY_CONSTRUCTOR(nsXPCTestParams)
michael@0 27 NS_DEFINE_NAMED_CID(NS_XPCTESTOBJECTREADONLY_CID);
michael@0 28 NS_DEFINE_NAMED_CID(NS_XPCTESTOBJECTREADWRITE_CID);
michael@0 29 NS_DEFINE_NAMED_CID(NS_XPCTESTPARAMS_CID);
michael@0 30
michael@0 31 static const mozilla::Module::CIDEntry kXPCTestCIDs[] = {
michael@0 32 { &kNS_XPCTESTOBJECTREADONLY_CID, false, nullptr, xpcTestObjectReadOnlyConstructor },
michael@0 33 { &kNS_XPCTESTOBJECTREADWRITE_CID, false, nullptr, xpcTestObjectReadWriteConstructor },
michael@0 34 { &kNS_XPCTESTPARAMS_CID, false, nullptr, nsXPCTestParamsConstructor },
michael@0 35 { nullptr }
michael@0 36 };
michael@0 37
michael@0 38 static const mozilla::Module::ContractIDEntry kXPCTestContracts[] = {
michael@0 39 { "@mozilla.org/js/xpc/test/native/ObjectReadOnly;1", &kNS_XPCTESTOBJECTREADONLY_CID },
michael@0 40 { "@mozilla.org/js/xpc/test/native/ObjectReadWrite;1", &kNS_XPCTESTOBJECTREADWRITE_CID },
michael@0 41 { "@mozilla.org/js/xpc/test/native/Params;1", &kNS_XPCTESTPARAMS_CID },
michael@0 42 { nullptr }
michael@0 43 };
michael@0 44
michael@0 45 static const mozilla::Module kXPCTestModule = {
michael@0 46 mozilla::Module::kVersion,
michael@0 47 kXPCTestCIDs,
michael@0 48 kXPCTestContracts
michael@0 49 };
michael@0 50
michael@0 51 NSMODULE_DEFN(xpconnect_test) = &kXPCTestModule;

mercurial