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/. */
4
5/**
6 * Common front for various implementations of OS.File
7 */
8
9if (typeof Components != "undefined") {
10  this.EXPORTED_SYMBOLS = ["OS"];
11  ChromeUtils.import("resource://gre/modules/osfile/osfile_async_front.jsm", this);
12} else {
13  importScripts("resource://gre/modules/workers/require.js");
14
15  var SharedAll = require("resource://gre/modules/osfile/osfile_shared_allthreads.jsm");
16
17  // At this stage, we need to import all sources at once to avoid
18  // a unique failure on tbpl + talos that seems caused by a
19  // what looks like a nested event loop bug (see bug 794091).
20  if (SharedAll.Constants.Win) {
21    importScripts(
22      "resource://gre/modules/osfile/osfile_win_back.jsm",
23      "resource://gre/modules/osfile/osfile_shared_front.jsm",
24      "resource://gre/modules/osfile/osfile_win_front.jsm"
25    );
26  } else {
27    importScripts(
28      "resource://gre/modules/osfile/osfile_unix_back.jsm",
29      "resource://gre/modules/osfile/osfile_shared_front.jsm",
30      "resource://gre/modules/osfile/osfile_unix_front.jsm"
31    );
32  }
33
34  OS.Path = require("resource://gre/modules/osfile/ospath.jsm");
35}
36