OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 this._boundUISourceCodes = new Set(); | 46 this._boundUISourceCodes = new Set(); |
47 | 47 |
48 /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.ResourceScriptFil
e>} */ | 48 /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.ResourceScriptFil
e>} */ |
49 this._uiSourceCodeToScriptFile = new Map(); | 49 this._uiSourceCodeToScriptFile = new Map(); |
50 | 50 |
51 this._eventListeners = [ | 51 this._eventListeners = [ |
52 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalO
bjectCleared, this._debuggerReset, this), | 52 debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.GlobalO
bjectCleared, this._debuggerReset, this), |
53 workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdd
ed, this._uiSourceCodeAdded, this), | 53 workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeAdd
ed, this._uiSourceCodeAdded, this), |
54 workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRem
oved, this._uiSourceCodeRemoved, this) | 54 workspace.addEventListener(WebInspector.Workspace.Events.UISourceCodeRem
oved, this._uiSourceCodeRemoved, this) |
55 ]; | 55 ]; |
56 } | 56 }; |
57 | 57 |
58 WebInspector.ResourceScriptMapping.prototype = { | 58 WebInspector.ResourceScriptMapping.prototype = { |
59 /** | 59 /** |
60 * @override | 60 * @override |
61 * @param {!WebInspector.DebuggerModel.Location} rawLocation | 61 * @param {!WebInspector.DebuggerModel.Location} rawLocation |
62 * @return {?WebInspector.UILocation} | 62 * @return {?WebInspector.UILocation} |
63 */ | 63 */ |
64 rawLocationToUILocation: function(rawLocation) | 64 rawLocationToUILocation: function(rawLocation) |
65 { | 65 { |
66 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat
ion} */ (rawLocation); | 66 var debuggerModelLocation = /** @type {!WebInspector.DebuggerModel.Locat
ion} */ (rawLocation); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 this._unbindUISourceCode(uiSourceCode); | 257 this._unbindUISourceCode(uiSourceCode); |
258 this._boundUISourceCodes.clear(); | 258 this._boundUISourceCodes.clear(); |
259 console.assert(!this._uiSourceCodeToScriptFile.size); | 259 console.assert(!this._uiSourceCodeToScriptFile.size); |
260 }, | 260 }, |
261 | 261 |
262 dispose: function() | 262 dispose: function() |
263 { | 263 { |
264 WebInspector.EventTarget.removeEventListeners(this._eventListeners); | 264 WebInspector.EventTarget.removeEventListeners(this._eventListeners); |
265 this._debuggerReset(); | 265 this._debuggerReset(); |
266 } | 266 } |
267 } | 267 }; |
268 | 268 |
269 /** | 269 /** |
270 * @constructor | 270 * @constructor |
271 * @extends {WebInspector.Object} | 271 * @extends {WebInspector.Object} |
272 * @param {!WebInspector.ResourceScriptMapping} resourceScriptMapping | 272 * @param {!WebInspector.ResourceScriptMapping} resourceScriptMapping |
273 * @param {!WebInspector.UISourceCode} uiSourceCode | 273 * @param {!WebInspector.UISourceCode} uiSourceCode |
274 * @param {!Array.<!WebInspector.Script>} scripts | 274 * @param {!Array.<!WebInspector.Script>} scripts |
275 */ | 275 */ |
276 WebInspector.ResourceScriptFile = function(resourceScriptMapping, uiSourceCode,
scripts) | 276 WebInspector.ResourceScriptFile = function(resourceScriptMapping, uiSourceCode,
scripts) |
277 { | 277 { |
278 console.assert(scripts.length); | 278 console.assert(scripts.length); |
279 | 279 |
280 this._resourceScriptMapping = resourceScriptMapping; | 280 this._resourceScriptMapping = resourceScriptMapping; |
281 this._uiSourceCode = uiSourceCode; | 281 this._uiSourceCode = uiSourceCode; |
282 | 282 |
283 if (this._uiSourceCode.contentType().isScript()) | 283 if (this._uiSourceCode.contentType().isScript()) |
284 this._script = scripts[scripts.length - 1]; | 284 this._script = scripts[scripts.length - 1]; |
285 | 285 |
286 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working
CopyChanged, this._workingCopyChanged, this); | 286 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working
CopyChanged, this._workingCopyChanged, this); |
287 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working
CopyCommitted, this._workingCopyCommitted, this); | 287 this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.Working
CopyCommitted, this._workingCopyCommitted, this); |
288 } | 288 }; |
289 | 289 |
290 /** @enum {symbol} */ | 290 /** @enum {symbol} */ |
291 WebInspector.ResourceScriptFile.Events = { | 291 WebInspector.ResourceScriptFile.Events = { |
292 DidMergeToVM: Symbol("DidMergeToVM"), | 292 DidMergeToVM: Symbol("DidMergeToVM"), |
293 DidDivergeFromVM: Symbol("DidDivergeFromVM"), | 293 DidDivergeFromVM: Symbol("DidDivergeFromVM"), |
294 } | 294 }; |
295 | 295 |
296 WebInspector.ResourceScriptFile.prototype = { | 296 WebInspector.ResourceScriptFile.prototype = { |
297 /** | 297 /** |
298 * @param {!Array.<!WebInspector.Script>} scripts | 298 * @param {!Array.<!WebInspector.Script>} scripts |
299 * @return {boolean} | 299 * @return {boolean} |
300 */ | 300 */ |
301 _hasScripts: function(scripts) | 301 _hasScripts: function(scripts) |
302 { | 302 { |
303 return this._script && this._script === scripts[0]; | 303 return this._script && this._script === scripts[0]; |
304 }, | 304 }, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 /** | 464 /** |
465 * @return {boolean} | 465 * @return {boolean} |
466 */ | 466 */ |
467 hasSourceMapURL: function() | 467 hasSourceMapURL: function() |
468 { | 468 { |
469 return this._script && !!this._script.sourceMapURL; | 469 return this._script && !!this._script.sourceMapURL; |
470 }, | 470 }, |
471 | 471 |
472 __proto__: WebInspector.Object.prototype | 472 __proto__: WebInspector.Object.prototype |
473 } | 473 }; |
OLD | NEW |