Bug 1242966 - Make services/crypto eslintable. r=rnewman

This commit is contained in:
Hector Zhao 2016-01-26 23:01:32 +08:00
Родитель 0067cc1e04
Коммит e3ec3c4522
4 изменённых файлов: 23 добавлений и 22 удалений

Просмотреть файл

@ -4,13 +4,12 @@
this.EXPORTED_SYMBOLS = ["WeaveCrypto"];
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cr = Components.results;
var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/ctypes.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/ctypes.jsm");
Cu.import('resource://gre/modules/AppConstants.jsm');
/**
* Shortcuts for some algorithm SEC OIDs. Full list available here:
@ -132,16 +131,16 @@ WeaveCrypto.prototype = {
// XXX really want to be able to pass specific dlopen flags here.
var nsslib;
#ifdef MOZ_NATIVE_NSS
// Search platform-dependent library paths for system NSS.
this.log("Trying NSS library without path");
nsslib = ctypes.open(path);
#else
let file = Services.dirsvc.get("GreBinD", Ci.nsILocalFile);
file.append(path);
this.log("Trying NSS library with path " + file.path);
nsslib = ctypes.open(file.path);
#endif
if (AppConstants.MOZ_NATIVE_NSS) {
// Search platform-dependent library paths for system NSS.
this.log("Trying NSS library without path");
nsslib = ctypes.open(path);
} else {
let file = Services.dirsvc.get("GreBinD", Ci.nsILocalFile);
file.append(path);
this.log("Trying NSS library with path " + file.path);
nsslib = ctypes.open(file.path);
}
this.log("Initializing NSS types and function declarations...");

Просмотреть файл

@ -13,15 +13,9 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
EXTRA_JS_MODULES['services-crypto'] += [
'modules/utils.js',
]
EXTRA_PP_JS_MODULES['services-crypto'] += [
'modules/WeaveCrypto.js',
]
EXTRA_COMPONENTS += [
'cryptoComponents.manifest',
]
if CONFIG['MOZ_NATIVE_NSS']:
DEFINES['MOZ_NATIVE_NSS'] = 1

Просмотреть файл

@ -240,6 +240,13 @@ this.AppConstants = Object.freeze({
false,
#endif
MOZ_NATIVE_NSS:
#ifdef MOZ_NATIVE_NSS
true,
#else
false,
#endif
MOZ_PLACES:
#ifdef MOZ_PLACES
true,

Просмотреть файл

@ -118,6 +118,7 @@ for var in ('ANDROID_PACKAGE_NAME',
for var in ('MOZ_TOOLKIT_SEARCH',
'MOZ_REQUIRE_SIGNING',
'MOZ_NATIVE_NSS',
'MOZ_UPDATER'):
if CONFIG[var]:
DEFINES[var] = True