Bug 1003905 - Refactor DevToolsUtils.js to be worker friendly; r=past

This commit is contained in:
Eddy Bruel 2014-06-10 20:35:51 +02:00
parent 6f9d23b28e
commit 1ad5aa5b65
2 changed files with 6 additions and 1 deletions

View File

@ -290,6 +290,12 @@ exports.hasSafeGetter = function hasSafeGetter(aDesc) {
* True if it is safe to read properties from aObj, or false otherwise.
*/
exports.isSafeJSObject = function isSafeJSObject(aObj) {
// If we are running on a worker thread, Cu is not available. In this case,
// we always return false, just to be on the safe side.
if (!Cu) {
return false;
}
if (Cu.getGlobalForObject(aObj) ==
Cu.getGlobalForObject(exports.isSafeJSObject)) {
return true; // aObj is not a cross-compartment wrapper.

View File

@ -102,7 +102,6 @@ function createModule(id) {
//
// TODO: Remove this when the whitelist becomes empty
let chromeWhitelist = [
"devtools/toolkit/DevToolsUtils",
"devtools/toolkit/event-emitter",
];