summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/resources
diff options
context:
space:
mode:
authorDaniel Cheng <dcheng@chromium.org>2015-09-30 14:45:46 -0700
committerDaniel Cheng <dcheng@chromium.org>2015-09-30 21:47:48 +0000
commit903635bf1019b89a110610872d78d635a779cbce (patch)
treee88f51ffe7f0f9a353824e64ac910db1d38ce624 /extensions/renderer/resources
parente2b7a5cfd4cedb4a1ac35ec1680df51cf36f4601 (diff)
downloadchromium_src-903635bf1019b89a110610872d78d635a779cbce.zip
chromium_src-903635bf1019b89a110610872d78d635a779cbce.tar.gz
chromium_src-903635bf1019b89a110610872d78d635a779cbce.tar.bz2
[extensions] Remove custom binding dependency on unload_event.js.
BUG=537666 R=rdevlin.cronin@chromium.org Review URL: https://codereview.chromium.org/1380833002 . Cr-Commit-Position: refs/heads/master@{#351650}
Diffstat (limited to 'extensions/renderer/resources')
-rw-r--r--extensions/renderer/resources/runtime_custom_bindings.js16
1 files changed, 4 insertions, 12 deletions
diff --git a/extensions/renderer/resources/runtime_custom_bindings.js b/extensions/renderer/resources/runtime_custom_bindings.js
index 4e4a71d..2b0e44a 100644
--- a/extensions/renderer/resources/runtime_custom_bindings.js
+++ b/extensions/renderer/resources/runtime_custom_bindings.js
@@ -8,7 +8,6 @@ var binding = require('binding').Binding.create('runtime');
var messaging = require('messaging');
var runtimeNatives = requireNative('runtime');
-var unloadEvent = require('unload_event');
var process = requireNative('process');
var forEach = require('utils').forEach;
@@ -153,11 +152,6 @@ binding.registerCustomHook(function(binding, id, contextType) {
});
apiFunctions.setHandleRequest('connect', function(targetId, connectInfo) {
- // Don't let orphaned content scripts communicate with their extension.
- // http://crbug.com/168263
- if (unloadEvent.wasDispatched)
- throw new Error('Error connecting to extension ' + targetId);
-
if (!targetId) {
// runtime.id is only defined inside extensions. If we're in a webpage,
// the best we can do at this point is to fail.
@@ -190,12 +184,10 @@ binding.registerCustomHook(function(binding, id, contextType) {
apiFunctions.setHandleRequest('connectNative',
function(nativeAppName) {
- if (!unloadEvent.wasDispatched) {
- var portId = runtimeNatives.OpenChannelToNativeApp(runtime.id,
- nativeAppName);
- if (portId >= 0)
- return messaging.createPort(portId, '');
- }
+ var portId = runtimeNatives.OpenChannelToNativeApp(runtime.id,
+ nativeAppName);
+ if (portId >= 0)
+ return messaging.createPort(portId, '');
throw new Error('Error connecting to native app: ' + nativeAppName);
});