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

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

Issue 2198443004: [DevTools] Fix location.script().sourceURL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a Created 4 years, 4 months 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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding 7 * @param {!WebInspector.DebuggerWorkspaceBinding} debuggerWorkspaceBinding
8 * @param {!WebInspector.NetworkMapping} networkMapping 8 * @param {!WebInspector.NetworkMapping} networkMapping
9 * @implements {WebInspector.TargetManager.Observer} 9 * @implements {WebInspector.TargetManager.Observer}
10 */ 10 */
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 return debuggerModel.setBlackboxPatterns(patterns); 79 return debuggerModel.setBlackboxPatterns(patterns);
80 }, 80 },
81 81
82 /** 82 /**
83 * @param {!WebInspector.DebuggerModel.Location} location 83 * @param {!WebInspector.DebuggerModel.Location} location
84 * @return {boolean} 84 * @return {boolean}
85 */ 85 */
86 isBlackboxedRawLocation: function(location) 86 isBlackboxedRawLocation: function(location)
87 { 87 {
88 var positions = this._scriptPositions(location.script()); 88 var script = location.script();
89 if (!script)
90 return false;
91 var positions = this._scriptPositions(script);
89 if (!positions) 92 if (!positions)
90 return this._isBlackboxedScript(location.script()); 93 return this._isBlackboxedScript(script);
91 var index = positions.lowerBound(location, comparator); 94 var index = positions.lowerBound(location, comparator);
92 return !!(index % 2); 95 return !!(index % 2);
93 96
94 /** 97 /**
95 * @param {!WebInspector.DebuggerModel.Location} a 98 * @param {!WebInspector.DebuggerModel.Location} a
96 * @param {!DebuggerAgent.ScriptPosition} b 99 * @param {!DebuggerAgent.ScriptPosition} b
97 * @return {number} 100 * @return {number}
98 */ 101 */
99 function comparator(a, b) 102 function comparator(a, b)
100 { 103 {
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 if (scheme === "chrome-extension") 453 if (scheme === "chrome-extension")
451 prefix += parsedURL.host + "\\b"; 454 prefix += parsedURL.host + "\\b";
452 prefix += ".*"; 455 prefix += ".*";
453 } 456 }
454 return prefix + name.escapeForRegExp() + (url.endsWith(name) ? "$" : "\\ b"); 457 return prefix + name.escapeForRegExp() + (url.endsWith(name) ? "$" : "\\ b");
455 } 458 }
456 } 459 }
457 460
458 /** @type {!WebInspector.BlackboxManager} */ 461 /** @type {!WebInspector.BlackboxManager} */
459 WebInspector.blackboxManager; 462 WebInspector.blackboxManager;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698