1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-19 23:57:59 +01:00

Add missing services.tld.

This commit is contained in:
Kris Maglione
2011-03-31 18:44:18 -04:00
parent c2d2415b1a
commit 477b1139fc
5 changed files with 39 additions and 11 deletions

View File

@@ -640,7 +640,7 @@ var Modes = Module("modes", {
options.add(["showmode", "smd"],
"Show the current mode in the command line when it matches this expression",
"stringlist", "!normal,base",
"stringlist", "caret,output_multiline,!normal,base",
opts);
},
prefs: function initPrefs() {

View File

@@ -142,6 +142,7 @@ function defineModule(name, params, module) {
use[mod].push(module);
}
currentModule = module;
module.startTime = Date.now();
}
defineModule.loadLog = [];
@@ -163,7 +164,6 @@ defineModule.dump = function dump_() {
.replace(/^./gm, name + ": $&"));
}
defineModule.modules = [];
defineModule.times = { all: 0 };
defineModule.time = function time(major, minor, func, self) {
let time = Date.now();
if (typeof func !== "function")
@@ -176,13 +176,7 @@ defineModule.time = function time(major, minor, func, self) {
loaded.util && util.reportError(e);
}
let delta = Date.now() - time;
defineModule.times.all += delta;
defineModule.times[major] = (defineModule.times[major] || 0) + delta;
if (minor) {
defineModule.times[":" + minor] = (defineModule.times[":" + minor] || 0) + delta;
defineModule.times[major + ":" + minor] = (defineModule.times[major + ":" + minor] || 0) + delta;
}
JSMLoader.times.add(major, minor, Date.now() - time);
return res;
}

View File

@@ -151,7 +151,6 @@ var BookmarkCache = Module("BookmarkCache", XPCOM(Ci.nsINavBookmarkObserver), {
return this.rootFolders.indexOf(root) >= 0;
},
// Should be made thread safe.
load: function load() {
let bookmarks = {};

View File

@@ -32,6 +32,26 @@ else
manager: Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar),
stale: JSMLoader ? JSMLoader.stale : {},
suffix: "",
times: {
all: 0,
add: function add(major, minor, delta) {
this.all += delta;
this[major] = (this[major] || 0) + delta;
if (minor) {
minor = ":" + minor;
this[minor] = (this[minor] || 0) + delta;
this[major + minor] = (this[major + minor] || 0) + delta;
}
},
clear: function clear() {
for (let key in this)
if (typeof this[key] !== "number")
delete this[key];
}
},
init: function init(suffix) {
this.initialized = true;
this.suffix = suffix || "";
@@ -41,6 +61,7 @@ else
this.global.JSMLoader = this;
base.JSMLoader = this;
},
getTarget: function getTarget(url) {
if (url.indexOf(":") === -1)
url = "resource://dactyl" + this.suffix + "/" + url;
@@ -49,6 +70,7 @@ else
chan.cancel(Components.results.NS_BINDING_ABORTED);
return chan.name;
},
load: function load(name, target) {
let url = name;
if (url.indexOf(":") === -1)
@@ -68,7 +90,12 @@ else
}
try {
let now = Date.now();
let global = Components.utils.import(url, target);
if (!(name in this.globals))
this.times.add("require", name, Date.now() - now);
return this.globals[name] = global;
}
catch (e) {
@@ -76,11 +103,18 @@ else
throw e;
}
},
loadSubScript: function loadSubScript() this.loader.loadSubScript.apply(this.loader, arguments),
loadSubScript: function loadSubScript(script) {
let now = Date.now();
this.loader.loadSubScript.apply(this.loader, arguments);
this.times.add("loadSubScript", script, Date.now() - now);
},
cleanup: function unregister() {
for each (let factory in this.factories.splice(0))
this.manager.unregisterFactory(factory.classID, factory);
},
purge: function purge() {
dump("dactyl: JSMLoader: purge\n");

View File

@@ -59,6 +59,7 @@ var Services = Module("Services", {
this.add("stylesheet", "@mozilla.org/content/style-sheet-service;1", "nsIStyleSheetService");
this.add("subscriptLoader", "@mozilla.org/moz/jssubscript-loader;1", "mozIJSSubScriptLoader");
this.add("tagging", "@mozilla.org/browser/tagging-service;1", "nsITaggingService");
this.add("tld", "@mozilla.org/network/effective-tld-service;1", "nsIEffectiveTLDService");
this.add("threading", "@mozilla.org/thread-manager;1", "nsIThreadManager");
this.add("urifixup", "@mozilla.org/docshell/urifixup;1", "nsIURIFixup");
this.add("versionCompare", "@mozilla.org/xpcom/version-comparator;1", "nsIVersionComparator");