1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 15:52:29 +01:00

whitespace fixes

This commit is contained in:
Doug Kearns
2008-10-29 06:12:01 +00:00
parent cdf10aecfc
commit 416440edbb
3 changed files with 30 additions and 25 deletions

View File

@@ -6,7 +6,7 @@
* By Kris Maglione, ideas from Ed Anuff's nsChromeExtensionHandler. * By Kris Maglione, ideas from Ed Anuff's nsChromeExtensionHandler.
* *
* Licenced under the MIT License, which allows for sublicensing * Licenced under the MIT License, which allows for sublicensing
* under any compatible license, includeing the GNU GPL and the MPL. * under any compatible license, including the GNU GPL and the MPL.
*/ */
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
@@ -26,18 +26,18 @@ channel.cancel(NS_BINDING_ABORTED);
delete channel; delete channel;
var instance; var instance;
function ChromeData() { function ChromeData() {}
}
ChromeData.prototype = { ChromeData.prototype = {
contractID: "@mozilla.org/network/protocol;1?name=chrome-data", contractID: "@mozilla.org/network/protocol;1?name=chrome-data",
classID: Components.ID("{c1b67a07-18f7-4e13-b361-2edcc35a5a0d}"), classID: Components.ID("{c1b67a07-18f7-4e13-b361-2edcc35a5a0d}"),
classDescription: "Data URIs with chrome privileges", classDescription: "Data URIs with chrome privileges",
QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIProtocolHandler]), QueryInterface: XPCOMUtils.generateQI([Components.interfaces.nsIProtocolHandler]),
_xpcom_factory: { _xpcom_factory: {
createInstance: function(outer, iid) { createInstance: function (outer, iid)
if(!instance) {
if (!instance)
instance = new ChromeData(); instance = new ChromeData();
if(outer != null) if (outer != null)
throw Components.results.NS_ERROR_NO_AGGREGATION; throw Components.results.NS_ERROR_NO_AGGREGATION;
return instance.QueryInterface(iid); return instance.QueryInterface(iid);
} }
@@ -45,12 +45,13 @@ ChromeData.prototype = {
scheme: "chrome-data", scheme: "chrome-data",
defaultPort: -1, defaultPort: -1,
allowPort: function(port, scheme) false, allowPort: function (port, scheme) false,
protocolFlags: nsIProtocolHandler.URI_NORELATIVE protocolFlags: nsIProtocolHandler.URI_NORELATIVE
| nsIProtocolHandler.URI_NOAUTH | nsIProtocolHandler.URI_NOAUTH
| nsIProtocolHandler.URI_IS_UI_RESOURCE, | nsIProtocolHandler.URI_IS_UI_RESOURCE,
newURI: function(spec, charset, baseURI) { newURI: function (spec, charset, baseURI)
{
var uri = Components.classes["@mozilla.org/network/standard-url;1"] var uri = Components.classes["@mozilla.org/network/standard-url;1"]
.createInstance(Components.interfaces.nsIStandardURL) .createInstance(Components.interfaces.nsIStandardURL)
.QueryInterface(Components.interfaces.nsIURI); .QueryInterface(Components.interfaces.nsIURI);
@@ -58,10 +59,12 @@ ChromeData.prototype = {
return uri; return uri;
}, },
newChannel: function(uri) { newChannel: function (uri)
{
try try
{ {
if (uri.scheme == this.scheme) { if (uri.scheme == this.scheme)
{
let newURI = ioService.newURI(uri.spec.replace(/^.*?:\/*(.*)(?:#.*)?/, "data:$1"), null, null); let newURI = ioService.newURI(uri.spec.replace(/^.*?:\/*(.*)(?:#.*)?/, "data:$1"), null, null);
let channel = ioService.newChannelFromURI(newURI); let channel = ioService.newChannelFromURI(newURI);
channel.owner = systemPrincipal; channel.owner = systemPrincipal;
@@ -76,7 +79,9 @@ ChromeData.prototype = {
var components = [ChromeData]; var components = [ChromeData];
function NSGetModule(compMgr, fileSpec) { function NSGetModule(compMgr, fileSpec)
{
return XPCOMUtils.generateModule(components); return XPCOMUtils.generateModule(components);
} }
// vim: set fdm=marker sw=4 ts=4 et: