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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/workspace/Workspace.js

Issue 1422463007: DevTools: use inotify to pick changes on the filesystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix Created 5 years, 1 month 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 | « third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystemManager.js ('k') | no next file » | 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 /** 79 /**
80 * @interface 80 * @interface
81 * @extends {WebInspector.EventTarget} 81 * @extends {WebInspector.EventTarget}
82 */ 82 */
83 WebInspector.ProjectDelegate = function() { } 83 WebInspector.ProjectDelegate = function() { }
84 84
85 WebInspector.ProjectDelegate.Events = { 85 WebInspector.ProjectDelegate.Events = {
86 FileAdded: "FileAdded", 86 FileAdded: "FileAdded",
87 FileRemoved: "FileRemoved", 87 FileRemoved: "FileRemoved",
88 FileChanged: "FileChanged"
88 } 89 }
89 90
90 WebInspector.ProjectDelegate.prototype = { 91 WebInspector.ProjectDelegate.prototype = {
91 /** 92 /**
92 * @return {string} 93 * @return {string}
93 */ 94 */
94 type: function() { }, 95 type: function() { },
95 96
96 /** 97 /**
97 * @return {string} 98 * @return {string}
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 this._uiSourceCodesMap = new Map(); 202 this._uiSourceCodesMap = new Map();
202 /** @type {!Array.<!WebInspector.UISourceCode>} */ 203 /** @type {!Array.<!WebInspector.UISourceCode>} */
203 this._uiSourceCodesList = []; 204 this._uiSourceCodesList = [];
204 this._workspace = workspace; 205 this._workspace = workspace;
205 this._projectId = projectId; 206 this._projectId = projectId;
206 this._projectDelegate = projectDelegate; 207 this._projectDelegate = projectDelegate;
207 this._url = this._projectDelegate.url(); 208 this._url = this._projectDelegate.url();
208 this._displayName = this._projectDelegate.displayName(); 209 this._displayName = this._projectDelegate.displayName();
209 projectDelegate.addEventListener(WebInspector.ProjectDelegate.Events.FileAdd ed, this._fileAdded, this); 210 projectDelegate.addEventListener(WebInspector.ProjectDelegate.Events.FileAdd ed, this._fileAdded, this);
210 projectDelegate.addEventListener(WebInspector.ProjectDelegate.Events.FileRem oved, this._fileRemoved, this); 211 projectDelegate.addEventListener(WebInspector.ProjectDelegate.Events.FileRem oved, this._fileRemoved, this);
212 projectDelegate.addEventListener(WebInspector.ProjectDelegate.Events.FileCha nged, this._fileChanged, this);
211 } 213 }
212 214
213 /** 215 /**
214 * @enum {string} 216 * @enum {string}
215 */ 217 */
216 WebInspector.Project.Events = { 218 WebInspector.Project.Events = {
217 DisplayNameUpdated: "DisplayNameUpdated" 219 DisplayNameUpdated: "DisplayNameUpdated"
218 }; 220 };
219 221
220 WebInspector.Project.prototype = { 222 WebInspector.Project.prototype = {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 /** 293 /**
292 * @param {!WebInspector.Event} event 294 * @param {!WebInspector.Event} event
293 */ 295 */
294 _fileRemoved: function(event) 296 _fileRemoved: function(event)
295 { 297 {
296 var path = /** @type {string} */ (event.data); 298 var path = /** @type {string} */ (event.data);
297 this._removeFile(path); 299 this._removeFile(path);
298 }, 300 },
299 301
300 /** 302 /**
303 * @param {!WebInspector.Event} event
304 */
305 _fileChanged: function(event)
306 {
307 var path = /** @type {string} */ (event.data);
308 var uiSourceCode = this.uiSourceCode(path);
309 if (uiSourceCode && uiSourceCode.contentLoaded())
310 uiSourceCode.checkContentUpdated();
311 },
312
313 /**
301 * @param {string} path 314 * @param {string} path
302 */ 315 */
303 _removeFile: function(path) 316 _removeFile: function(path)
304 { 317 {
305 var uiSourceCode = this.uiSourceCode(path); 318 var uiSourceCode = this.uiSourceCode(path);
306 if (!uiSourceCode) 319 if (!uiSourceCode)
307 return; 320 return;
308 321
309 var entry = this._uiSourceCodesMap.get(path); 322 var entry = this._uiSourceCodesMap.get(path);
310 var movedUISourceCode = this._uiSourceCodesList[this._uiSourceCodesList. length - 1]; 323 var movedUISourceCode = this._uiSourceCodesList[this._uiSourceCodesList. length - 1];
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 return this._hasResourceContentTrackingExtensions; 744 return this._hasResourceContentTrackingExtensions;
732 }, 745 },
733 746
734 __proto__: WebInspector.Object.prototype 747 __proto__: WebInspector.Object.prototype
735 } 748 }
736 749
737 /** 750 /**
738 * @type {!WebInspector.Workspace} 751 * @type {!WebInspector.Workspace}
739 */ 752 */
740 WebInspector.workspace; 753 WebInspector.workspace;
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystemManager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698