| Index: third_party/WebKit/Source/devtools/front_end/persistence/Automapping.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/persistence/Automapping.js b/third_party/WebKit/Source/devtools/front_end/persistence/Automapping.js
|
| index d656d3a3088458ae743217e61155f524548a0ab2..db08c757bf0027d13fe1852c2f8b415f383d2ffd 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/persistence/Automapping.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/persistence/Automapping.js
|
| @@ -62,11 +62,8 @@ Persistence.Automapping = class {
|
| * @return {!Promise}
|
| */
|
| function sweepUnmapped() {
|
| - var networkProjects = this._workspace.projectsForType(Workspace.projectTypes.Network);
|
| - for (var networkProject of networkProjects) {
|
| - for (var uiSourceCode of networkProject.uiSourceCodes())
|
| - this._bindNetwork(uiSourceCode);
|
| - }
|
| + for (var uiSourceCode of Bindings.NetworkProject.uiSourceCodes(this._workspace))
|
| + this._bindNetwork(uiSourceCode);
|
| this._onSweepHappenedForTest();
|
| return Promise.resolve();
|
| }
|
| @@ -81,7 +78,7 @@ Persistence.Automapping = class {
|
| _onProjectRemoved(project) {
|
| for (var uiSourceCode of project.uiSourceCodes())
|
| this._onUISourceCodeRemoved(uiSourceCode);
|
| - if (project.type() !== Workspace.projectTypes.FileSystem)
|
| + if (!Persistence.FileSystemWorkspaceBinding.isFileSystemProject(project))
|
| return;
|
| var fileSystem = /** @type {!Persistence.FileSystemWorkspaceBinding.FileSystem} */ (project);
|
| for (var gitFolder of fileSystem.gitFolders())
|
| @@ -94,7 +91,7 @@ Persistence.Automapping = class {
|
| * @param {!Workspace.Project} project
|
| */
|
| _onProjectAdded(project) {
|
| - if (project.type() !== Workspace.projectTypes.FileSystem)
|
| + if (!Persistence.FileSystemWorkspaceBinding.isFileSystemProject(project))
|
| return;
|
| var fileSystem = /** @type {!Persistence.FileSystemWorkspaceBinding.FileSystem} */ (project);
|
| for (var gitFolder of fileSystem.gitFolders())
|
| @@ -107,11 +104,11 @@ Persistence.Automapping = class {
|
| * @param {!Workspace.UISourceCode} uiSourceCode
|
| */
|
| _onUISourceCodeAdded(uiSourceCode) {
|
| - if (uiSourceCode.project().type() === Workspace.projectTypes.FileSystem) {
|
| + if (Persistence.FileSystemWorkspaceBinding.isFileSystemUISourceCode(uiSourceCode)) {
|
| this._filesIndex.addPath(uiSourceCode.url());
|
| this._fileSystemUISourceCodes.set(uiSourceCode.url(), uiSourceCode);
|
| this._scheduleSweep();
|
| - } else if (uiSourceCode.project().type() === Workspace.projectTypes.Network) {
|
| + } else if (Bindings.NetworkProject.isNetworkUISourceCode(uiSourceCode)) {
|
| this._bindNetwork(uiSourceCode);
|
| }
|
| }
|
| @@ -120,13 +117,13 @@ Persistence.Automapping = class {
|
| * @param {!Workspace.UISourceCode} uiSourceCode
|
| */
|
| _onUISourceCodeRemoved(uiSourceCode) {
|
| - if (uiSourceCode.project().type() === Workspace.projectTypes.FileSystem) {
|
| + if (Persistence.FileSystemWorkspaceBinding.isFileSystemUISourceCode(uiSourceCode)) {
|
| this._filesIndex.removePath(uiSourceCode.url());
|
| this._fileSystemUISourceCodes.delete(uiSourceCode.url());
|
| var binding = uiSourceCode[Persistence.Automapping._binding];
|
| if (binding)
|
| this._unbindNetwork(binding.network);
|
| - } else if (uiSourceCode.project().type() === Workspace.projectTypes.Network) {
|
| + } else if (Bindings.NetworkProject.isNetworkUISourceCode(uiSourceCode)) {
|
| this._unbindNetwork(uiSourceCode);
|
| }
|
| }
|
|
|