[Pkg-mozext-commits] [requestpolicy] 49/280: coding style changes (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 543a2e88ee7d7a55491a3f32fa3cf231ad45c473
Author: Martin Kimmerle <dev at 256k.de>
Date: Fri Dec 5 06:26:32 2014 +0100
coding style changes (bootstrap-manager)
---
src/content/lib/bootstrap-manager.jsm | 87 ++++++++++++++++++-----------------
1 file changed, 46 insertions(+), 41 deletions(-)
diff --git a/src/content/lib/bootstrap-manager.jsm b/src/content/lib/bootstrap-manager.jsm
index 0e0a3f4..19c5941 100644
--- a/src/content/lib/bootstrap-manager.jsm
+++ b/src/content/lib/bootstrap-manager.jsm
@@ -39,7 +39,11 @@ let WindowManager = null;
//let SevereErrorHandler = {};
+
+
let BootstrapManager = (function() {
+ let self = {};
+
let managers = {
// id : object name of the manager
'requestpolicy-service': 'rpService',
@@ -66,7 +70,7 @@ let BootstrapManager = (function() {
(typeof manager[functionName]) == 'function') {
manager[functionName](data, reason);
}
- }
+ };
function forEachManager(functionToCall, args) {
for (let managerID in managers) {
if (!managers.hasOwnProperty(managerID)) {
@@ -79,60 +83,61 @@ let BootstrapManager = (function() {
Logger.severeError("error catched in bootstrap script: " + e, e);
}
}
- }
+ };
- let self = {
- importScriptLoader: function() {
- Cu.import(scriptLoaderURI, globalScope);
- },
- init: function() {
- self.importScriptLoader();
- ScriptLoader.importModule("logger", globalScope);
- ScriptLoader.importModule("requestpolicy-service", globalScope);
- ScriptLoader.importModule("window-manager", globalScope);
- ScriptLoader.importModule("about-uri", globalScope);
- },
+ function importScriptLoader() {
+ Cu.import(scriptLoaderURI, globalScope);
+ }
- finish: function() {
- // HACK WARNING: The Addon Manager does not properly clear all addon
- // related caches on update; in order to fully update
- // images and locales, their caches need clearing here.
- Services.obs.notifyObservers(null, "chrome-flush-caches", null);
+ function init() {
+ importScriptLoader();
+ ScriptLoader.importModule("logger", globalScope);
+ ScriptLoader.importModule("requestpolicy-service", globalScope);
+ ScriptLoader.importModule("window-manager", globalScope);
+ ScriptLoader.importModule("about-uri", globalScope);
+ }
- ScriptLoader.unloadAllLibraries();
- ScriptLoader.unloadAllModules();
+ function finish() {
+ // HACK WARNING: The Addon Manager does not properly clear all addon
+ // related caches on update; in order to fully update
+ // images and locales, their caches need clearing here.
+ Services.obs.notifyObservers(null, "chrome-flush-caches", null);
- Cu.unload(scriptLoaderURI);
- ScriptLoader = null;
- Logger = null;
- rpService = null;
- WindowManager = null;
- },
+ ScriptLoader.unloadAllLibraries();
+ ScriptLoader.unloadAllModules();
- startupManagers: function(data, reason) {
- // call the startup function of all managers
- forEachManager(callBootstrapFunction, ['startup', data, reason]);
- },
+ Cu.unload(scriptLoaderURI);
+ ScriptLoader = null;
+ Logger = null;
+ rpService = null;
+ WindowManager = null;
+ }
- shutdownManagers: function(data, reason) {
- forEachManager(callBootstrapFunction, ['shutdown', data, reason]);
- },
+ function startupManagers(data, reason) {
+ // call the startup function of all managers
+ forEachManager(callBootstrapFunction, ['startup', data, reason]);
+ }
- startup: function(data, reason) {
- self.init();
- self.startupManagers(data, reason);
- },
+ function shutdownManagers(data, reason) {
+ forEachManager(callBootstrapFunction, ['shutdown', data, reason]);
+ }
- shutdown: function(data, reason) {
- self.shutdownManagers(data, reason);
- self.finish();
- }
+
+
+ self.startup = function(data, reason) {
+ init();
+ startupManagers(data, reason);
+ };
+
+ self.shutdown = function(data, reason) {
+ shutdownManagers(data, reason);
+ finish();
};
return self;
--
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