js/xpconnect/src/XPCModule.h

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 /* vim: set ts=8 sts=4 et sw=4 tw=99: */
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 #include "xpcprivate.h"
michael@0 8 #include "mozilla/ModuleUtils.h"
michael@0 9 #include "mozJSComponentLoader.h"
michael@0 10 #include "mozJSSubScriptLoader.h"
michael@0 11
michael@0 12 /* Module implementation for the xpconnect library. */
michael@0 13
michael@0 14 #define XPCVARIANT_CONTRACTID "@mozilla.org/xpcvariant;1"
michael@0 15
michael@0 16 // {FE4F7592-C1FC-4662-AC83-538841318803}
michael@0 17 #define SCRIPTABLE_INTERFACES_CID \
michael@0 18 {0xfe4f7592, 0xc1fc, 0x4662, \
michael@0 19 { 0xac, 0x83, 0x53, 0x88, 0x41, 0x31, 0x88, 0x3 } }
michael@0 20
michael@0 21 #define MOZJSSUBSCRIPTLOADER_CONTRACTID "@mozilla.org/moz/jssubscript-loader;1"
michael@0 22
michael@0 23 NS_GENERIC_FACTORY_CONSTRUCTOR(nsJSID)
michael@0 24 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIXPConnect,
michael@0 25 nsXPConnect::GetSingleton)
michael@0 26 NS_GENERIC_FACTORY_CONSTRUCTOR(nsScriptError)
michael@0 27
michael@0 28 NS_GENERIC_FACTORY_CONSTRUCTOR(mozJSComponentLoader)
michael@0 29 NS_GENERIC_FACTORY_CONSTRUCTOR(mozJSSubScriptLoader)
michael@0 30
michael@0 31 NS_DEFINE_NAMED_CID(NS_JS_ID_CID);
michael@0 32 NS_DEFINE_NAMED_CID(NS_XPCONNECT_CID);
michael@0 33 NS_DEFINE_NAMED_CID(NS_XPCEXCEPTION_CID);
michael@0 34 NS_DEFINE_NAMED_CID(NS_SCRIPTERROR_CID);
michael@0 35 NS_DEFINE_NAMED_CID(MOZJSCOMPONENTLOADER_CID);
michael@0 36 NS_DEFINE_NAMED_CID(MOZ_JSSUBSCRIPTLOADER_CID);
michael@0 37
michael@0 38 #define XPCONNECT_CIDENTRIES \
michael@0 39 { &kNS_JS_ID_CID, false, nullptr, nsJSIDConstructor }, \
michael@0 40 { &kNS_XPCONNECT_CID, false, nullptr, nsIXPConnectConstructor }, \
michael@0 41 { &kNS_SCRIPTERROR_CID, false, nullptr, nsScriptErrorConstructor }, \
michael@0 42 { &kMOZJSCOMPONENTLOADER_CID, false, nullptr, mozJSComponentLoaderConstructor },\
michael@0 43 { &kMOZ_JSSUBSCRIPTLOADER_CID, false, nullptr, mozJSSubScriptLoaderConstructor },
michael@0 44
michael@0 45 #define XPCONNECT_CONTRACTS \
michael@0 46 { XPC_ID_CONTRACTID, &kNS_JS_ID_CID }, \
michael@0 47 { XPC_XPCONNECT_CONTRACTID, &kNS_XPCONNECT_CID }, \
michael@0 48 { XPC_CONTEXT_STACK_CONTRACTID, &kNS_XPCONNECT_CID }, \
michael@0 49 { XPC_RUNTIME_CONTRACTID, &kNS_XPCONNECT_CID }, \
michael@0 50 { NS_SCRIPTERROR_CONTRACTID, &kNS_SCRIPTERROR_CID }, \
michael@0 51 { MOZJSCOMPONENTLOADER_CONTRACTID, &kMOZJSCOMPONENTLOADER_CID }, \
michael@0 52 { MOZJSSUBSCRIPTLOADER_CONTRACTID, &kMOZ_JSSUBSCRIPTLOADER_CID },
michael@0 53
michael@0 54 #define XPCONNECT_CATEGORIES \
michael@0 55 { "module-loader", "js", MOZJSCOMPONENTLOADER_CONTRACTID },
michael@0 56
michael@0 57 nsresult xpcModuleCtor();
michael@0 58 void xpcModuleDtor();

mercurial