зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to mozilla-inbound
This commit is contained in:
Коммит
64209eb4d9
|
@ -9,6 +9,14 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
aitc_modules := \
|
||||
browserid.js \
|
||||
client.js \
|
||||
main.js \
|
||||
manager.js \
|
||||
storage.js \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_COMPONENTS = \
|
||||
AitcComponents.manifest \
|
||||
Aitc.js \
|
||||
|
@ -16,8 +24,9 @@ EXTRA_COMPONENTS = \
|
|||
|
||||
PREF_JS_EXPORTS = $(srcdir)/services-aitc.js
|
||||
|
||||
libs::
|
||||
$(NSINSTALL) $(srcdir)/modules/* $(FINAL_TARGET)/modules/services-aitc
|
||||
AITC_MODULE_FILES := $(addprefix modules/,$(aitc_modules))
|
||||
AITC_MODULE_DEST = $(FINAL_TARGET)/modules/services-aitc
|
||||
INSTALL_TARGETS += AITC_MODULE
|
||||
|
||||
TEST_DIRS += tests
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
PREF_JS_EXPORTS = $(srcdir)/services-common.js
|
||||
|
||||
modules := \
|
||||
async.js \
|
||||
log4moz.js \
|
||||
|
@ -23,25 +21,25 @@ modules := \
|
|||
utils.js \
|
||||
$(NULL)
|
||||
|
||||
source_modules = $(foreach module,$(modules),$(srcdir)/$(module))
|
||||
module_dir = $(FINAL_TARGET)/modules/services-common
|
||||
|
||||
libs::
|
||||
$(NSINSTALL) -D $(module_dir)
|
||||
$(NSINSTALL) $(source_modules) $(module_dir)
|
||||
|
||||
TEST_DIRS += tests
|
||||
|
||||
testing_modules := \
|
||||
aitcserver.js \
|
||||
storageserver.js \
|
||||
utils.js \
|
||||
$(NULL)
|
||||
|
||||
TESTING_JS_MODULES := $(foreach file,$(testing_modules),modules-testing/$(file))
|
||||
TEST_DIRS += tests
|
||||
|
||||
PREF_JS_EXPORTS = $(srcdir)/services-common.js
|
||||
|
||||
MODULES_FILES := $(modules)
|
||||
MODULES_DEST = $(FINAL_TARGET)/modules/services-common
|
||||
INSTALL_TARGETS += MODULES
|
||||
|
||||
TESTING_JS_MODULES := $(addprefix modules-testing/,$(testing_modules))
|
||||
TESTING_JS_MODULE_DIR := services-common
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
# What follows is a helper to launch a standalone storage server instance.
|
||||
# Most of the code lives in a Python script in the tests directory. If we
|
||||
# ever consolidate our Python code, and/or have a supplemental driver for the
|
||||
|
@ -64,4 +62,3 @@ aitc-server:
|
|||
$(PYTHON) $(srcdir)/tests/run_server.py $(topsrcdir) \
|
||||
$(MOZ_BUILD_ROOT) run_aitc_server.js --port $(aitc_server_port)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
@ -10,10 +9,16 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
modules := \
|
||||
utils.js \
|
||||
WeaveCrypto.js \
|
||||
$(NULL)
|
||||
|
||||
MODULE = services-crypto
|
||||
|
||||
libs::
|
||||
$(PYTHON) $(topsrcdir)/config/nsinstall.py $(srcdir)/modules/* $(FINAL_TARGET)/modules/services-crypto
|
||||
CRYPTO_MODULE_FILES := $(addprefix modules/,$(modules))
|
||||
CRYPTO_MODULE_DEST = $(FINAL_TARGET)/modules/services-crypto
|
||||
INSTALL_TARGETS += CRYPTO_MODULE
|
||||
|
||||
TEST_DIRS += tests
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
@ -12,21 +11,21 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
FAIL_ON_WARNINGS := 1
|
||||
|
||||
MODULE = services-crypto
|
||||
XPIDL_MODULE = services-crypto-component
|
||||
MODULE := services-crypto
|
||||
XPIDL_MODULE := services-crypto-component
|
||||
|
||||
XPIDLSRCS = \
|
||||
XPIDLSRCS := \
|
||||
nsISyncJPAKE.idl \
|
||||
$(NULL)
|
||||
|
||||
LIBRARY_NAME = services-crypto
|
||||
EXPORT_LIBRARY = 1
|
||||
IS_COMPONENT = 1
|
||||
MODULE_NAME = nsServicesCryptoModule
|
||||
LIBXUL_LIBRARY = 1
|
||||
MOZILLA_INTERNAL_API = 1
|
||||
LIBRARY_NAME := services-crypto
|
||||
EXPORT_LIBRARY := 1
|
||||
IS_COMPONENT := 1
|
||||
MODULE_NAME := nsServicesCryptoModule
|
||||
LIBXUL_LIBRARY := 1
|
||||
MOZILLA_INTERNAL_API := 1
|
||||
|
||||
CPPSRCS = \
|
||||
CPPSRCS := \
|
||||
nsSyncJPAKE.cpp \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -2,30 +2,26 @@
|
|||
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
# You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
DEPTH = @DEPTH@
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
DEPTH := @DEPTH@
|
||||
topsrcdir := @top_srcdir@
|
||||
srcdir := @srcdir@
|
||||
VPATH := @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
EXTRA_COMPONENTS = \
|
||||
EXTRA_COMPONENTS := \
|
||||
NotificationsComponents.manifest \
|
||||
$(NULL)
|
||||
|
||||
PREF_JS_EXPORTS = $(srcdir)/services-notifications.js
|
||||
PREF_JS_EXPORTS := $(srcdir)/services-notifications.js
|
||||
|
||||
modules := \
|
||||
service.js \
|
||||
$(NULL)
|
||||
|
||||
source_modules = $(foreach module,$(modules),$(srcdir)/$(module))
|
||||
module_dir = $(FINAL_TARGET)/modules/services-notifications
|
||||
|
||||
GENERATED_DIRS += $(module_dir)
|
||||
|
||||
libs::
|
||||
$(NSINSTALL) $(source_modules) $(module_dir)
|
||||
NOTIFICATION_MODULE_FILES := $(modules)
|
||||
NOTIFICATION_MODULE_DEST = $(FINAL_TARGET)/modules/services-notifications
|
||||
INSTALL_TARGETS += NOTIFICATION_MODULE
|
||||
|
||||
TEST_DIRS += tests
|
||||
|
||||
|
|
|
@ -14,12 +14,50 @@ weave_version := 1.19.0
|
|||
weave_channel := rel
|
||||
weave_id := {340c2bbc-ce74-4362-90b5-7c26312808ef}
|
||||
|
||||
sync_pp_defines := \
|
||||
# Preprocess files.
|
||||
SYNC_PP := modules/constants.js
|
||||
SYNC_PP_FLAGS := \
|
||||
-Dweave_version=$(weave_version) \
|
||||
-Dweave_channel=$(weave_channel) \
|
||||
-Dweave_id=$(weave_id)
|
||||
SYNC_PP_PATH = $(FINAL_TARGET)/modules/services-sync
|
||||
PP_TARGETS += SYNC_PP
|
||||
|
||||
DIRS := locales
|
||||
# The set of core JavaScript modules for Sync. These are copied as-is.
|
||||
sync_modules := \
|
||||
addonsreconciler.js \
|
||||
addonutils.js \
|
||||
engines.js \
|
||||
identity.js \
|
||||
jpakeclient.js \
|
||||
keys.js \
|
||||
main.js \
|
||||
notifications.js \
|
||||
policies.js \
|
||||
record.js \
|
||||
resource.js \
|
||||
rest.js \
|
||||
service.js \
|
||||
status.js \
|
||||
util.js \
|
||||
$(NULL)
|
||||
|
||||
# The set of JavaScript modules provide engines for Sync. These are
|
||||
# copied as-is.
|
||||
sync_engine_modules := \
|
||||
addons.js \
|
||||
apps.js \
|
||||
bookmarks.js \
|
||||
clients.js \
|
||||
forms.js \
|
||||
history.js \
|
||||
passwords.js \
|
||||
prefs.js \
|
||||
tabs.js \
|
||||
$(NULL)
|
||||
|
||||
DIRS += locales
|
||||
TEST_DIRS += tests
|
||||
|
||||
EXTRA_COMPONENTS := \
|
||||
SyncComponents.manifest \
|
||||
|
@ -28,31 +66,13 @@ EXTRA_COMPONENTS := \
|
|||
|
||||
PREF_JS_EXPORTS := $(srcdir)/services-sync.js
|
||||
|
||||
# Preprocess constants (by preprocessing everything).
|
||||
# The 'HERE' idiom avoids a dependency on pushd. We need to do this fiddling in
|
||||
# order to get relative paths, so we can process services/sync/modules/* into
|
||||
# modules/services-sync/*.
|
||||
#
|
||||
# Note that we find candidates, make directories, then 'copy' files.
|
||||
libs::
|
||||
ifndef NO_DIST_INSTALL
|
||||
$(EXIT_ON_ERROR) \
|
||||
HERE=$(CURDIR); \
|
||||
cd $(srcdir)/modules; \
|
||||
dirs=`find * -type d`; \
|
||||
files=`find * -type f`; \
|
||||
cd $$HERE; \
|
||||
for d in $$dirs; do \
|
||||
$(PYTHON) $(topsrcdir)/config/nsinstall.py -D $(FINAL_TARGET)/modules/services-sync/$$d; \
|
||||
done; \
|
||||
for i in $$files; do \
|
||||
src=$(srcdir)/modules/$$i; \
|
||||
dest=$(FINAL_TARGET)/modules/services-sync/$$i; \
|
||||
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(sync_pp_defines) $$src > $$dest ; \
|
||||
done
|
||||
endif
|
||||
# Install JS module files.
|
||||
SYNC_MAIN_FILES := $(addprefix modules/,$(sync_modules))
|
||||
SYNC_MAIN_DEST = $(FINAL_TARGET)/modules/services-sync
|
||||
INSTALL_TARGETS += SYNC_MAIN
|
||||
|
||||
|
||||
TEST_DIRS += tests
|
||||
SYNC_ENGINES_FILES := $(addprefix modules/engines/,$(sync_engine_modules))
|
||||
SYNC_ENGINES_DEST = $(FINAL_TARGET)/modules/services-sync/engines
|
||||
INSTALL_TARGETS += SYNC_ENGINES
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
|
|
@ -115,13 +115,13 @@ WeaveSvc.prototype = {
|
|||
get isLoggedIn() { return this._loggedIn; },
|
||||
|
||||
get locked() { return this._locked; },
|
||||
lock: function Svc_lock() {
|
||||
lock: function lock() {
|
||||
if (this._locked)
|
||||
return false;
|
||||
this._locked = true;
|
||||
return true;
|
||||
},
|
||||
unlock: function Svc_unlock() {
|
||||
unlock: function unlock() {
|
||||
this._locked = false;
|
||||
},
|
||||
|
||||
|
@ -155,7 +155,7 @@ WeaveSvc.prototype = {
|
|||
this.cryptoKeysURL = this.storageURL + CRYPTO_COLLECTION + "/" + KEYS_WBO;
|
||||
},
|
||||
|
||||
_checkCrypto: function WeaveSvc__checkCrypto() {
|
||||
_checkCrypto: function _checkCrypto() {
|
||||
let ok = false;
|
||||
|
||||
try {
|
||||
|
@ -327,7 +327,7 @@ WeaveSvc.prototype = {
|
|||
// Send an event now that Weave service is ready. We don't do this
|
||||
// synchronously so that observers can import this module before
|
||||
// registering an observer.
|
||||
Utils.nextTick(function() {
|
||||
Utils.nextTick(function onNextTick() {
|
||||
Status.ready = true;
|
||||
Svc.Obs.notify("weave:service:ready");
|
||||
});
|
||||
|
@ -376,7 +376,7 @@ WeaveSvc.prototype = {
|
|||
/**
|
||||
* Register the built-in engines for certain applications
|
||||
*/
|
||||
_registerEngines: function WeaveSvc__registerEngines() {
|
||||
_registerEngines: function _registerEngines() {
|
||||
let engines = [];
|
||||
// Applications can provide this preference (comma-separated list)
|
||||
// to specify which engines should be registered on startup.
|
||||
|
@ -386,7 +386,9 @@ WeaveSvc.prototype = {
|
|||
}
|
||||
|
||||
// Grab the actual engines and register them
|
||||
Engines.register(engines.map(function(name) Weave[name + "Engine"]));
|
||||
Engines.register(engines.map(function onItem(name) {
|
||||
return Weave[name + "Engine"];
|
||||
}));
|
||||
},
|
||||
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
|
||||
|
@ -394,7 +396,7 @@ WeaveSvc.prototype = {
|
|||
|
||||
// nsIObserver
|
||||
|
||||
observe: function WeaveSvc__observe(subject, topic, data) {
|
||||
observe: function observe(subject, topic, data) {
|
||||
switch (topic) {
|
||||
case "weave:service:setup-complete":
|
||||
let status = this._checkSetup();
|
||||
|
@ -629,7 +631,7 @@ WeaveSvc.prototype = {
|
|||
},
|
||||
|
||||
verifyLogin: function verifyLogin()
|
||||
this._notify("verify-login", "", function() {
|
||||
this._notify("verify-login", "", function onNotify() {
|
||||
if (!this._identity.username) {
|
||||
this._log.warn("No username in verifyLogin.");
|
||||
Status.login = LOGIN_FAILED_NO_USERNAME;
|
||||
|
@ -717,8 +719,7 @@ WeaveSvc.prototype = {
|
|||
}
|
||||
})(),
|
||||
|
||||
generateNewSymmetricKeys:
|
||||
function WeaveSvc_generateNewSymmetricKeys() {
|
||||
generateNewSymmetricKeys: function generateNewSymmetricKeys() {
|
||||
this._log.info("Generating new keys WBO...");
|
||||
let wbo = CollectionKeys.generateNewKeysWBO();
|
||||
this._log.info("Encrypting new key bundle.");
|
||||
|
@ -775,8 +776,8 @@ WeaveSvc.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
changePassword: function WeaveSvc_changePassword(newpass)
|
||||
this._notify("changepwd", "", function() {
|
||||
changePassword: function changePassword(newpass) {
|
||||
return this._notify("changepwd", "", function onNotify() {
|
||||
let url = this.userAPI + this._identity.username + "/password";
|
||||
try {
|
||||
let resp = new Resource(url).post(Utils.encodeUTF8(newpass));
|
||||
|
@ -795,10 +796,11 @@ WeaveSvc.prototype = {
|
|||
this._identity.basicPassword = newpass;
|
||||
this.persistLogin();
|
||||
return true;
|
||||
})(),
|
||||
})();
|
||||
},
|
||||
|
||||
changePassphrase: function WeaveSvc_changePassphrase(newphrase)
|
||||
this._catch(this._notify("changepph", "", function() {
|
||||
changePassphrase: function changePassphrase(newphrase) {
|
||||
return this._catch(this._notify("changepph", "", function onNotify() {
|
||||
/* Wipe. */
|
||||
this.wipeServer();
|
||||
|
||||
|
@ -815,7 +817,8 @@ WeaveSvc.prototype = {
|
|||
/* Login and sync. This also generates new keys. */
|
||||
this.sync();
|
||||
return true;
|
||||
}))(),
|
||||
}))();
|
||||
},
|
||||
|
||||
startOver: function startOver() {
|
||||
this._log.trace("Invoking Service.startOver.");
|
||||
|
@ -868,9 +871,8 @@ WeaveSvc.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
login: function login(username, password, passphrase)
|
||||
this._catch(this._lock("service.js: login",
|
||||
this._notify("login", "", function() {
|
||||
login: function login(username, password, passphrase) {
|
||||
function onNotify() {
|
||||
this._loggedIn = false;
|
||||
if (Services.io.offline) {
|
||||
Status.login = LOGIN_FAILED_NETWORK_ERROR;
|
||||
|
@ -910,7 +912,11 @@ WeaveSvc.prototype = {
|
|||
this._loggedIn = true;
|
||||
|
||||
return true;
|
||||
})))(),
|
||||
}
|
||||
|
||||
let notifier = this._notify("login", "", onNotify.bind(this));
|
||||
return this._catch(this._lock("service.js: login", notifier))();
|
||||
},
|
||||
|
||||
logout: function logout() {
|
||||
// No need to do anything if we're already logged out.
|
||||
|
@ -984,7 +990,7 @@ WeaveSvc.prototype = {
|
|||
|
||||
// Stuff we need to do after login, before we can really do
|
||||
// anything (e.g. key setup).
|
||||
_remoteSetup: function WeaveSvc__remoteSetup(infoResponse) {
|
||||
_remoteSetup: function _remoteSetup(infoResponse) {
|
||||
let reset = false;
|
||||
|
||||
this._log.debug("Fetching global metadata record");
|
||||
|
@ -1138,7 +1144,7 @@ WeaveSvc.prototype = {
|
|||
*
|
||||
* @return Reason for not syncing; not-truthy if sync should run
|
||||
*/
|
||||
_checkSync: function WeaveSvc__checkSync(ignore) {
|
||||
_checkSync: function _checkSync(ignore) {
|
||||
let reason = "";
|
||||
if (!this.enabled)
|
||||
reason = kSyncWeaveDisabled;
|
||||
|
@ -1183,7 +1189,7 @@ WeaveSvc.prototype = {
|
|||
*/
|
||||
_lockedSync: function _lockedSync()
|
||||
this._lock("service.js: sync",
|
||||
this._notify("sync", "", function() {
|
||||
this._notify("sync", "", function onNotify() {
|
||||
|
||||
this._log.info("In sync().");
|
||||
|
||||
|
@ -1388,7 +1394,7 @@ WeaveSvc.prototype = {
|
|||
|
||||
// Returns true if sync should proceed.
|
||||
// false / no return value means sync should be aborted.
|
||||
_syncEngine: function WeaveSvc__syncEngine(engine) {
|
||||
_syncEngine: function _syncEngine(engine) {
|
||||
try {
|
||||
engine.sync();
|
||||
}
|
||||
|
@ -1447,7 +1453,7 @@ WeaveSvc.prototype = {
|
|||
return true;
|
||||
},
|
||||
|
||||
_freshStart: function WeaveSvc__freshStart() {
|
||||
_freshStart: function _freshStart() {
|
||||
this._log.info("Fresh start. Resetting client and considering key upgrade.");
|
||||
this.resetClient();
|
||||
CollectionKeys.clear();
|
||||
|
@ -1497,7 +1503,7 @@ WeaveSvc.prototype = {
|
|||
* @return the server's timestamp of the (last) DELETE.
|
||||
*/
|
||||
wipeServer: function wipeServer(collections)
|
||||
this._notify("wipe-server", "", function() {
|
||||
this._notify("wipe-server", "", function onNotify() {
|
||||
let response;
|
||||
if (!collections) {
|
||||
// Strip the trailing slash.
|
||||
|
@ -1544,8 +1550,8 @@ WeaveSvc.prototype = {
|
|||
* @param engines [optional]
|
||||
* Array of engine names to wipe. If not given, all engines are used.
|
||||
*/
|
||||
wipeClient: function WeaveSvc_wipeClient(engines)
|
||||
this._notify("wipe-client", "", function() {
|
||||
wipeClient: function wipeClient(engines)
|
||||
this._notify("wipe-client", "", function onNotify() {
|
||||
// If we don't have any engines, reset the service and wipe all engines
|
||||
if (!engines) {
|
||||
// Clear out any service data
|
||||
|
@ -1601,8 +1607,8 @@ WeaveSvc.prototype = {
|
|||
/**
|
||||
* Reset local service information like logs, sync times, caches.
|
||||
*/
|
||||
resetService: function WeaveSvc_resetService()
|
||||
this._catch(this._notify("reset-service", "", function() {
|
||||
resetService: function resetService()
|
||||
this._catch(this._notify("reset-service", "", function onNotify() {
|
||||
this._log.info("Service reset.");
|
||||
|
||||
// Pretend we've never synced to the server and drop cached data
|
||||
|
@ -1616,8 +1622,8 @@ WeaveSvc.prototype = {
|
|||
* @param engines [optional]
|
||||
* Array of engine names to reset. If not given, all engines are used.
|
||||
*/
|
||||
resetClient: function WeaveSvc_resetClient(engines)
|
||||
this._catch(this._notify("reset-client", "", function() {
|
||||
resetClient: function resetClient(engines)
|
||||
this._catch(this._notify("reset-client", "", function onNotify() {
|
||||
// If we don't have any engines, reset everything including the service
|
||||
if (!engines) {
|
||||
// Clear out any service data
|
||||
|
|
Загрузка…
Ссылка в новой задаче