Move TreeStyleTabBase.evalInSandbox() to TreeStyleTabUtils.

This commit is contained in:
saneyuki_s 2013-01-04 12:39:58 +09:00
parent 94067b8bf8
commit 665cb5668f
3 changed files with 13 additions and 13 deletions

View File

@ -616,18 +616,7 @@ var TreeStyleTabBase = {
{
return boxObject.getBoxObjectFor(aNode);
},
evalInSandbox : function utils_evalInSandbox(aCode, aOwner)
{
try {
var sandbox = new Components.utils.Sandbox(aOwner || 'about:blank');
return Components.utils.evalInSandbox(aCode, sandbox);
}
catch(e) {
}
return void(0);
},
get browserWindow()
{
return this.topBrowserWindow;

View File

@ -3959,7 +3959,7 @@ TreeStyleTabBrowser.prototype = {
return;
var indexes = [];
var items = this.evalInSandbox('('+this.SessionStore.getClosedTabData(this.window)+')');
var items = utils.evalInSandbox('('+this.SessionStore.getClosedTabData(this.window)+')');
for (let i = 0, maxi = items.length; i < maxi; i++)
{
let item = items[i];

View File

@ -90,6 +90,17 @@ let TreeStyleTabUtils = {
},
get tabbrowserBundle () {
return stringBundle.get('chrome://browser/locale/tabbrowser.properties');
},
evalInSandbox : function utils_evalInSandbox(aCode, aOwner)
{
try {
var sandbox = new Cu.Sandbox(aOwner || 'about:blank');
return Cu.evalInSandbox(aCode, sandbox);
}
catch(e) {
}
return void(0);
}
};