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

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

Issue 2537223003: [DevTools] Introduce Project.isServiceProject method. (Closed)
Patch Set: rebased Created 4 years 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
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 /** 222 /**
223 * @param {!Workspace.UISourceCode} uiSourceCode 223 * @param {!Workspace.UISourceCode} uiSourceCode
224 * @return {string} 224 * @return {string}
225 */ 225 */
226 _filePathForUISourceCode(uiSourceCode) { 226 _filePathForUISourceCode(uiSourceCode) {
227 return uiSourceCode.url().substring(this._fileSystemPath.length); 227 return uiSourceCode.url().substring(this._fileSystemPath.length);
228 } 228 }
229 229
230 /** 230 /**
231 * @override 231 * @override
232 * @return {boolean}
233 */
234 isServiceProject() {
235 return false;
236 }
237
238 /**
239 * @override
232 * @param {!Workspace.UISourceCode} uiSourceCode 240 * @param {!Workspace.UISourceCode} uiSourceCode
233 * @return {!Promise<?Workspace.UISourceCodeMetadata>} 241 * @return {!Promise<?Workspace.UISourceCodeMetadata>}
234 */ 242 */
235 requestMetadata(uiSourceCode) { 243 requestMetadata(uiSourceCode) {
236 if (uiSourceCode[Persistence.FileSystemWorkspaceBinding._metadata]) 244 if (uiSourceCode[Persistence.FileSystemWorkspaceBinding._metadata])
237 return uiSourceCode[Persistence.FileSystemWorkspaceBinding._metadata]; 245 return uiSourceCode[Persistence.FileSystemWorkspaceBinding._metadata];
238 var relativePath = this._filePathForUISourceCode(uiSourceCode); 246 var relativePath = this._filePathForUISourceCode(uiSourceCode);
239 var promise = this._fileSystem.getMetadata(relativePath).then(onMetadata); 247 var promise = this._fileSystem.getMetadata(relativePath).then(onMetadata);
240 uiSourceCode[Persistence.FileSystemWorkspaceBinding._metadata] = promise; 248 uiSourceCode[Persistence.FileSystemWorkspaceBinding._metadata] = promise;
241 return promise; 249 return promise;
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 uiSourceCode[Persistence.FileSystemWorkspaceBinding._metadata] = null; 547 uiSourceCode[Persistence.FileSystemWorkspaceBinding._metadata] = null;
540 uiSourceCode.checkContentUpdated(); 548 uiSourceCode.checkContentUpdated();
541 } 549 }
542 550
543 dispose() { 551 dispose() {
544 this.removeProject(); 552 this.removeProject();
545 } 553 }
546 }; 554 };
547 555
548 Persistence.FileSystemWorkspaceBinding._metadata = Symbol('FileSystemWorkspaceBi nding.Metadata'); 556 Persistence.FileSystemWorkspaceBinding._metadata = Symbol('FileSystemWorkspaceBi nding.Metadata');
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698