From 372aa4eee4e9b0b0a930d83a378502e9cec2e786 Mon Sep 17 00:00:00 2001 From: Einar Egilsson Date: Fri, 16 Oct 2009 08:11:33 +0000 Subject: Greatly simplified XPCOM plumbing git-svn-id: http://einaregilsson.googlecode.com/svn/mozilla/redirector/trunk@270 119bf307-c92d-0410-89bd-8f53e6181181 --- chrome/content/code/redirector.prototype.js | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'chrome') diff --git a/chrome/content/code/redirector.prototype.js b/chrome/content/code/redirector.prototype.js index 979e9f7..d575e52 100644 --- a/chrome/content/code/redirector.prototype.js +++ b/chrome/content/code/redirector.prototype.js @@ -1,18 +1,11 @@ //// $Id$ -Cc = Components.classes; -Ci = Components.interfaces; -Cr = Components.results; -nsIContentPolicy = Ci.nsIContentPolicy; - Redirector.prototype = { prefs : null, list : null, strings : null, cout : Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService), - - init : function() { this.prefs = new Prefs(); @@ -72,19 +65,19 @@ Redirector.prototype = { try { if (!this.prefs.enabled) { - return nsIContentPolicy.ACCEPT; + return Ci.nsIContentPolicy.ACCEPT; } - if (contentType != nsIContentPolicy.TYPE_DOCUMENT) { - return nsIContentPolicy.ACCEPT; + if (contentType != Ci.nsIContentPolicy.TYPE_DOCUMENT) { + return Ci.nsIContentPolicy.ACCEPT; } if (contentLocation.scheme != "http" && contentLocation.scheme != "https") { - return nsIContentPolicy.ACCEPT; + return Ci.nsIContentPolicy.ACCEPT; } if (!aContext || !aContext.loadURI) { - return nsIContentPolicy.ACCEPT; + return Ci.nsIContentPolicy.ACCEPT; } this.debug("Checking " + contentLocation.spec); @@ -100,18 +93,18 @@ Redirector.prototype = { redirectUrl = this.makeAbsoluteUrl(url, result.redirectTo); this.debug('Redirecting ' + url + ' to ' + redirectUrl); aContext.loadURI(redirectUrl, requestOrigin, null); - return nsIContentPolicy.REJECT_REQUEST; + return Ci.nsIContentPolicy.REJECT_REQUEST; } } } catch(e) { this.debug(e); } - return nsIContentPolicy.ACCEPT; + return Ci.nsIContentPolicy.ACCEPT; }, // nsIContentPolicy interface implementation shouldProcess: function(contentType, contentLocation, requestOrigin, insecNode, mimeType, extra) { - return nsIContentPolicy.ACCEPT; + return Ci.nsIContentPolicy.ACCEPT; }, //nsIChannelEventSink interface implementation -- cgit v1.2.3-70-g09d2