Skip to content

Commit 9b55744

Browse files
committed
Tidying + commenting in HTTPSRules.js
1 parent 83ea5a9 commit 9b55744

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/chrome/content/code/HTTPSRules.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ const RuleWriter = {
151151
file.append("rules");
152152
if (!file.isDirectory()) {
153153
// XXX: Arg, death!
154+
this.log(WARN,"Catastrophic failure: extension directory is not a directory");
154155
}
155156
return file;
156157
},
@@ -313,9 +314,12 @@ const HTTPSRules = {
313314
},
314315

315316
rewrittenURI: function(applicable_list, uri) {
317+
// This function oversees the task of working out if a uri should be
318+
// rewritten, what it should be rewritten to, and recordkeeping of which
319+
// applicable rulesets are and aren't active.
316320
var i = 0;
317321
var newuri = null
318-
var rs = this.applicableRulesets(uri.host);
322+
var rs = this.potentiallyApplicableRulesets(uri.host);
319323
if (!applicable_list)
320324
this.log(DBUG, "No applicable list rewriting " + uri.spec);
321325
for(i = 0; i < rs.length; ++i) {
@@ -345,8 +349,8 @@ const HTTPSRules = {
345349
return null;
346350
},
347351

348-
applicableRulesets: function(host) {
349-
// Return a list of rulesets that apply to this host
352+
potentiallyApplicableRulesets: function(host) {
353+
// Return a list of rulesets that declare targets matching this host
350354
var i, tmp, t;
351355
var results = this.global_rulesets;
352356
if (this.targets[host])
@@ -383,7 +387,7 @@ const HTTPSRules = {
383387
//this.log(DBUG, " domain: " + c.domain);
384388
//this.log(DBUG, " rawhost: " + c.rawHost);
385389
var i,j;
386-
var rs = this.applicableRulesets(c.host);
390+
var rs = this.potentiallyApplicableRulesets(c.host);
387391
for (i = 0; i < rs.length; ++i) {
388392
var ruleset = rs[i];
389393
if (ruleset.active)

0 commit comments

Comments
 (0)