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

Unified Diff: third_party/WebKit/Source/devtools/front_end/persistence/DefaultMapping.js

Issue 2536273003: [DevTools] Remove Workspace.projectTypes enum part1. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/persistence/DefaultMapping.js
diff --git a/third_party/WebKit/Source/devtools/front_end/persistence/DefaultMapping.js b/third_party/WebKit/Source/devtools/front_end/persistence/DefaultMapping.js
index 26ccb97a0d5fbe5d901ac3a48f91a94ffa04ab99..5bbe0822402147ffeb2662de466cb2fad536b00b 100644
--- a/third_party/WebKit/Source/devtools/front_end/persistence/DefaultMapping.js
+++ b/third_party/WebKit/Source/devtools/front_end/persistence/DefaultMapping.js
@@ -32,11 +32,8 @@ Persistence.DefaultMapping = class {
_remap() {
for (var binding of this._bindings.valuesArray())
this._unbind(binding.network);
- var networkProjects = this._workspace.projectsForType(Workspace.projectTypes.Network);
- for (var networkProject of networkProjects) {
- for (var uiSourceCode of networkProject.uiSourceCodes())
- this._bind(uiSourceCode);
- }
+ for (var uiSourceCode of Bindings.NetworkProject.uiSourceCodes(this._workspace))
+ this._bind(uiSourceCode);
}
/**
@@ -69,13 +66,13 @@ Persistence.DefaultMapping = class {
* @return {?Persistence.PersistenceBinding}
*/
_createBinding(uiSourceCode) {
- if (uiSourceCode.project().type() === Workspace.projectTypes.FileSystem) {
+ if (Persistence.FileSystemWorkspaceBinding.isFileSystemUISourceCode(uiSourceCode)) {
var fileSystemPath = Persistence.FileSystemWorkspaceBinding.fileSystemPath(uiSourceCode.project().id());
var networkURL = this._fileSystemMapping.networkURLForFileSystemURL(fileSystemPath, uiSourceCode.url());
var networkSourceCode = networkURL ? this._workspace.uiSourceCodeForURL(networkURL) : null;
return networkSourceCode ? new Persistence.PersistenceBinding(networkSourceCode, uiSourceCode, false) : null;
}
- if (uiSourceCode.project().type() === Workspace.projectTypes.Network) {
+ if (Bindings.NetworkProject.isNetworkUISourceCode(uiSourceCode)) {
var file = this._fileSystemMapping.fileForURL(uiSourceCode.url());
var projectId = file ? Persistence.FileSystemWorkspaceBinding.projectId(file.fileSystemPath) : null;
var fileSourceCode = file && projectId ? this._workspace.uiSourceCode(projectId, file.fileURL) : null;

Powered by Google App Engine
This is Rietveld 408576698