xpcomcore-rubygem 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/extension/components/bootstrapper.js +36 -3
- data/xpcomcore-rubygem.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
@@ -1,3 +1,36 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
2
|
+
|
3
|
+
// Singleton time
|
4
|
+
var XPCOMCoreBootstrapper = function() {
|
5
|
+
if (arguments.callee.__singletonInstance__) { return arguments.callee.__singletonInstance__; };
|
6
|
+
arguments.callee.__singletonInstance__ = this;
|
7
|
+
};
|
8
|
+
|
9
|
+
XPCOMCoreBootstrapper.prototype = {
|
10
|
+
bootstrapped: false,
|
11
|
+
classDescription: "XPCOMCore Bootstrapper Component",
|
12
|
+
contractID: "@conflagrationjs.org/xpcomcore/bootstrapper;1",
|
13
|
+
classID: Components.ID("{5412c380-b3b2-11de-8a39-0800200c9a66}"),
|
14
|
+
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIObserver]),
|
15
|
+
_xpcom_categories: [{category: "xpcom-startup"}],
|
16
|
+
|
17
|
+
observe: function(subject, topic, data) {
|
18
|
+
if (topic != "xpcom-startup") { return false; }
|
19
|
+
if (this.bootstrapped) {
|
20
|
+
dump("\n\nXPCOMCore already bootstrapped.\n\n");
|
21
|
+
} else {
|
22
|
+
var env = Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment);
|
23
|
+
var xpcomcoreBootstrapper = env.exists('XPCOMCORE_BOOTSTRAP') && env.get('XPCOMCORE_BOOTSTRAP');
|
24
|
+
if (xpcomcoreBootstrapper) {
|
25
|
+
dump("\n\nLoading XPCOMCore Bootstrapper from " + xpcomcoreBootstrapper + ".\n\n");
|
26
|
+
Components.utils.import("file://" + xpcomcoreBootstrapper);
|
27
|
+
dump("\n\nXPCOMCore bootstrapped.\n\n");
|
28
|
+
} else {
|
29
|
+
dump("\n\nNot loading XPCOMCore Bootstrapper.\n\n");
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
};
|
35
|
+
|
36
|
+
NSGetModule = function(compMgr, fileSpec) { return XPCOMUtils.generateModule([XPCOMCoreBootstrapper]); };
|
data/xpcomcore-rubygem.gemspec
CHANGED