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

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

Issue 2522753002: DevTools: [Persistence] properly copy breakpoints to filesystem during reload (Closed)
Patch Set: fix test 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 /* 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 * @return {!Map.<string, !Bindings.BreakpointManager.Breakpoint>} 94 * @return {!Map.<string, !Bindings.BreakpointManager.Breakpoint>}
95 */ 95 */
96 _provisionalBreakpointsForURL(url) { 96 _provisionalBreakpointsForURL(url) {
97 var result = new Map(); 97 var result = new Map();
98 var breakpoints = this._provisionalBreakpoints.get(url).valuesArray(); 98 var breakpoints = this._provisionalBreakpoints.get(url).valuesArray();
99 for (var i = 0; i < breakpoints.length; ++i) 99 for (var i = 0; i < breakpoints.length; ++i)
100 result.set(breakpoints[i]._breakpointStorageId(), breakpoints[i]); 100 result.set(breakpoints[i]._breakpointStorageId(), breakpoints[i]);
101 return result; 101 return result;
102 } 102 }
103 103
104 /**
105 * @param {string} fromURL
106 * @param {!Workspace.UISourceCode} toSourceCode
107 */
108 copyBreakpoints(fromURL, toSourceCode) {
109 var breakpointItems = this._storage.breakpointItems(fromURL);
110 for (var item of breakpointItems)
111 this.setBreakpoint(toSourceCode, item.lineNumber, item.columnNumber, item. condition, item.enabled);
112 }
113
104 removeProvisionalBreakpointsForTest() { 114 removeProvisionalBreakpointsForTest() {
105 var breakpoints = this._provisionalBreakpoints.valuesArray(); 115 var breakpoints = this._provisionalBreakpoints.valuesArray();
106 for (var i = 0; i < breakpoints.length; ++i) 116 for (var i = 0; i < breakpoints.length; ++i)
107 breakpoints[i].remove(); 117 breakpoints[i].remove();
108 this._provisionalBreakpoints.clear(); 118 this._provisionalBreakpoints.clear();
109 } 119 }
110 120
111 /** 121 /**
112 * @param {!Workspace.UISourceCode} uiSourceCode 122 * @param {!Workspace.UISourceCode} uiSourceCode
113 */ 123 */
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 this.url = breakpoint._url; 1088 this.url = breakpoint._url;
1079 this.lineNumber = breakpoint.lineNumber(); 1089 this.lineNumber = breakpoint.lineNumber();
1080 this.columnNumber = breakpoint.columnNumber(); 1090 this.columnNumber = breakpoint.columnNumber();
1081 this.condition = breakpoint.condition(); 1091 this.condition = breakpoint.condition();
1082 this.enabled = breakpoint.enabled(); 1092 this.enabled = breakpoint.enabled();
1083 } 1093 }
1084 }; 1094 };
1085 1095
1086 /** @type {!Bindings.BreakpointManager} */ 1096 /** @type {!Bindings.BreakpointManager} */
1087 Bindings.breakpointManager; 1097 Bindings.breakpointManager;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698