Bug 794091 - Reorganize OS.File importScripts to avoid talos hangs. r=froydnj

This commit is contained in:
David Rajchenbach-Teller 2012-11-08 14:35:01 -05:00
Родитель 574ebc58a9
Коммит f7aae016b2
7 изменённых файлов: 20 добавлений и 20 удалений

Просмотреть файл

@ -10,9 +10,26 @@ if (typeof Components != "undefined") {
this.EXPORTED_SYMBOLS = ["OS"];
Components.utils.import("resource://gre/modules/osfile/osfile_async_front.jsm", this);
} else {
// At this stage, we need to import all sources at once to avoid
// a unique failure on tbpl + talos that seems caused by a
// what looks like a nested event loop bug (see bug 794091).
#ifdef XP_WIN
importScripts("resource://gre/modules/osfile/osfile_win_front.jsm");
importScripts(
"resource://gre/modules/osfile/osfile_shared_allthreads.jsm",
"resource://gre/modules/osfile/osfile_win_allthreads.jsm",
"resource://gre/modules/osfile/ospath_win_back.jsm",
"resource://gre/modules/osfile/osfile_win_back.jsm",
"resource://gre/modules/osfile/osfile_shared_front.jsm",
"resource://gre/modules/osfile/osfile_win_front.jsm"
);
#else
importScripts("resource://gre/modules/osfile/osfile_unix_front.jsm");
importScripts(
"resource://gre/modules/osfile/osfile_shared_allthreads.jsm",
"resource://gre/modules/osfile/osfile_unix_allthreads.jsm",
"resource://gre/modules/osfile/ospath_unix_back.jsm",
"resource://gre/modules/osfile/osfile_unix_back.jsm",
"resource://gre/modules/osfile/osfile_shared_front.jsm",
"resource://gre/modules/osfile/osfile_unix_front.jsm"
);
#endif
}
}

Просмотреть файл

@ -22,9 +22,6 @@ if (typeof Components != "undefined") {
this.EXPORTED_SYMBOLS = ["OS"];
Components.utils.import("resource://gre/modules/ctypes.jsm");
Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm", this);
} else {
// File is included from a chrome worker
importScripts("resource://gre/modules/osfile/osfile_shared_allthreads.jsm");
}
(function(exports) {

Просмотреть файл

@ -11,8 +11,6 @@
throw new Error("osfile_unix_back.jsm cannot be used from the main thread yet");
}
importScripts("resource://gre/modules/osfile/osfile_shared_allthreads.jsm");
importScripts("resource://gre/modules/osfile/osfile_unix_allthreads.jsm");
(function(exports) {
"use strict";
if (!exports.OS) {

Просмотреть файл

@ -16,9 +16,6 @@
throw new Error("osfile_unix_front.jsm cannot be used from the main thread yet");
}
importScripts("resource://gre/modules/osfile/osfile_unix_back.jsm");
importScripts("resource://gre/modules/osfile/ospath_unix_back.jsm");
importScripts("resource://gre/modules/osfile/osfile_shared_front.jsm");
(function(exports) {
"use strict";

Просмотреть файл

@ -22,9 +22,6 @@ if (typeof Components != "undefined") {
this.EXPORTED_SYMBOLS = ["OS"];
Components.utils.import("resource://gre/modules/ctypes.jsm");
Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm", this);
} else {
// File is included from a chrome worker
importScripts("resource://gre/modules/osfile/osfile_shared_allthreads.jsm");
}
(function(exports) {

Просмотреть файл

@ -28,8 +28,6 @@
throw new Error("osfile_win.jsm cannot be used from the main thread yet");
}
importScripts("resource://gre/modules/osfile/osfile_shared_allthreads.jsm");
importScripts("resource://gre/modules/osfile/osfile_win_allthreads.jsm");
(function(exports) {
"use strict";

Просмотреть файл

@ -16,10 +16,6 @@
throw new Error("osfile_win_front.jsm cannot be used from the main thread yet");
}
importScripts("resource://gre/modules/osfile/osfile_win_back.jsm");
importScripts("resource://gre/modules/osfile/ospath_win_back.jsm");
importScripts("resource://gre/modules/osfile/osfile_shared_front.jsm");
(function(exports) {
"use strict";