Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoid holding duplicate script source strings in memory
old: strings sent via e10s message manager are duplicated and the sandbox holds onto them as source code, this causes unnecessary memory overhead. new: load scripts from file:// URIs and use lazy getters for scriptSource
- Loading branch information
Showing
5 changed files
with
94 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
var EXPORTED_SYMBOLS = ['fileXHR']; | ||
|
||
Components.utils.importGlobalProperties(["XMLHttpRequest"]); | ||
|
||
// sync XHR. it's just meant to fetch file:// uris that aren't otherwise accessible in content | ||
// don't use it in the parent process or for web URLs | ||
function fileXHR(uri, mimetype) { | ||
var xhr = new XMLHttpRequest(); | ||
xhr.open("open", uri, false); | ||
xhr.overrideMimeType(mimetype); | ||
xhr.send(null); | ||
return xhr.responseText; | ||
} |