Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/bindings/FileSystemWorkspaceBinding.js

Issue 2296983003: DevTools: kill WI.IsolatedFileSystemManager FileSystemsLoaded event (Closed)
Patch Set: remove nested arrow Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 20 matching lines...) Expand all
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @param {!WebInspector.IsolatedFileSystemManager} isolatedFileSystemManager 33 * @param {!WebInspector.IsolatedFileSystemManager} isolatedFileSystemManager
34 * @param {!WebInspector.Workspace} workspace 34 * @param {!WebInspector.Workspace} workspace
35 */ 35 */
36 WebInspector.FileSystemWorkspaceBinding = function(isolatedFileSystemManager, wo rkspace) 36 WebInspector.FileSystemWorkspaceBinding = function(isolatedFileSystemManager, wo rkspace)
37 { 37 {
38 this._isolatedFileSystemManager = isolatedFileSystemManager; 38 this._isolatedFileSystemManager = isolatedFileSystemManager;
39 this._workspace = workspace; 39 this._workspace = workspace;
40 this._eventListeners = [ 40 this._eventListeners = [
41 this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFi leSystemManager.Events.FileSystemAdded, this._fileSystemAdded, this), 41 this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFi leSystemManager.Events.FileSystemAdded, this._onFileSystemAdded, this),
42 this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFi leSystemManager.Events.FileSystemRemoved, this._fileSystemRemoved, this), 42 this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFi leSystemManager.Events.FileSystemRemoved, this._onFileSystemRemoved, this),
43 this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFi leSystemManager.Events.FileSystemFilesChanged, this._fileSystemFilesChanged, thi s) 43 this._isolatedFileSystemManager.addEventListener(WebInspector.IsolatedFi leSystemManager.Events.FileSystemFilesChanged, this._fileSystemFilesChanged, thi s)
44 ]; 44 ];
45 /** @type {!Map.<string, !WebInspector.FileSystemWorkspaceBinding.FileSystem >} */ 45 /** @type {!Map.<string, !WebInspector.FileSystemWorkspaceBinding.FileSystem >} */
46 this._boundFileSystems = new Map(); 46 this._boundFileSystems = new Map();
47 this._isolatedFileSystemManager.waitForFileSystems()
48 .then(this._onFileSystemsLoaded.bind(this));
47 } 49 }
48 50
49 WebInspector.FileSystemWorkspaceBinding._styleSheetExtensions = new Set(["css", "scss", "sass", "less"]); 51 WebInspector.FileSystemWorkspaceBinding._styleSheetExtensions = new Set(["css", "scss", "sass", "less"]);
50 WebInspector.FileSystemWorkspaceBinding._documentExtensions = new Set(["htm", "h tml", "asp", "aspx", "phtml", "jsp"]); 52 WebInspector.FileSystemWorkspaceBinding._documentExtensions = new Set(["htm", "h tml", "asp", "aspx", "phtml", "jsp"]);
51 WebInspector.FileSystemWorkspaceBinding._scriptExtensions = new Set(["asp", "asp x", "c", "cc", "cljs", "coffee", "cpp", "cs", "dart", "java", "js", "jsp", "jsx" , "h", "m", "mm", "py", "sh", "ts", "tsx", "ls"]); 53 WebInspector.FileSystemWorkspaceBinding._scriptExtensions = new Set(["asp", "asp x", "c", "cc", "cljs", "coffee", "cpp", "cs", "dart", "java", "js", "jsp", "jsx" , "h", "m", "mm", "py", "sh", "ts", "tsx", "ls"]);
52 54
53 WebInspector.FileSystemWorkspaceBinding._imageExtensions = WebInspector.Isolated FileSystem.ImageExtensions; 55 WebInspector.FileSystemWorkspaceBinding._imageExtensions = WebInspector.Isolated FileSystem.ImageExtensions;
54 56
55 /** 57 /**
56 * @param {string} fileSystemPath 58 * @param {string} fileSystemPath
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 WebInspector.FileSystemWorkspaceBinding.prototype = { 104 WebInspector.FileSystemWorkspaceBinding.prototype = {
103 /** 105 /**
104 * @return {!WebInspector.IsolatedFileSystemManager} 106 * @return {!WebInspector.IsolatedFileSystemManager}
105 */ 107 */
106 fileSystemManager: function() 108 fileSystemManager: function()
107 { 109 {
108 return this._isolatedFileSystemManager; 110 return this._isolatedFileSystemManager;
109 }, 111 },
110 112
111 /** 113 /**
114 * @param {!Array<!WebInspector.IsolatedFileSystem>} fileSystems
115 */
116 _onFileSystemsLoaded: function(fileSystems)
117 {
118 for (var fileSystem of fileSystems)
119 this._addFileSystem(fileSystem);
120 },
121
122 /**
112 * @param {!WebInspector.Event} event 123 * @param {!WebInspector.Event} event
113 */ 124 */
114 _fileSystemAdded: function(event) 125 _onFileSystemAdded: function(event)
115 { 126 {
116 var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event. data); 127 var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event. data);
128 this._addFileSystem(fileSystem);
129 },
130
131 /**
132 * @param {!WebInspector.IsolatedFileSystem} fileSystem
133 */
134 _addFileSystem: function(fileSystem)
135 {
117 var boundFileSystem = new WebInspector.FileSystemWorkspaceBinding.FileSy stem(this, fileSystem, this._workspace); 136 var boundFileSystem = new WebInspector.FileSystemWorkspaceBinding.FileSy stem(this, fileSystem, this._workspace);
118 this._boundFileSystems.set(fileSystem.path(), boundFileSystem); 137 this._boundFileSystems.set(fileSystem.path(), boundFileSystem);
119 }, 138 },
120 139
121 /** 140 /**
122 * @param {!WebInspector.Event} event 141 * @param {!WebInspector.Event} event
123 */ 142 */
124 _fileSystemRemoved: function(event) 143 _onFileSystemRemoved: function(event)
125 { 144 {
126 var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event. data); 145 var fileSystem = /** @type {!WebInspector.IsolatedFileSystem} */ (event. data);
127 var boundFileSystem = this._boundFileSystems.get(fileSystem.path()); 146 var boundFileSystem = this._boundFileSystems.get(fileSystem.path());
128 boundFileSystem.dispose(); 147 boundFileSystem.dispose();
129 this._boundFileSystems.remove(fileSystem.path()); 148 this._boundFileSystems.remove(fileSystem.path());
130 }, 149 },
131 150
132 /** 151 /**
133 * @param {!WebInspector.Event} event 152 * @param {!WebInspector.Event} event
134 */ 153 */
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 uiSourceCode.checkContentUpdated(); 534 uiSourceCode.checkContentUpdated();
516 }, 535 },
517 536
518 dispose: function() 537 dispose: function()
519 { 538 {
520 this.removeProject(); 539 this.removeProject();
521 }, 540 },
522 541
523 __proto__: WebInspector.ProjectStore.prototype 542 __proto__: WebInspector.ProjectStore.prototype
524 } 543 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698