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

Unified Diff: extensions/renderer/resources/messaging.js

Issue 1178273004: Move Extension messaging port release functionality from JS to C++. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « extensions/renderer/messaging_bindings.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/resources/messaging.js
diff --git a/extensions/renderer/resources/messaging.js b/extensions/renderer/resources/messaging.js
index e39795bdc0b1f00c4c8ec640ed7f2ed60a1d6dcf..c262222cda8a28b9e8b24de17d4d0e7946684c16 100644
--- a/extensions/renderer/resources/messaging.js
+++ b/extensions/renderer/resources/messaging.js
@@ -12,7 +12,6 @@
var logging = requireNative('logging');
var messagingNatives = requireNative('messaging_natives');
var processNatives = requireNative('process');
- var unloadEvent = require('unload_event');
var utils = require('utils');
var messagingUtils = require('messaging_utils');
@@ -25,10 +24,6 @@
// Map of port IDs to port object.
var ports = {};
- // Map of port IDs to unloadEvent listeners. Keep track of these to free the
- // unloadEvent listeners when ports are closed.
- var portReleasers = {};
-
// Change even to odd and vice versa, to get the other side of a given
// channel.
function getOppositePortId(portId) { return portId ^ 1; }
@@ -85,10 +80,7 @@
privates(this.onMessage).impl.destroy_();
messagingNatives.PortRelease(portId);
- unloadEvent.removeListener(portReleasers[portId]);
-
delete ports[portId];
- delete portReleasers[portId];
};
// Returns true if the specified port id is in this context. This is used by
@@ -105,10 +97,6 @@
throw new Error("Port '" + portId + "' already exists.");
var port = new Port(portId, opt_name);
ports[portId] = port;
- portReleasers[portId] = $Function.bind(messagingNatives.PortRelease,
- this,
- portId);
- unloadEvent.addListener(portReleasers[portId]);
messagingNatives.PortAddRef(portId);
return port;
};
« no previous file with comments | « extensions/renderer/messaging_bindings.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698