Skip to content
This repository has been archived by the owner on Feb 26, 2022. It is now read-only.

fix bug 672443 - reuse compartments between module sandboxes #325

Merged
merged 3 commits into from
Jan 10, 2012
Merged

fix bug 672443 - reuse compartments between module sandboxes #325

merged 3 commits into from
Jan 10, 2012

Conversation

mykmelez
Copy link
Contributor

This patch fixes bug 672443 by reusing compartments between module sandboxes created by an instance of the loader. It drastically reduces the number of entries for modules in about:memory?verbose when tested against the annotator example. It also happens to fix bug 680821, which is also being addressed by pull request 323. Since this pull request fixes both issues, it's the better one to merge.

@@ -15,14 +15,15 @@ const scriptLoader = Cc['@mozilla.org/moz/jssubscript-loader;1'].
getService(Ci.mozIJSSubScriptLoader);

const Sandbox = {
new: function (prototype, principal) {
new: function ({ principal, prototype, name, existingSandbox }) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get following error about 'principal':
"reference to undefined property "principal""
I'm not an expert in object deconstruction, but it seems that all such attribute has to be set in the given object, otherwise we get this error.

ochameau added a commit that referenced this pull request Jan 10, 2012
fix bug 672443 - reuse compartments between module sandboxes and set sandboxName to the module URI r=@ochameau
@ochameau ochameau merged commit 0b626f7 into mozilla:master Jan 10, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants