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

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

Issue 2536273003: [DevTools] Remove Workspace.projectTypes enum part1. (Closed)
Patch Set: 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 /** 4 /**
5 * @implements {SDK.TargetManager.Observer} 5 * @implements {SDK.TargetManager.Observer}
6 * @unrestricted 6 * @unrestricted
7 */ 7 */
8 Bindings.BlackboxManager = class { 8 Bindings.BlackboxManager = class {
9 /** 9 /**
10 * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding 10 * @param {!Bindings.DebuggerWorkspaceBinding} debuggerWorkspaceBinding
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return a.lineNumber - b.lineNumber; 98 return a.lineNumber - b.lineNumber;
99 return a.columnNumber - b.columnNumber; 99 return a.columnNumber - b.columnNumber;
100 } 100 }
101 } 101 }
102 102
103 /** 103 /**
104 * @param {!Workspace.UISourceCode} uiSourceCode 104 * @param {!Workspace.UISourceCode} uiSourceCode
105 * @return {boolean} 105 * @return {boolean}
106 */ 106 */
107 isBlackboxedUISourceCode(uiSourceCode) { 107 isBlackboxedUISourceCode(uiSourceCode) {
108 var projectType = uiSourceCode.project().type(); 108 var isContentScript = Bindings.NetworkProject.isContentScriptUISourceCode(ui SourceCode);
109 var isContentScript = projectType === Workspace.projectTypes.ContentScripts;
110 if (isContentScript && Common.moduleSetting('skipContentScripts').get()) 109 if (isContentScript && Common.moduleSetting('skipContentScripts').get())
111 return true; 110 return true;
112 var url = this._uiSourceCodeURL(uiSourceCode); 111 var url = this._uiSourceCodeURL(uiSourceCode);
113 return url ? this.isBlackboxedURL(url) : false; 112 return url ? this.isBlackboxedURL(url) : false;
114 } 113 }
115 114
116 /** 115 /**
117 * @param {string} url 116 * @param {string} url
118 * @param {boolean=} isContentScript 117 * @param {boolean=} isContentScript
119 * @return {boolean} 118 * @return {boolean}
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 return a.lineNumber - b.lineNumber; 175 return a.lineNumber - b.lineNumber;
177 return a.columnNumber - b.columnNumber; 176 return a.columnNumber - b.columnNumber;
178 } 177 }
179 } 178 }
180 179
181 /** 180 /**
182 * @param {!Workspace.UISourceCode} uiSourceCode 181 * @param {!Workspace.UISourceCode} uiSourceCode
183 * @return {?string} 182 * @return {?string}
184 */ 183 */
185 _uiSourceCodeURL(uiSourceCode) { 184 _uiSourceCodeURL(uiSourceCode) {
186 return uiSourceCode.project().type() === Workspace.projectTypes.Debugger ? n ull : uiSourceCode.url(); 185 return Bindings.DefaultScriptMapping.isDebuggerUISourceCode(uiSourceCode) ? null : uiSourceCode.url();
187 } 186 }
188 187
189 /** 188 /**
190 * @param {!Workspace.UISourceCode} uiSourceCode 189 * @param {!Workspace.UISourceCode} uiSourceCode
191 * @return {boolean} 190 * @return {boolean}
192 */ 191 */
193 canBlackboxUISourceCode(uiSourceCode) { 192 canBlackboxUISourceCode(uiSourceCode) {
194 var url = this._uiSourceCodeURL(uiSourceCode); 193 var url = this._uiSourceCodeURL(uiSourceCode);
195 return url ? !!this._urlToRegExpString(url) : false; 194 return url ? !!this._urlToRegExpString(url) : false;
196 } 195 }
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 if (scheme === 'chrome-extension') 417 if (scheme === 'chrome-extension')
419 prefix += parsedURL.host + '\\b'; 418 prefix += parsedURL.host + '\\b';
420 prefix += '.*'; 419 prefix += '.*';
421 } 420 }
422 return prefix + name.escapeForRegExp() + (url.endsWith(name) ? '$' : '\\b'); 421 return prefix + name.escapeForRegExp() + (url.endsWith(name) ? '$' : '\\b');
423 } 422 }
424 }; 423 };
425 424
426 /** @type {!Bindings.BlackboxManager} */ 425 /** @type {!Bindings.BlackboxManager} */
427 Bindings.blackboxManager; 426 Bindings.blackboxManager;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698