Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ext/common.js

Issue 6751260996796416: Issue 1724 - Fixed memory leak in messaging code, when no response is sent, on Safari (Closed)
Patch Set: Prevent the request payload from being sent back with fallback responses Created Jan. 8, 2015, 3:57 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/ext/background.js ('k') | safari/ext/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ext/common.js
===================================================================
--- a/ext/common.js
+++ b/ext/common.js
@@ -20,10 +20,9 @@
{
window.ext = {};
- var EventTarget = ext._EventTarget = function(cancelable)
+ var EventTarget = ext._EventTarget = function()
{
this._listeners = [];
- this._cancelable = cancelable;
};
EventTarget.prototype = {
addListener: function(listener)
@@ -39,17 +38,12 @@
},
_dispatch: function()
{
- var result = null;
+ var results = [];
for (var i = 0; i < this._listeners.length; i++)
- {
- result = this._listeners[i].apply(null, arguments);
+ results.push(this._listeners[i].apply(null, arguments));
- if (this._cancelable && result === false)
- break;
- }
-
- return result;
+ return results;
}
};
})();
« no previous file with comments | « chrome/ext/background.js ('k') | safari/ext/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld