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

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

Issue 2298473003: DevTools: do not leak memory through event listeners (Closed)
Patch Set: cleanup - some clients have being cleaning event listeners 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 | « no previous file | third_party/WebKit/Source/devtools/front_end/common/Object.js » ('j') | 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 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 var project = this._workspaceProject(frame, isContentScript); 393 var project = this._workspaceProject(frame, isContentScript);
394 var uiSourceCode = project.createUISourceCode(url, contentProvider.conte ntType()); 394 var uiSourceCode = project.createUISourceCode(url, contentProvider.conte ntType());
395 uiSourceCode[WebInspector.NetworkProject._targetSymbol] = this.target(); 395 uiSourceCode[WebInspector.NetworkProject._targetSymbol] = this.target();
396 return uiSourceCode; 396 return uiSourceCode;
397 }, 397 },
398 398
399 _dispose: function() 399 _dispose: function()
400 { 400 {
401 this._reset(); 401 this._reset();
402 WebInspector.EventTarget.removeEventListeners(this._eventListeners); 402 WebInspector.EventTarget.removeEventListeners(this._eventListeners);
403 this._eventListeners = [];
404 delete this.target()[WebInspector.NetworkProject._networkProjectSymbol]; 403 delete this.target()[WebInspector.NetworkProject._networkProjectSymbol];
405 }, 404 },
406 405
407 _reset: function() 406 _reset: function()
408 { 407 {
409 for (var project of this._workspaceProjects.values()) 408 for (var project of this._workspaceProjects.values())
410 project.reset(); 409 project.reset();
411 this._workspaceProjects.clear(); 410 this._workspaceProjects.clear();
412 }, 411 },
413 412
414 __proto__: WebInspector.SDKObject.prototype 413 __proto__: WebInspector.SDKObject.prototype
415 } 414 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/common/Object.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698