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

Side by Side Diff: Source/devtools/front_end/sources/AsyncOperationsSidebarPane.js

Issue 943963002: DevTools: Refactor nits in DebuggerModel event dispatching. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/sdk/DebuggerModel.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 * @extends {WebInspector.NativeBreakpointsSidebarPane} 7 * @extends {WebInspector.NativeBreakpointsSidebarPane}
8 * @implements {WebInspector.TargetManager.Observer} 8 * @implements {WebInspector.TargetManager.Observer}
9 */ 9 */
10 WebInspector.AsyncOperationsSidebarPane = function() 10 WebInspector.AsyncOperationsSidebarPane = function()
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 this.expand(); 173 this.expand();
174 if (this._target) 174 if (this._target)
175 this._target.debuggerAgent().flushAsyncOperationEvents(); 175 this._target.debuggerAgent().flushAsyncOperationEvents();
176 }, 176 },
177 177
178 /** 178 /**
179 * @param {!WebInspector.Event} event 179 * @param {!WebInspector.Event} event
180 */ 180 */
181 _onAsyncOperationStarted: function(event) 181 _onAsyncOperationStarted: function(event)
182 { 182 {
183 var target = /** @type {!WebInspector.Target} */ (event.data.target); 183 var target = /** @type {!WebInspector.Target} */ (event.target.target()) ;
184 var operation = /** @type {!DebuggerAgent.AsyncOperation} */ (event.data .operation); 184 var operation = /** @type {!DebuggerAgent.AsyncOperation} */ (event.data );
185 185
186 var operationsMap = this._asyncOperationsByTarget.get(target); 186 var operationsMap = this._asyncOperationsByTarget.get(target);
187 if (!operationsMap) { 187 if (!operationsMap) {
188 operationsMap = new Map(); 188 operationsMap = new Map();
189 this._asyncOperationsByTarget.set(target, operationsMap) 189 this._asyncOperationsByTarget.set(target, operationsMap)
190 } 190 }
191 operationsMap.set(operation.id, operation); 191 operationsMap.set(operation.id, operation);
192 192
193 if (this._target === target) 193 if (this._target === target)
194 this._createAsyncOperationItem(operation); 194 this._createAsyncOperationItem(operation);
195 }, 195 },
196 196
197 /** 197 /**
198 * @param {!WebInspector.Event} event 198 * @param {!WebInspector.Event} event
199 */ 199 */
200 _onAsyncOperationCompleted: function(event) 200 _onAsyncOperationCompleted: function(event)
201 { 201 {
202 var target = /** @type {!WebInspector.Target} */ (event.data.target); 202 var target = /** @type {!WebInspector.Target} */ (event.target.target()) ;
203 var operationId = /** @type {number} */ (event.data.operationId); 203 var operationId = /** @type {number} */ (event.data);
204 204
205 var operationsMap = this._asyncOperationsByTarget.get(target); 205 var operationsMap = this._asyncOperationsByTarget.get(target);
206 if (operationsMap) 206 if (operationsMap)
207 operationsMap.delete(operationId); 207 operationsMap.delete(operationId);
208 208
209 if (this._target === target) { 209 if (this._target === target) {
210 var element = this._operationIdToElement.get(operationId); 210 var element = this._operationIdToElement.get(operationId);
211 if (element) 211 if (element)
212 this.removeListElement(element); 212 this.removeListElement(element);
213 this._operationIdToElement.delete(operationId); 213 this._operationIdToElement.delete(operationId);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 return null; 308 return null;
309 var operationId = anchor[WebInspector.AsyncOperationsSidebarPane._operat ionIdSymbol]; 309 var operationId = anchor[WebInspector.AsyncOperationsSidebarPane._operat ionIdSymbol];
310 var operation = operationId && asyncOperations.get(operationId); 310 var operation = operationId && asyncOperations.get(operationId);
311 if (!operation || !operation.stackTrace) 311 if (!operation || !operation.stackTrace)
312 return null; 312 return null;
313 return operation; 313 return operation;
314 }, 314 },
315 315
316 __proto__: WebInspector.NativeBreakpointsSidebarPane.prototype 316 __proto__: WebInspector.NativeBreakpointsSidebarPane.prototype
317 } 317 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/DebuggerModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698