[Pkg-mozext-commits] [requestpolicy] 48/280: create startup and shutdown functions in bootstrap-manager
David Prévot
taffit at moszumanska.debian.org
Sat May 2 20:29:58 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository requestpolicy.
commit 6520ec1fbbcbaa28833d4297ab7e2ac82dd5a55a
Author: Martin Kimmerle <dev at 256k.de>
Date: Fri Dec 5 06:16:38 2014 +0100
create startup and shutdown functions in bootstrap-manager
---
src/bootstrap.js | 6 ++----
src/content/lib/bootstrap-manager.jsm | 13 +++++++++++++
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/bootstrap.js b/src/bootstrap.js
index fee2812..d83b605 100644
--- a/src/bootstrap.js
+++ b/src/bootstrap.js
@@ -37,8 +37,7 @@ function startup(data, reason) {
try {
Cu.import(bootstrapManagerURI);
- BootstrapManager.init();
- BootstrapManager.startupManagers(data, reason);
+ BootstrapManager.startup(data, reason);
} catch(e) {
let msg = "startup() failed! " + e;
dump("[RequestPolicy] [SEVERE] [ERROR] " + msg +
@@ -52,8 +51,7 @@ function shutdown(data, reason) {
}
try {
- BootstrapManager.shutdownManagers(data, reason);
- BootstrapManager.finish();
+ BootstrapManager.shutdown(data, reason);
Cu.unload(bootstrapManagerURI);
} catch(e) {
let msg = "shutdown() failed! " + e;
diff --git a/src/content/lib/bootstrap-manager.jsm b/src/content/lib/bootstrap-manager.jsm
index 33ca2a2..0e0a3f4 100644
--- a/src/content/lib/bootstrap-manager.jsm
+++ b/src/content/lib/bootstrap-manager.jsm
@@ -47,6 +47,9 @@ let BootstrapManager = (function() {
'about-uri': 'AboutRequestPolicy'
};
+ //let startupFunctions = [];
+ //let shutdownFunctions = [];
+
/**
* this function calls another function with functionName
*/
@@ -119,6 +122,16 @@ let BootstrapManager = (function() {
shutdownManagers: function(data, reason) {
forEachManager(callBootstrapFunction, ['shutdown', data, reason]);
+ },
+
+ startup: function(data, reason) {
+ self.init();
+ self.startupManagers(data, reason);
+ },
+
+ shutdown: function(data, reason) {
+ self.shutdownManagers(data, reason);
+ self.finish();
}
};
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git
More information about the Pkg-mozext-commits
mailing list