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

Side by Side Diff: Source/devtools/front_end/BreakpointManager.js

Issue 220903002: DevTools: wrap DebuggerAgent.Location with DebuggerModel.Location. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: All tests!!! Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 uiSourceCode: function() 480 uiSourceCode: function()
481 { 481 {
482 return this._breakpointManager._workspace.uiSourceCode(this._projectId, this._path); 482 return this._breakpointManager._workspace.uiSourceCode(this._projectId, this._path);
483 }, 483 },
484 484
485 /** 485 /**
486 * @param {!WebInspector.DebuggerModel.Location} location 486 * @param {!WebInspector.DebuggerModel.Location} location
487 */ 487 */
488 _addResolvedLocation: function(location) 488 _addResolvedLocation: function(location)
489 { 489 {
490 this._liveLocations.push(this._breakpointManager._debuggerModel.createLi veLocation(location, this._locationUpdated.bind(this, location))); 490 this._liveLocations.push(location.createLiveLocation(this._locationUpdat ed.bind(this, location)));
491 }, 491 },
492 492
493 /** 493 /**
494 * @param {!WebInspector.DebuggerModel.Location} location 494 * @param {!WebInspector.DebuggerModel.Location} location
495 * @param {!WebInspector.UILocation} uiLocation 495 * @param {!WebInspector.UILocation} uiLocation
496 */ 496 */
497 _locationUpdated: function(location, uiLocation) 497 _locationUpdated: function(location, uiLocation)
498 { 498 {
499 var stringifiedLocation = location.scriptId + ":" + location.lineNumber + ":" + location.columnNumber; 499 var stringifiedLocation = location.scriptId + ":" + location.lineNumber + ":" + location.columnNumber;
500 var oldUILocation = /** @type {!WebInspector.UILocation} */ (this._uiLoc ations[stringifiedLocation]); 500 var oldUILocation = /** @type {!WebInspector.UILocation} */ (this._uiLoc ations[stringifiedLocation]);
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 this._debuggerId = breakpointId; 607 this._debuggerId = breakpointId;
608 this._breakpointManager._breakpointForDebuggerId[breakpointId] = this; 608 this._breakpointManager._breakpointForDebuggerId[breakpointId] = this;
609 609
610 if (!locations.length) { 610 if (!locations.length) {
611 this._fakeBreakpointAtPrimaryLocation(); 611 this._fakeBreakpointAtPrimaryLocation();
612 return; 612 return;
613 } 613 }
614 614
615 this._resetLocations(); 615 this._resetLocations();
616 for (var i = 0; i < locations.length; ++i) { 616 for (var i = 0; i < locations.length; ++i) {
617 var script = this._breakpointManager._debuggerModel.scriptForId(loca tions[i].scriptId); 617 var script = locations[i].script();
618 var uiLocation = script.rawLocationToUILocation(locations[i].lineNum ber, locations[i].columnNumber); 618 var uiLocation = script.rawLocationToUILocation(locations[i].lineNum ber, locations[i].columnNumber);
619 if (this._breakpointManager.findBreakpoint(uiLocation.uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber)) { 619 if (this._breakpointManager.findBreakpoint(uiLocation.uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber)) {
620 // location clash 620 // location clash
621 this.remove(); 621 this.remove();
622 return; 622 return;
623 } 623 }
624 } 624 }
625 625
626 for (var i = 0; i < locations.length; ++i) 626 for (var i = 0; i < locations.length; ++i)
627 this._addResolvedLocation(locations[i]); 627 this._addResolvedLocation(locations[i]);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 { 755 {
756 this.sourceFileId = breakpoint._sourceFileId; 756 this.sourceFileId = breakpoint._sourceFileId;
757 this.lineNumber = breakpoint.lineNumber(); 757 this.lineNumber = breakpoint.lineNumber();
758 this.columnNumber = breakpoint.columnNumber(); 758 this.columnNumber = breakpoint.columnNumber();
759 this.condition = breakpoint.condition(); 759 this.condition = breakpoint.condition();
760 this.enabled = breakpoint.enabled(); 760 this.enabled = breakpoint.enabled();
761 } 761 }
762 762
763 /** @type {!WebInspector.BreakpointManager} */ 763 /** @type {!WebInspector.BreakpointManager} */
764 WebInspector.breakpointManager; 764 WebInspector.breakpointManager;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698