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

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

Issue 1688283002: [DevTools] Blackboxing in LiveLocations is supported in Linkifier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-source-map-support-v3
Patch Set: Created 4 years, 10 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 */ 9 */
10 WebInspector.BlackboxManager = function(debuggerWorkspaceBinding, networkMapping ) 10 WebInspector.BlackboxManager = function(debuggerWorkspaceBinding, networkMapping )
11 { 11 {
12 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding; 12 this._debuggerWorkspaceBinding = debuggerWorkspaceBinding;
13 this._networkMapping = networkMapping; 13 this._networkMapping = networkMapping;
14 14
15 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this ); 15 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this );
16 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.GlobalObjectCleared, this._globalObjectCleared, th is); 16 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI nspector.DebuggerModel.Events.GlobalObjectCleared, this._globalObjectCleared, th is);
17 WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(this. _patternChanged.bind(this)); 17 WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(this. _patternChanged.bind(this));
18 WebInspector.moduleSetting("skipContentScripts").addChangeListener(this._pat ternChanged.bind(this)); 18 WebInspector.moduleSetting("skipContentScripts").addChangeListener(this._pat ternChanged.bind(this));
19 19
20 /** @type {!Map<string, !Array<!DebuggerAgent.ScriptPosition>>} */ 20 /** @type {!Map<string, !Array<!DebuggerAgent.ScriptPosition>>} */
21 this._scripts = new Map(); 21 this._scripts = new Map();
22 /** @type {!Map<string, boolean>} */ 22 /** @type {!Map<string, boolean>} */
23 this._isBlackboxedURLCache = new Map(); 23 this._isBlackboxedURLCache = new Map();
24
25 /** @type {!Set<!WebInspector.DebuggerWorkspaceBinding.Location>} */
26 this._locations = new Set();
24 } 27 }
25 28
26 WebInspector.BlackboxManager.prototype = { 29 WebInspector.BlackboxManager.prototype = {
30 /**
31 * @param {!WebInspector.DebuggerWorkspaceBinding.Location} location
32 */
33 addLiveLocation: function(location)
34 {
35 this._locations.add(location);
36 },
37
38 /**
39 * @param {!WebInspector.DebuggerWorkspaceBinding.Location} location
40 */
41 removeLiveLocation: function(location)
42 {
43 this._locations.delete(location);
44 },
27 45
28 /** 46 /**
29 * @param {function(!WebInspector.Event)} listener 47 * @param {function(!WebInspector.Event)} listener
30 * @param {!Object=} thisObject 48 * @param {!Object=} thisObject
31 */ 49 */
32 addChangeListener: function(listener, thisObject) 50 addChangeListener: function(listener, thisObject)
33 { 51 {
34 WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(l istener, thisObject); 52 WebInspector.moduleSetting("skipStackFramesPattern").addChangeListener(l istener, thisObject);
35 }, 53 },
36 54
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 /** 310 /**
293 * @param {!WebInspector.Script} script 311 * @param {!WebInspector.Script} script
294 * @param {?Array<!DebuggerAgent.ScriptPosition>} positions 312 * @param {?Array<!DebuggerAgent.ScriptPosition>} positions
295 */ 313 */
296 _setScriptState: function(script, positions) 314 _setScriptState: function(script, positions)
297 { 315 {
298 if (positions) 316 if (positions)
299 this._scripts.set(script.scriptId, positions); 317 this._scripts.set(script.scriptId, positions);
300 else if (!this._scripts.has(script.scriptId)) 318 else if (!this._scripts.has(script.scriptId))
301 this._scripts.set(script.scriptId, []); 319 this._scripts.set(script.scriptId, []);
320
321 for (var location of this._locations) {
322 if (location.script().scriptId === script.scriptId)
323 location.update();
dgozman 2016/02/17 22:46:22 Let's check that DebuggerWorkspaceBinding already
kozy 2016/02/18 01:52:24 Done.
324 }
302 }, 325 },
303 326
304 /** 327 /**
305 * @param {string} url 328 * @param {string} url
306 * @return {string} 329 * @return {string}
307 */ 330 */
308 _urlToRegExpString: function(url) 331 _urlToRegExpString: function(url)
309 { 332 {
310 var parsedURL = new WebInspector.ParsedURL(url); 333 var parsedURL = new WebInspector.ParsedURL(url);
311 if (parsedURL.isAboutBlank() || parsedURL.isDataURL()) 334 if (parsedURL.isAboutBlank() || parsedURL.isDataURL())
(...skipping 16 matching lines...) Expand all
328 if (scheme === "chrome-extension") 351 if (scheme === "chrome-extension")
329 prefix += parsedURL.host + "\\b"; 352 prefix += parsedURL.host + "\\b";
330 prefix += ".*"; 353 prefix += ".*";
331 } 354 }
332 return prefix + name.escapeForRegExp() + (url.endsWith(name) ? "$" : "\\ b"); 355 return prefix + name.escapeForRegExp() + (url.endsWith(name) ? "$" : "\\ b");
333 } 356 }
334 } 357 }
335 358
336 /** @type {!WebInspector.BlackboxManager} */ 359 /** @type {!WebInspector.BlackboxManager} */
337 WebInspector.blackboxManager; 360 WebInspector.blackboxManager;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698