B2G/gecko/extensions/cookie/test/unit/head_cookies.js
// Helper object to store cookie data.
Helper object to store cookie data.
Helper object to store cookie data .
function Cookie(name,
                value,
                host,
                path,
                expiry,
                lastAccessed,
                creationTime,
                isSession,
                isSecure,
                isHttpOnly)
{
  this.name = name;
  this.value = value;
  this.host = host;
  this.path = path;
  this.expiry = expiry;
  this.lastAccessed = lastAccessed;
  this.creationTime = creationTime;
  this.isSession = isSession;
  this.isSecure = isSecure;
  this.isHttpOnly = isHttpOnly;
  let strippedHost = host.charAt(0) == '.' ? host.slice(1) : host;
  try {
    this.baseDomain = Services.etld.getBaseDomainFromHost(strippedHost);
  } catch (e) {
    if (e.result == Cr.NS_ERROR_HOST_IS_IP_ADDRESS ||
        e.result == Cr.NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS)
      this.baseDomain = strippedHost;
  }
}
function Cookie ( name , value , host , path , expiry , lastAccessed , creationTime , isSession , isSecure , isHttpOnly ) { this . name = name ; this . value = value ; this . host = host ; this . path = path ; this . expiry = expiry ; this . lastAccessed = lastAccessed ; this . creationTime = creationTime ; this . isSession = isSession ; this . isSecure = isSecure ; this . isHttpOnly = isHttpOnly ; let strippedHost = host . charAt ( 0 ) == '.' ? host . slice ( 1 ) : host ; try { this . baseDomain = Services . etld . getBaseDomainFromHost ( strippedHost ) ; } catch ( e ) { if ( e . result == Cr . NS_ERROR_HOST_IS_IP_ADDRESS || e . result == Cr . NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS ) this . baseDomain = strippedHost ; } }
Helper object to store cookie data.
Helper object to store cookie data .