mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-28 14:37:04 +00:00
Cache URLs for performance improvement.
Reviewed by me.
This commit is contained in:
@@ -20,12 +20,12 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
var ExecutableUnloadedFileDependencies = 0,
|
||||
ExecutableLoadingFileDependencies = 1,
|
||||
ExecutableLoadedFileDependencies = 2,
|
||||
AnonymousExecutableCount = 0;
|
||||
|
||||
|
||||
function Executable(/*String*/ aCode, /*Array*/ fileDependencies, /*CFURL*/ aURL, /*Function*/ aFunction)
|
||||
{
|
||||
if (arguments.length === 0)
|
||||
@@ -366,6 +366,9 @@ Executable.fileImporterForURL = function(/*CFURL*/ aURL)
|
||||
{
|
||||
cachedImporter = function(/*CFURL*/ aURL, /*BOOL*/ isQuoted, /*Function*/ aCallback)
|
||||
{
|
||||
// We make heavy use of URLs throughout this process, so cache them!
|
||||
enableCFURLCaching();
|
||||
|
||||
aURL = new CFURL(aURL, isQuoted ? referenceURL : NULL);
|
||||
|
||||
var fileExecutableSearch = new FileExecutableSearch(aURL, isQuoted);
|
||||
@@ -377,6 +380,9 @@ Executable.fileImporterForURL = function(/*CFURL*/ aURL)
|
||||
{
|
||||
fileExecutable.execute();
|
||||
|
||||
// No more need to cache these.
|
||||
disableCFURLCaching();
|
||||
|
||||
if (aCallback)
|
||||
aCallback();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user