Changeset 143196 in webkit


Ignore:
Timestamp:
Feb 18, 2013 4:56:15 AM (11 years ago)
Author:
vsevik@chromium.org
Message:

Web Inspector: Extract FileSystemUtils from FileSystemProjectDelegate as IsolatedFileSystem class.
https://bugs.webkit.org/show_bug.cgi?id=110086

Reviewed by Pavel Feldman.

Extracted IsolatedFileSystem class that could be mocked for tests now.
Renamed IsolatedFileSystemModel to IsolatedFileSystemManager.

  • WebCore.gypi:
  • WebCore.vcproj/WebCore.vcproj:
  • inspector/compile-front-end.py:
  • inspector/front-end/FileSystemProjectDelegate.js:

(WebInspector.FileSystemProjectDelegate):
(WebInspector.FileSystemProjectDelegate.prototype.id):
(WebInspector.FileSystemProjectDelegate.prototype.displayName):
(WebInspector.FileSystemProjectDelegate.prototype.setFileContent):
(WebInspector.FileSystemProjectDelegate.prototype._populate.filesLoaded):
(WebInspector.FileSystemProjectDelegate.prototype._populate):

  • inspector/front-end/IsolatedFileSystem.js: Added.

(WebInspector.IsolatedFileSystem):
(WebInspector.IsolatedFileSystem.errorMessage):
(WebInspector.IsolatedFileSystem.prototype.id):
(WebInspector.IsolatedFileSystem.prototype.path):
(WebInspector.IsolatedFileSystem.prototype._requestFileSystem):
(WebInspector.IsolatedFileSystem.prototype.fileSystemLoaded):
(WebInspector.IsolatedFileSystem.prototype.innerCallback):
(WebInspector.IsolatedFileSystem.prototype.requestFilesRecursive):
(WebInspector.IsolatedFileSystem.prototype.fileEntryLoaded):
(WebInspector.IsolatedFileSystem.prototype.fileLoaded):
(WebInspector.IsolatedFileSystem.prototype.readerLoadEnd):
(WebInspector.IsolatedFileSystem.prototype.errorHandler):
(WebInspector.IsolatedFileSystem.prototype.requestFileContent):
(WebInspector.IsolatedFileSystem.prototype.fileWriterCreated.fileTruncated):
(WebInspector.IsolatedFileSystem.prototype.fileWriterCreated):
(WebInspector.IsolatedFileSystem.prototype.writerEnd):
(WebInspector.IsolatedFileSystem.prototype.setFileContent):
(WebInspector.IsolatedFileSystem.prototype.):
(WebInspector.IsolatedFileSystem.prototype.toArray):
(WebInspector.IsolatedFileSystem.prototype._readDirectory):
(WebInspector.IsolatedFileSystem.prototype._requestEntries):

  • inspector/front-end/IsolatedFileSystemManager.js: Renamed from Source/WebCore/inspector/front-end/IsolatedFileSystemModel.js.

(WebInspector.IsolatedFileSystemManager):
(WebInspector.IsolatedFileSystemManager.prototype.mapping):
(WebInspector.IsolatedFileSystemManager.prototype.supportsFileSystems):
(WebInspector.IsolatedFileSystemManager.prototype._requestFileSystems):
(WebInspector.IsolatedFileSystemManager.prototype.addFileSystem):
(WebInspector.IsolatedFileSystemManager.prototype.removeFileSystem):
(WebInspector.IsolatedFileSystemManager.prototype._fileSystemsLoaded):
(WebInspector.IsolatedFileSystemManager.prototype._innerAddFileSystem):
(WebInspector.IsolatedFileSystemManager.prototype._fileSystemPaths):
(WebInspector.IsolatedFileSystemManager.prototype._processPendingFileSystemRequests):
(WebInspector.IsolatedFileSystemManager.prototype._fileSystemAdded):
(WebInspector.IsolatedFileSystemManager.prototype._fileSystemRemoved):
(WebInspector.IsolatedFileSystemManager.prototype._isolatedFileSystem):
(WebInspector.IsolatedFileSystemManager.prototype.requestDOMFileSystem):
(WebInspector.IsolatedFileSystemDispatcher):
(WebInspector.IsolatedFileSystemDispatcher.prototype.fileSystemsLoaded):
(WebInspector.IsolatedFileSystemDispatcher.prototype.fileSystemRemoved):
(WebInspector.IsolatedFileSystemDispatcher.prototype.fileSystemAdded):

  • inspector/front-end/SettingsScreen.js:

(WebInspector.WorkspaceSettingsTab.prototype._createFileSystemsEditor):
(WebInspector.WorkspaceSettingsTab.prototype._addFileSystemRow.removeFileSystemClicked):
(WebInspector.WorkspaceSettingsTab.prototype._addFileSystemClicked):

  • inspector/front-end/WebKit.qrc:
  • inspector/front-end/inspector.html:
  • inspector/front-end/inspector.js:
Location:
trunk/Source/WebCore
Files:
1 added
9 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r143194 r143196  
     12013-02-18  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: Extract FileSystemUtils from FileSystemProjectDelegate as IsolatedFileSystem class.
     4        https://bugs.webkit.org/show_bug.cgi?id=110086
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Extracted IsolatedFileSystem class that could be mocked for tests now.
     9        Renamed IsolatedFileSystemModel to IsolatedFileSystemManager.
     10
     11        * WebCore.gypi:
     12        * WebCore.vcproj/WebCore.vcproj:
     13        * inspector/compile-front-end.py:
     14        * inspector/front-end/FileSystemProjectDelegate.js:
     15        (WebInspector.FileSystemProjectDelegate):
     16        (WebInspector.FileSystemProjectDelegate.prototype.id):
     17        (WebInspector.FileSystemProjectDelegate.prototype.displayName):
     18        (WebInspector.FileSystemProjectDelegate.prototype.setFileContent):
     19        (WebInspector.FileSystemProjectDelegate.prototype._populate.filesLoaded):
     20        (WebInspector.FileSystemProjectDelegate.prototype._populate):
     21        * inspector/front-end/IsolatedFileSystem.js: Added.
     22        (WebInspector.IsolatedFileSystem):
     23        (WebInspector.IsolatedFileSystem.errorMessage):
     24        (WebInspector.IsolatedFileSystem.prototype.id):
     25        (WebInspector.IsolatedFileSystem.prototype.path):
     26        (WebInspector.IsolatedFileSystem.prototype._requestFileSystem):
     27        (WebInspector.IsolatedFileSystem.prototype.fileSystemLoaded):
     28        (WebInspector.IsolatedFileSystem.prototype.innerCallback):
     29        (WebInspector.IsolatedFileSystem.prototype.requestFilesRecursive):
     30        (WebInspector.IsolatedFileSystem.prototype.fileEntryLoaded):
     31        (WebInspector.IsolatedFileSystem.prototype.fileLoaded):
     32        (WebInspector.IsolatedFileSystem.prototype.readerLoadEnd):
     33        (WebInspector.IsolatedFileSystem.prototype.errorHandler):
     34        (WebInspector.IsolatedFileSystem.prototype.requestFileContent):
     35        (WebInspector.IsolatedFileSystem.prototype.fileWriterCreated.fileTruncated):
     36        (WebInspector.IsolatedFileSystem.prototype.fileWriterCreated):
     37        (WebInspector.IsolatedFileSystem.prototype.writerEnd):
     38        (WebInspector.IsolatedFileSystem.prototype.setFileContent):
     39        (WebInspector.IsolatedFileSystem.prototype.):
     40        (WebInspector.IsolatedFileSystem.prototype.toArray):
     41        (WebInspector.IsolatedFileSystem.prototype._readDirectory):
     42        (WebInspector.IsolatedFileSystem.prototype._requestEntries):
     43        * inspector/front-end/IsolatedFileSystemManager.js: Renamed from Source/WebCore/inspector/front-end/IsolatedFileSystemModel.js.
     44        (WebInspector.IsolatedFileSystemManager):
     45        (WebInspector.IsolatedFileSystemManager.prototype.mapping):
     46        (WebInspector.IsolatedFileSystemManager.prototype.supportsFileSystems):
     47        (WebInspector.IsolatedFileSystemManager.prototype._requestFileSystems):
     48        (WebInspector.IsolatedFileSystemManager.prototype.addFileSystem):
     49        (WebInspector.IsolatedFileSystemManager.prototype.removeFileSystem):
     50        (WebInspector.IsolatedFileSystemManager.prototype._fileSystemsLoaded):
     51        (WebInspector.IsolatedFileSystemManager.prototype._innerAddFileSystem):
     52        (WebInspector.IsolatedFileSystemManager.prototype._fileSystemPaths):
     53        (WebInspector.IsolatedFileSystemManager.prototype._processPendingFileSystemRequests):
     54        (WebInspector.IsolatedFileSystemManager.prototype._fileSystemAdded):
     55        (WebInspector.IsolatedFileSystemManager.prototype._fileSystemRemoved):
     56        (WebInspector.IsolatedFileSystemManager.prototype._isolatedFileSystem):
     57        (WebInspector.IsolatedFileSystemManager.prototype.requestDOMFileSystem):
     58        (WebInspector.IsolatedFileSystemDispatcher):
     59        (WebInspector.IsolatedFileSystemDispatcher.prototype.fileSystemsLoaded):
     60        (WebInspector.IsolatedFileSystemDispatcher.prototype.fileSystemRemoved):
     61        (WebInspector.IsolatedFileSystemDispatcher.prototype.fileSystemAdded):
     62        * inspector/front-end/SettingsScreen.js:
     63        (WebInspector.WorkspaceSettingsTab.prototype._createFileSystemsEditor):
     64        (WebInspector.WorkspaceSettingsTab.prototype._addFileSystemRow.removeFileSystemClicked):
     65        (WebInspector.WorkspaceSettingsTab.prototype._addFileSystemClicked):
     66        * inspector/front-end/WebKit.qrc:
     67        * inspector/front-end/inspector.html:
     68        * inspector/front-end/inspector.js:
     69
    1702013-02-18  Huang Dongsung  <luxtella@company100.net>
    271
  • trunk/Source/WebCore/WebCore.gypi

    r143178 r143196  
    52335233            'inspector/front-end/InspectorView.js',
    52345234            'inspector/front-end/inspector.js',
    5235             'inspector/front-end/IsolatedFileSystemModel.js',
     5235            'inspector/front-end/IsolatedFileSystem.js',
     5236            'inspector/front-end/IsolatedFileSystemManager.js',
    52365237            'inspector/front-end/JavaScriptFormatter.js',
    52375238            'inspector/front-end/jsdifflib.js',
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r143159 r143196  
    7744777447                                </File>
    7744877448                                <File
    77449                                         RelativePath="..\inspector\front-end\IsolatedFileSystemModel.js"
     77449                                        RelativePath="..\inspector\front-end\IsolatedFileSystem.js"
     77450                                        >
     77451                                </File>
     77452                                <File
     77453                                        RelativePath="..\inspector\front-end\IsolatedFileSystemManager.js"
    7745077454                                        >
    7745177455                                </File>
  • trunk/Source/WebCore/inspector/compile-front-end.py

    r143159 r143196  
    8585            "IndexedDBModel.js",
    8686            "InspectorBackend.js",
    87             "IsolatedFileSystemModel.js",
     87            "IsolatedFileSystemManager.js",
     88            "IsolatedFileSystem.js",
    8889            "Linkifier.js",
    8990            "NetworkLog.js",
  • trunk/Source/WebCore/inspector/front-end/FileSystemProjectDelegate.js

    r143180 r143196  
    3333 * @implements {WebInspector.ProjectDelegate}
    3434 * @extends {WebInspector.Object}
    35  * @param {WebInspector.IsolatedFileSystemModel} isolatedFileSystemModel
    36  * @param {string} fileSystemId
    37  * @param {string} fileSystemPath
     35 * @param {WebInspector.IsolatedFileSystem} isolatedFileSystem
    3836 */
    39 WebInspector.FileSystemProjectDelegate = function(isolatedFileSystemModel, fileSystemId, fileSystemPath)
     37WebInspector.FileSystemProjectDelegate = function(isolatedFileSystem)
    4038{
    41     this._isolatedFileSystemModel = isolatedFileSystemModel;
    42     this._fileSystemId = fileSystemId;
    43     this._fileSystemPath = fileSystemPath;
     39    this._fileSystem = isolatedFileSystem;
    4440    this._populate();
    4541}
     
    5349    id: function()
    5450    {
    55         return this._fileSystemId;
     51        return this._fileSystem.id();
    5652    },
    5753
     
    6965    displayName: function()
    7066    {
    71         return this._fileSystemPath.substr(this._fileSystemPath.lastIndexOf("/") + 1);
     67        return this._fileSystem.path().substr(this._fileSystem.path().lastIndexOf("/") + 1);
    7268    },
    7369
     
    8884    {
    8985        var filePath = this._filePathForURI(uri);
    90         WebInspector.FileSystemUtils.requestFileContent(this._isolatedFileSystemModel, this._fileSystemPath, filePath, innerCallback.bind(this));
     86        this._fileSystem.requestFileContent(filePath, innerCallback.bind(this));
    9187       
    9288        /**
     
    108104    {
    109105        var filePath = this._filePathForURI(uri);
    110         WebInspector.FileSystemUtils.setFileContent(this._isolatedFileSystemModel, this._fileSystemPath, filePath, newContent, callback.bind(this, ""));
     106        this._fileSystem.setFileContent(filePath, newContent, callback.bind(this, ""));
    111107    },
    112108
     
    160156    _populate: function()
    161157    {
    162         WebInspector.FileSystemUtils.requestFilesRecursive(this._isolatedFileSystemModel, this._fileSystemPath, "", filesLoaded.bind(this));
     158        this._fileSystem.requestFilesRecursive("", filesLoaded.bind(this));
    163159
    164160        function filesLoaded(files)
     
    168164                var contentType = this._contentTypeForPath(files[i]);
    169165                var url = WebInspector.fileMapping.urlForURI(uri);
    170                 var fileDescriptor = new WebInspector.FileDescriptor(uri, "file://" + this._fileSystemPath + files[i], url, contentType, true);
     166                var fileDescriptor = new WebInspector.FileDescriptor(uri, "file://" + this._fileSystem.path() + files[i], url, contentType, true);
    171167                this._addFile(fileDescriptor);
    172168            }
     
    202198 */
    203199WebInspector.fileSystemProjectDelegate = null;
    204 
    205 /**
    206  * @constructor
    207  */
    208 WebInspector.FileSystemUtils = function()
    209 {
    210 }
    211 
    212 WebInspector.FileSystemUtils.errorMessage = function(error)
    213 {
    214     var msg;
    215     switch (error.code) {
    216     case FileError.QUOTA_EXCEEDED_ERR:
    217         msg = "QUOTA_EXCEEDED_ERR";
    218         break;
    219     case FileError.NOT_FOUND_ERR:
    220         msg = "NOT_FOUND_ERR";
    221         break;
    222     case FileError.SECURITY_ERR:
    223         msg = "SECURITY_ERR";
    224         break;
    225     case FileError.INVALID_MODIFICATION_ERR:
    226         msg = "INVALID_MODIFICATION_ERR";
    227         break;
    228     case FileError.INVALID_STATE_ERR:
    229         msg = "INVALID_STATE_ERR";
    230         break;
    231     default:
    232         msg = "Unknown Error";
    233         break;
    234     };
    235 
    236     return "File system error: " + msg;
    237 }
    238 
    239 /**
    240  * @param {WebInspector.IsolatedFileSystemModel} isolatedFileSystemModel
    241  * @param {string} fileSystemPath
    242  * @param {function(DOMFileSystem)} callback
    243  */
    244 WebInspector.FileSystemUtils.requestFileSystem = function(isolatedFileSystemModel, fileSystemPath, callback)
    245 {
    246     isolatedFileSystemModel.requestDOMFileSystem(fileSystemPath, callback);
    247 }
    248 
    249 /**
    250  * @param {WebInspector.IsolatedFileSystemModel} isolatedFileSystemModel
    251  * @param {string} fileSystemPath
    252  * @param {string} path
    253  * @param {function(Array.<string>)} callback
    254  */
    255 WebInspector.FileSystemUtils.requestFilesRecursive = function(isolatedFileSystemModel, fileSystemPath, path, callback)
    256 {
    257     WebInspector.FileSystemUtils.requestFileSystem(isolatedFileSystemModel, fileSystemPath, fileSystemLoaded);
    258 
    259     var fileSystem;
    260     /**
    261      * @param {DOMFileSystem} fs
    262      */
    263     function fileSystemLoaded(fs)
    264     {
    265         fileSystem = fs;
    266         WebInspector.FileSystemUtils._requestEntries(fileSystem, path, innerCallback);
    267     }
    268 
    269     var result = [];
    270     var callbacksLeft = 1;
    271     /**
    272      * @param {Array.<FileEntry>} entries
    273      */
    274     function innerCallback(entries)
    275     {
    276         for (var i = 0; i < entries.length; ++i) {
    277             var entry = entries[i];
    278             if (!entry.isDirectory)
    279                 result.push(entry.fullPath);
    280             else {
    281                 callbacksLeft++;
    282                 WebInspector.FileSystemUtils._requestEntries(fileSystem, entry.fullPath, innerCallback);
    283             }
    284         }
    285         if (!--callbacksLeft)
    286             callback(result);
    287     }
    288 }
    289 
    290 /**
    291  * @param {WebInspector.IsolatedFileSystemModel} isolatedFileSystemModel
    292  * @param {string} fileSystemPath
    293  * @param {string} path
    294  * @param {function(?string)} callback
    295  */
    296 WebInspector.FileSystemUtils.requestFileContent = function(isolatedFileSystemModel, fileSystemPath, path, callback)
    297 {
    298     WebInspector.FileSystemUtils.requestFileSystem(isolatedFileSystemModel, fileSystemPath, fileSystemLoaded);
    299 
    300     var fileSystem;
    301    
    302     /**
    303      * @param {DOMFileSystem} fs
    304      */
    305     function fileSystemLoaded(fs)
    306     {
    307         fs.root.getFile(path, null, fileEntryLoaded, errorHandler);
    308     }
    309 
    310     /**
    311      * @param {FileEntry} entry
    312      */
    313     function fileEntryLoaded(entry)
    314     {
    315         entry.file(fileLoaded, errorHandler);
    316     }
    317 
    318     /**
    319      * @param {!Blob} file
    320      */
    321     function fileLoaded(file)
    322     {
    323         var reader = new FileReader();
    324         reader.onloadend = readerLoadEnd;
    325         reader.readAsText(file);
    326     }
    327 
    328     /**
    329      * @this {FileReader}
    330      */
    331     function readerLoadEnd()
    332     {
    333         callback(/** @type {string} */ (this.result));
    334     }
    335 
    336     function errorHandler(error)
    337     {
    338         var errorMessage = WebInspector.FileSystemUtils.errorMessage(error);
    339         console.error(errorMessage + " when getting content for file '" + (fileSystemPath + "/" + path) + "'");
    340         callback(null);
    341     }
    342 }
    343 
    344 /**
    345  * @param {WebInspector.IsolatedFileSystemModel} isolatedFileSystemModel
    346  * @param {string} fileSystemPath
    347  * @param {string} path
    348  * @param {string} content
    349  * @param {function()} callback
    350  */
    351 WebInspector.FileSystemUtils.setFileContent = function(isolatedFileSystemModel, fileSystemPath, path, content, callback)
    352 {
    353     WebInspector.FileSystemUtils.requestFileSystem(isolatedFileSystemModel, fileSystemPath, fileSystemLoaded);
    354 
    355     var fileSystem;
    356 
    357     /**
    358      * @param {DOMFileSystem} fs
    359      */
    360     function fileSystemLoaded(fs)
    361     {
    362         fs.root.getFile(path, null, fileEntryLoaded, errorHandler);
    363     }
    364 
    365     /**
    366      * @param {FileEntry} entry
    367      */
    368     function fileEntryLoaded(entry)
    369     {
    370         entry.createWriter(fileWriterCreated, errorHandler);
    371     }
    372 
    373     /**
    374      * @param {FileWriter} fileWriter
    375      */
    376     function fileWriterCreated(fileWriter)
    377     {
    378         fileWriter.onerror = errorHandler;
    379         fileWriter.onwriteend = fileTruncated;
    380         fileWriter.truncate(0);
    381 
    382         function fileTruncated()
    383         {
    384             fileWriter.onwriteend = writerEnd;
    385             var blob = new Blob([content], { type: "text/plain" });
    386             fileWriter.write(blob);
    387         }
    388     }
    389 
    390     function writerEnd()
    391     {
    392         callback();
    393     }
    394 
    395     function errorHandler(error)
    396     {
    397         var errorMessage = WebInspector.FileSystemUtils.errorMessage(error);
    398         console.error(errorMessage + " when setting content for file '" + (fileSystemPath + "/" + path) + "'");
    399         callback();
    400     }
    401 }
    402 
    403 /**
    404  * @param {DirectoryEntry} dirEntry
    405  * @param {function(Array.<FileEntry>)} callback
    406  */
    407 WebInspector.FileSystemUtils._readDirectory = function(dirEntry, callback)
    408 {
    409     var dirReader = dirEntry.createReader();
    410     var entries = [];
    411 
    412     function innerCallback(results)
    413     {
    414         if (!results.length)
    415             callback(entries.sort());
    416         else {
    417             entries = entries.concat(toArray(results));
    418             dirReader.readEntries(innerCallback, errorHandler);
    419         }
    420     }
    421 
    422     function toArray(list)
    423     {
    424         return Array.prototype.slice.call(list || [], 0);
    425     }   
    426 
    427     dirReader.readEntries(innerCallback, errorHandler);
    428 
    429     function errorHandler(error)
    430     {
    431         var errorMessage = WebInspector.FileSystemUtils.errorMessage(error);
    432         console.error(errorMessage + " when reading directory '" + dirEntry.fullPath + "'");
    433         callback([]);
    434     }
    435 }
    436 
    437 /**
    438  * @param {DOMFileSystem} fileSystem
    439  * @param {string} path
    440  * @param {function(Array.<FileEntry>)} callback
    441  */
    442 WebInspector.FileSystemUtils._requestEntries = function(fileSystem, path, callback)
    443 {
    444     fileSystem.root.getDirectory(path, null, innerCallback, errorHandler);
    445 
    446     function innerCallback(dirEntry)
    447     {
    448         WebInspector.FileSystemUtils._readDirectory(dirEntry, callback)
    449     }
    450 
    451     function errorHandler(error)
    452     {
    453         var errorMessage = WebInspector.FileSystemUtils.errorMessage(error);
    454         console.error(errorMessage + " when requesting entry '" + path + "'");
    455         callback([]);
    456     }
    457 }
  • trunk/Source/WebCore/inspector/front-end/IsolatedFileSystemManager.js

    r143195 r143196  
    3333 * @param {WebInspector.Workspace} workspace
    3434 */
    35 WebInspector.IsolatedFileSystemModel = function(workspace)
     35WebInspector.IsolatedFileSystemManager = function(workspace)
    3636{
    3737    this._workspace = workspace;
    38     /** @type {!Object.<string, WebInspector.IsolatedFileSystemModel.FileSystem>} */
     38    /** @type {!Object.<string, WebInspector.IsolatedFileSystemManager.FileSystem>} */
    3939    this._fileSystems = {};
    4040    /** @type {Object.<string, Array.<function(DOMFileSystem)>>} */
     
    4747
    4848/** @typedef {{fileSystemName: string, rootURL: string, fileSystemPath: string}} */
    49 WebInspector.IsolatedFileSystemModel.FileSystem;
    50 
    51 WebInspector.IsolatedFileSystemModel.prototype = {
     49WebInspector.IsolatedFileSystemManager.FileSystem;
     50
     51WebInspector.IsolatedFileSystemManager.prototype = {
    5252    /**
    5353     * @return {WebInspector.FileSystemMapping}
     
    9191
    9292    /**
    93      * @param {Array.<WebInspector.IsolatedFileSystemModel.FileSystem>} fileSystems
     93     * @param {Array.<WebInspector.IsolatedFileSystemManager.FileSystem>} fileSystems
    9494     */
    9595    _fileSystemsLoaded: function(fileSystems)
     
    102102
    103103    /**
    104      * @param {WebInspector.IsolatedFileSystemModel.FileSystem} fileSystem
     104     * @param {WebInspector.IsolatedFileSystemManager.FileSystem} fileSystem
    105105     */
    106106    _innerAddFileSystem: function(fileSystem)
     
    110110        var fileSystemId = this._fileSystemMapping.addFileSystemMapping(fileSystemPath);
    111111        console.assert(!this._workspace.project(fileSystemId));
    112         this._workspace.addProject(new WebInspector.FileSystemProjectDelegate(this, fileSystemId, fileSystemPath));
     112        var isolatedFileSystem = new WebInspector.IsolatedFileSystem(this, fileSystemId, fileSystemPath);
     113        this._workspace.addProject(new WebInspector.FileSystemProjectDelegate(isolatedFileSystem));
    113114    },
    114115
     
    133134    /**
    134135     * @param {string} errorMessage
    135      * @param {WebInspector.IsolatedFileSystemModel.FileSystem} fileSystem
     136     * @param {WebInspector.IsolatedFileSystemManager.FileSystem} fileSystem
    136137     */
    137138    _fileSystemAdded: function(errorMessage, fileSystem)
     
    198199
    199200/**
    200  * @type {?WebInspector.IsolatedFileSystemModel}
    201  */
    202 WebInspector.isolatedFileSystemModel = null;
     201 * @type {?WebInspector.IsolatedFileSystemManager}
     202 */
     203WebInspector.isolatedFileSystemManager = null;
    203204
    204205/**
    205206 * @constructor
    206  * @param {WebInspector.IsolatedFileSystemModel} isolatedFileSystemModel
    207  */
    208 WebInspector.IsolatedFileSystemDispatcher = function(isolatedFileSystemModel)
     207 * @param {WebInspector.IsolatedFileSystemManager} IsolatedFileSystemManager
     208 */
     209WebInspector.IsolatedFileSystemDispatcher = function(IsolatedFileSystemManager)
    209210{
    210     this._isolatedFileSystemModel = isolatedFileSystemModel;
     211    this._IsolatedFileSystemManager = IsolatedFileSystemManager;
    211212}
    212213
    213214WebInspector.IsolatedFileSystemDispatcher.prototype = {
    214215    /**
    215      * @param {Array.<WebInspector.IsolatedFileSystemModel.FileSystem>} fileSystems
     216     * @param {Array.<WebInspector.IsolatedFileSystemManager.FileSystem>} fileSystems
    216217     */
    217218    fileSystemsLoaded: function(fileSystems)
    218219    {
    219         this._isolatedFileSystemModel._fileSystemsLoaded(fileSystems);
     220        this._IsolatedFileSystemManager._fileSystemsLoaded(fileSystems);
    220221    },
    221222
     
    225226    fileSystemRemoved: function(fileSystemPath)
    226227    {
    227         this._isolatedFileSystemModel._fileSystemRemoved(fileSystemPath);
     228        this._IsolatedFileSystemManager._fileSystemRemoved(fileSystemPath);
    228229    },
    229230
    230231    /**
    231232     * @param {string} errorMessage
    232      * @param {WebInspector.IsolatedFileSystemModel.FileSystem} fileSystem
     233     * @param {WebInspector.IsolatedFileSystemManager.FileSystem} fileSystem
    233234     */
    234235    fileSystemAdded: function(errorMessage, fileSystem)
    235236    {
    236         this._isolatedFileSystemModel._fileSystemAdded(errorMessage, fileSystem);
     237        this._IsolatedFileSystemManager._fileSystemAdded(errorMessage, fileSystem);
    237238    }
    238239}
  • trunk/Source/WebCore/inspector/front-end/SettingsScreen.js

    r142597 r143196  
    476476        addFileSystemButton.addEventListener("click", this._addFileSystemClicked.bind(this));
    477477
    478         var fileSystemPaths = WebInspector.isolatedFileSystemModel.mapping().fileSystemPaths();
     478        var fileSystemPaths = WebInspector.isolatedFileSystemManager.mapping().fileSystemPaths();
    479479        for (var i = 0; i < fileSystemPaths.length; ++i)
    480480            this._addFileSystemRow(fileSystemPaths[i]);
     
    554554        {
    555555            removeFileSystemButton.disabled = true;
    556             WebInspector.isolatedFileSystemModel.removeFileSystem(fileSystemPath, fileSystemRemoved.bind(this));
     556            WebInspector.isolatedFileSystemManager.removeFileSystem(fileSystemPath, fileSystemRemoved.bind(this));
    557557        }
    558558       
     
    566566    _addFileSystemClicked: function()
    567567    {
    568         WebInspector.isolatedFileSystemModel.addFileSystem(this._fileSystemAdded.bind(this));
     568        WebInspector.isolatedFileSystemManager.addFileSystem(this._fileSystemAdded.bind(this));
    569569    },
    570570
  • trunk/Source/WebCore/inspector/front-end/WebKit.qrc

    r143159 r143196  
    105105    <file>InspectorView.js</file>
    106106    <file>JSHeapSnapshot.js</file>
    107     <file>IsolatedFileSystemModel.js</file>
     107    <file>IsolatedFileSystem.js</file>
     108    <file>IsolatedFileSystemManager.js</file>
    108109    <file>JavaScriptFormatter.js</file>
    109110    <file>JavaScriptSourceFrame.js</file>
  • trunk/Source/WebCore/inspector/front-end/inspector.html

    r143159 r143196  
    143143    <script type="text/javascript" src="FileSystemProjectDelegate.js"></script>
    144144    <script type="text/javascript" src="FileSystemMapping.js"></script>
    145     <script type="text/javascript" src="IsolatedFileSystemModel.js"></script>
     145    <script type="text/javascript" src="IsolatedFileSystem.js"></script>
     146    <script type="text/javascript" src="IsolatedFileSystemManager.js"></script>
    146147    <script type="text/javascript" src="FileMapping.js"></script>
    147148    <script type="text/javascript" src="Workspace.js"></script>
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r143159 r143196  
    439439    this.workspaceController = new WebInspector.WorkspaceController(this.workspace);
    440440
    441     this.isolatedFileSystemModel = new WebInspector.IsolatedFileSystemModel(this.workspace);
    442     this.isolatedFileSystemDispatcher = new WebInspector.IsolatedFileSystemDispatcher(this.isolatedFileSystemModel);
    443     this.fileMapping = new WebInspector.FileMapping(this.isolatedFileSystemModel.mapping());
     441    this.isolatedFileSystemManager = new WebInspector.IsolatedFileSystemManager(this.workspace);
     442    this.isolatedFileSystemDispatcher = new WebInspector.IsolatedFileSystemDispatcher(this.isolatedFileSystemManager);
     443    this.fileMapping = new WebInspector.FileMapping(this.isolatedFileSystemManager.mapping());
    444444
    445445    this.networkWorkspaceProvider = new WebInspector.SimpleWorkspaceProvider(this.workspace, WebInspector.projectTypes.Network);
Note: See TracChangeset for help on using the changeset viewer.