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

Unified Diff: extensions/renderer/runtime_custom_bindings.cc

Issue 709933002: Add frameId to MessageSender (extension messaging API) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test that tests for a non-negative frameId Created 6 years, 1 month 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
Index: extensions/renderer/runtime_custom_bindings.cc
diff --git a/extensions/renderer/runtime_custom_bindings.cc b/extensions/renderer/runtime_custom_bindings.cc
index fb6851e0f5392a82a0c02963478ccd1a79703480..159adca031a4825c888e50911103406fce7d9d28 100644
--- a/extensions/renderer/runtime_custom_bindings.cc
+++ b/extensions/renderer/runtime_custom_bindings.cc
@@ -58,6 +58,11 @@ void RuntimeCustomBindings::OpenChannelToExtension(
ExtensionMsg_ExternalConnectionInfo info;
+ if (blink::WebFrame* webframe = context()->web_frame())
+ info.source_frame_id = !webframe->parent() ? 0 : renderview->GetRoutingID();
+ else
+ info.source_frame_id = -1;
not at google - send to devlin 2014/11/10 18:36:42 You should be able to determine this on the browse
robwu 2014/11/10 21:43:07 I need to know whether the request originated from
not at google - send to devlin 2014/11/10 22:20:17 I'm not totally sure what you mean here, but the b
robwu 2014/11/10 23:13:38 Updated CL. I've added a new IPC message Extension
+
// For messaging APIs, hosted apps should be considered a web page so hide
// its extension ID.
const Extension* extension = context()->extension();
« extensions/renderer/resources/messaging.js ('K') | « extensions/renderer/resources/messaging.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698