summaryrefslogtreecommitdiffstats
path: root/extensions/renderer/messaging_bindings.cc
diff options
context:
space:
mode:
authorrdevlin.cronin <rdevlin.cronin@chromium.org>2015-10-05 17:58:18 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-06 00:59:16 +0000
commitb05a80f5990c45717e61ab14f40992146cdd4b96 (patch)
tree92e6b1602fe0f5efb2cfe719e6c3ae79ecad266e /extensions/renderer/messaging_bindings.cc
parentbd4d66ea87a1fa3b41cbf5b73661e5b74928a3a4 (diff)
downloadchromium_src-b05a80f5990c45717e61ab14f40992146cdd4b96.zip
chromium_src-b05a80f5990c45717e61ab14f40992146cdd4b96.tar.gz
chromium_src-b05a80f5990c45717e61ab14f40992146cdd4b96.tar.bz2
Revert "Revert of Check the tab ID before delivering an extension message."
This reverts commit 0e66d57071b66863773249452c49384cff83b9ac. commit 0e66d57071b66863773249452c49384cff83b9ac reverted commit 1344c7dfde448d4b80693f597b02993b7f6bbd5b because stable bots didn't compile. But 1344c7dfde448d4b80693f597b02993b7f6bbd5b was the commit on trunk. End result was that M45 and M46 got the fix, and M47 doesn't have it anymore. Resubmit. Original CL: https://codereview.chromium.org/1318153002 BUG=520303 TBR=kalman@chromium.org TBR=dcheng@chromium.org Review URL: https://codereview.chromium.org/1386913002 Cr-Commit-Position: refs/heads/master@{#352497}
Diffstat (limited to 'extensions/renderer/messaging_bindings.cc')
-rw-r--r--extensions/renderer/messaging_bindings.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/extensions/renderer/messaging_bindings.cc b/extensions/renderer/messaging_bindings.cc
index 1e0f6e2..777f24f 100644
--- a/extensions/renderer/messaging_bindings.cc
+++ b/extensions/renderer/messaging_bindings.cc
@@ -25,6 +25,7 @@
#include "extensions/common/manifest_handlers/externally_connectable.h"
#include "extensions/renderer/dispatcher.h"
#include "extensions/renderer/event_bindings.h"
+#include "extensions/renderer/extension_frame_helper.h"
#include "extensions/renderer/gc_callback.h"
#include "extensions/renderer/object_backed_native_handler.h"
#include "extensions/renderer/script_context.h"
@@ -291,6 +292,15 @@ void DispatchOnConnectToScriptContext(
if (info.target_frame_id > 0 &&
renderframe->GetRoutingID() != info.target_frame_id)
return;
+
+ // Bandaid fix for crbug.com/520303.
+ // TODO(rdevlin.cronin): Fix this properly by routing messages to the correct
+ // RenderFrame from the browser (same with |target_frame_id| in fact).
+ if (info.target_tab_id != -1 &&
+ info.target_tab_id != ExtensionFrameHelper::Get(renderframe)->tab_id()) {
+ return;
+ }
+
v8::Isolate* isolate = script_context->isolate();
v8::HandleScope handle_scope(isolate);