From ea76afa081fcc07a61dfa95f04f9fc107b2b62fb Mon Sep 17 00:00:00 2001 From: David Rajchenbach-Teller Date: Thu, 8 Nov 2012 14:35:01 -0500 Subject: [PATCH] Bug 794091 - Reorganize OS.File importScripts to avoid talos hangs. r=froydnj --- toolkit/components/osfile/osfile.jsm | 23 ++++++++++++++++--- .../osfile/osfile_unix_allthreads.jsm | 3 --- .../components/osfile/osfile_unix_back.jsm | 2 -- .../components/osfile/osfile_unix_front.jsm | 3 --- .../osfile/osfile_win_allthreads.jsm | 3 --- toolkit/components/osfile/osfile_win_back.jsm | 2 -- .../components/osfile/osfile_win_front.jsm | 4 ---- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/toolkit/components/osfile/osfile.jsm b/toolkit/components/osfile/osfile.jsm index e624798e850..099ca38b960 100644 --- a/toolkit/components/osfile/osfile.jsm +++ b/toolkit/components/osfile/osfile.jsm @@ -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 -} \ No newline at end of file +} diff --git a/toolkit/components/osfile/osfile_unix_allthreads.jsm b/toolkit/components/osfile/osfile_unix_allthreads.jsm index 761ad503401..5ba9e475f19 100644 --- a/toolkit/components/osfile/osfile_unix_allthreads.jsm +++ b/toolkit/components/osfile/osfile_unix_allthreads.jsm @@ -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) { diff --git a/toolkit/components/osfile/osfile_unix_back.jsm b/toolkit/components/osfile/osfile_unix_back.jsm index 720b7186b12..8db7ffa7fde 100644 --- a/toolkit/components/osfile/osfile_unix_back.jsm +++ b/toolkit/components/osfile/osfile_unix_back.jsm @@ -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) { diff --git a/toolkit/components/osfile/osfile_unix_front.jsm b/toolkit/components/osfile/osfile_unix_front.jsm index 908d8fc2828..99fe6624b79 100644 --- a/toolkit/components/osfile/osfile_unix_front.jsm +++ b/toolkit/components/osfile/osfile_unix_front.jsm @@ -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"; diff --git a/toolkit/components/osfile/osfile_win_allthreads.jsm b/toolkit/components/osfile/osfile_win_allthreads.jsm index e6eafc07a32..2e4777e2485 100644 --- a/toolkit/components/osfile/osfile_win_allthreads.jsm +++ b/toolkit/components/osfile/osfile_win_allthreads.jsm @@ -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) { diff --git a/toolkit/components/osfile/osfile_win_back.jsm b/toolkit/components/osfile/osfile_win_back.jsm index c5804baa540..7954f808520 100644 --- a/toolkit/components/osfile/osfile_win_back.jsm +++ b/toolkit/components/osfile/osfile_win_back.jsm @@ -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"; diff --git a/toolkit/components/osfile/osfile_win_front.jsm b/toolkit/components/osfile/osfile_win_front.jsm index 1b0484fec58..cc2fea99a8c 100644 --- a/toolkit/components/osfile/osfile_win_front.jsm +++ b/toolkit/components/osfile/osfile_win_front.jsm @@ -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";