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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/workspace/IsolatedFileSystemManager.js

Issue 2290323003: DevTools: use eventListener arrays to avoid memory leaks in dispose methods (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.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 /* 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 var requestId = /** @type {number} */ (event.data["requestId"]); 349 var requestId = /** @type {number} */ (event.data["requestId"]);
350 var files = /** @type {!Array.<string>} */ (event.data["files"]); 350 var files = /** @type {!Array.<string>} */ (event.data["files"]);
351 351
352 var callback = this._callbacks.get(requestId); 352 var callback = this._callbacks.get(requestId);
353 if (!callback) 353 if (!callback)
354 return; 354 return;
355 callback.call(null, files); 355 callback.call(null, files);
356 this._callbacks.delete(requestId); 356 this._callbacks.delete(requestId);
357 }, 357 },
358 358
359 dispose: function()
360 {
361 InspectorFrontendHost.events.removeEventListener(InspectorFrontendHostAP I.Events.IndexingTotalWorkCalculated, this._onIndexingTotalWorkCalculated, this) ;
362 InspectorFrontendHost.events.removeEventListener(InspectorFrontendHostAP I.Events.IndexingWorked, this._onIndexingWorked, this);
363 InspectorFrontendHost.events.removeEventListener(InspectorFrontendHostAP I.Events.IndexingDone, this._onIndexingDone, this);
364 InspectorFrontendHost.events.removeEventListener(InspectorFrontendHostAP I.Events.SearchCompleted, this._onSearchCompleted, this);
365 },
366
367 __proto__: WebInspector.Object.prototype 359 __proto__: WebInspector.Object.prototype
368 } 360 }
369 361
370 /** 362 /**
371 * @type {!WebInspector.IsolatedFileSystemManager} 363 * @type {!WebInspector.IsolatedFileSystemManager}
372 */ 364 */
373 WebInspector.isolatedFileSystemManager; 365 WebInspector.isolatedFileSystemManager;
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/bindings/NetworkMapping.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698