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.

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

mercurial