summaryrefslogtreecommitdiffstats
path: root/extensions/common/extension_messages.h
diff options
context:
space:
mode:
authorkalman <kalman@chromium.org>2015-08-28 10:40:36 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-28 17:41:26 +0000
commit1344c7dfde448d4b80693f597b02993b7f6bbd5b (patch)
tree8510ed47d1de5c65cf99d44f08cc76dcef0ae163 /extensions/common/extension_messages.h
parentfba7c7dbf2f19d701cbe5fa97ff2ce29b10e9f91 (diff)
downloadchromium_src-1344c7dfde448d4b80693f597b02993b7f6bbd5b.zip
chromium_src-1344c7dfde448d4b80693f597b02993b7f6bbd5b.tar.gz
chromium_src-1344c7dfde448d4b80693f597b02993b7f6bbd5b.tar.bz2
Check the tab ID before delivering an extension message.
r335753 changed extension messaging to use RenderFrames, which had the side-effect of delivering messages to every RenderFrame in a process, which may include other tabs. This patch fixes that by sending the target tab ID along with the message. A more principled fix would have been to track RenderFrames on the browser and send to precisely the right ones, but this would need to be part of a more comprehensive refactor. I also fixed up ExtensionApiTest.Connect and re-enabled, which was disabled years ago due to flakiness. Hopefully my test JS changes will fix that. BUG=520303 R=rdevlin.cronin@chromium.org, dcheng@chromium.org Review URL: https://codereview.chromium.org/1318153002 Cr-Commit-Position: refs/heads/master@{#346176}
Diffstat (limited to 'extensions/common/extension_messages.h')
-rw-r--r--extensions/common/extension_messages.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/extensions/common/extension_messages.h b/extensions/common/extension_messages.h
index d799781..462ef36 100644
--- a/extensions/common/extension_messages.h
+++ b/extensions/common/extension_messages.h
@@ -180,7 +180,12 @@ IPC_STRUCT_BEGIN(ExtensionMsg_ExternalConnectionInfo)
// The URL of the frame that initiated the request.
IPC_STRUCT_MEMBER(GURL, source_url)
- // The ID of the frame that is the target of the request.
+ // The ID of the tab that is the target of the request, or -1 if there is no
+ // target tab.
+ IPC_STRUCT_MEMBER(int, target_tab_id)
+
+ // The ID of the frame that is the target of the request, or -1 if there is
+ // no target frame (implying the message is for all frames).
IPC_STRUCT_MEMBER(int, target_frame_id)
// The process ID of the webview that initiated the request.