B2G/gecko/content/base/src/CSPUtils.jsm
/**
   * Intersects with another CSPRep, deciding the subset policy
   * that should be enforced, and returning a new instance.
   * @param aCSPRep
   *        a CSPRep instance to use as "other" CSP
   * @returns
   *        a new CSPRep instance of the intersection
   */
Intersects with another CSPRep, deciding the subset policy
that should be enforced, and returning a new instance.
@param aCSPRep
a CSPRep instance to use as "other" CSP
@returns
a new CSPRep instance of the intersection
Intersects with another CSPRep deciding the subset policy that should be enforced and returning a new instance . @param aCSPRep a CSPRep instance to use as " other " CSP @returns a new CSPRep instance of the intersection
function cspsd_intersectWith(aCSPRep) {
    var newRep = new CSPRep();
    for (var dir in CSPRep.SRC_DIRECTIVES) {
      var dirv = CSPRep.SRC_DIRECTIVES[dir];
      if (this._directives.hasOwnProperty(dirv))
        newRep._directives[dirv] = this._directives[dirv].intersectWith(aCSPRep._directives[dirv]);
      else
        newRep._directives[dirv] = aCSPRep._directives[dirv];
    }
    var reportURIDir = CSPRep.URI_DIRECTIVES.REPORT_URI;
    if (this._directives[reportURIDir] && aCSPRep._directives[reportURIDir]) {
      newRep._directives[reportURIDir] =
        this._directives[reportURIDir].concat(aCSPRep._directives[reportURIDir]);
    }
    else if (this._directives[reportURIDir]) {
      newRep._directives[reportURIDir] = this._directives[reportURIDir].concat();
    }
    else if (aCSPRep._directives[reportURIDir]) {
      newRep._directives[reportURIDir] = aCSPRep._directives[reportURIDir].concat();
    }
    newRep._allowEval =          this.allowsEvalInScripts
                           && aCSPRep.allowsEvalInScripts;
    newRep._allowInlineScripts = this.allowsInlineScripts
                           && aCSPRep.allowsInlineScripts;
    newRep._innerWindowID = this._innerWindowID ?
                              this._innerWindowID : aCSPRep._innerWindowID;
    return newRep;
  }
function cspsd_intersectWith ( aCSPRep ) { var newRep = new CSPRep ( ) ; for ( var dir in CSPRep . SRC_DIRECTIVES ) { var dirv = CSPRep . SRC_DIRECTIVES [ dir ] ; if ( this . _directives . hasOwnProperty ( dirv ) ) newRep . _directives [ dirv ] = this . _directives [ dirv ] . intersectWith ( aCSPRep . _directives [ dirv ] ) ; else newRep . _directives [ dirv ] = aCSPRep . _directives [ dirv ] ; } var reportURIDir = CSPRep . URI_DIRECTIVES . REPORT_URI ; if ( this . _directives [ reportURIDir ] && aCSPRep . _directives [ reportURIDir ] ) { newRep . _directives [ reportURIDir ] = this . _directives [ reportURIDir ] . concat ( aCSPRep . _directives [ reportURIDir ] ) ; } else if ( this . _directives [ reportURIDir ] ) { newRep . _directives [ reportURIDir ] = this . _directives [ reportURIDir ] . concat ( ) ; } else if ( aCSPRep . _directives [ reportURIDir ] ) { newRep . _directives [ reportURIDir ] = aCSPRep . _directives [ reportURIDir ] . concat ( ) ; } newRep . _allowEval = this . allowsEvalInScripts && aCSPRep . allowsEvalInScripts ; newRep . _allowInlineScripts = this . allowsInlineScripts && aCSPRep . allowsInlineScripts ; newRep . _innerWindowID = this . _innerWindowID ? this . _innerWindowID : aCSPRep . _innerWindowID ; return newRep ; }
Intersects with another CSPRep, deciding the subset policy
 that should be enforced, and returning a new instance.
Intersects with another CSPRep deciding the subset policy that should be enforced and returning a new instance .
// REPORT_URI // blank concat makes a copy of the string. // blank concat makes a copy of the string.