toolkit/components/osfile/modules/ospath.jsm

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     3  * You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 /**
     6  * Handling native paths.
     7  *
     8  * This module contains a number of functions destined to simplify
     9  * working with native paths through a cross-platform API. Functions
    10  * of this module will only work with the following assumptions:
    11  *
    12  * - paths are valid;
    13  * - paths are defined with one of the grammars that this module can
    14  *   parse (see later);
    15  * - all path concatenations go through function |join|.
    16  */
    18 "use strict";
    20 if (typeof Components == "undefined") {
    21   let Path;
    22   if (OS.Constants.Win) {
    23     Path = require("resource://gre/modules/osfile/ospath_win.jsm");
    24   } else {
    25     Path = require("resource://gre/modules/osfile/ospath_unix.jsm");
    26   }
    27   module.exports = Path;
    28 } else {
    29   let Cu = Components.utils;
    30   let Scope = {};
    31   Cu.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm", Scope);
    33   let Path = {};
    34   if (Scope.OS.Constants.Win) {
    35     Cu.import("resource://gre/modules/osfile/ospath_win.jsm", Path);
    36   } else {
    37     Cu.import("resource://gre/modules/osfile/ospath_unix.jsm", Path);
    38   }
    40   this.EXPORTED_SYMBOLS = [];
    41   for (let k in Path) {
    42     this.EXPORTED_SYMBOLS.push(k);
    43     this[k] = Path[k];
    44   }
    45 }

mercurial