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

Unified Diff: extensions/renderer/messaging_bindings.cc

Issue 709933002: Add frameId to MessageSender (extension messaging API) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Generate frameId in browser 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/messaging_bindings.cc
diff --git a/extensions/renderer/messaging_bindings.cc b/extensions/renderer/messaging_bindings.cc
index e7014fa895962a5fd09946c29bda777cb297d147..9721a70c208bc179b6069ea3d86b525d8dd9277c 100644
--- a/extensions/renderer/messaging_bindings.cc
+++ b/extensions/renderer/messaging_bindings.cc
@@ -240,7 +240,7 @@ class ExtensionImpl : public ObjectBackedNativeHandler {
void DispatchOnConnectToScriptContext(
int target_port_id,
const std::string& channel_name,
- const base::DictionaryValue* source_tab,
+ const ExtensionMsg_TabConnectionInfo& source,
const ExtensionMsg_ExternalConnectionInfo& info,
const std::string& tls_channel_id,
bool* port_created,
@@ -258,8 +258,8 @@ void DispatchOnConnectToScriptContext(
v8::Handle<v8::Value> tls_channel_id_value = v8::Undefined(isolate);
if (extension) {
- if (!source_tab->empty() && !extension->is_platform_app())
- tab = converter->ToV8Value(source_tab, script_context->v8_context());
+ if (!source.tab->empty() && !extension->is_platform_app())
+ tab = converter->ToV8Value(source.tab, script_context->v8_context());
ExternallyConnectableInfo* externally_connectable =
ExternallyConnectableInfo::Get(extension);
@@ -282,6 +282,8 @@ void DispatchOnConnectToScriptContext(
channel_name.size()),
// sourceTab
tab,
+ // source_frame_id
+ v8::Integer::New(isolate, source.frame_id),
// sourceExtensionId
v8::String::NewFromUtf8(isolate,
info.source_id.c_str(),
@@ -372,7 +374,7 @@ void MessagingBindings::DispatchOnConnect(
const ScriptContextSet& context_set,
int target_port_id,
const std::string& channel_name,
- const base::DictionaryValue& source_tab,
+ const ExtensionMsg_TabConnectionInfo& source,
const ExtensionMsg_ExternalConnectionInfo& info,
const std::string& tls_channel_id,
content::RenderView* restrict_to_render_view) {
@@ -382,7 +384,7 @@ void MessagingBindings::DispatchOnConnect(
base::Bind(&DispatchOnConnectToScriptContext,
target_port_id,
channel_name,
- &source_tab,
+ &source,
info,
tls_channel_id,
&port_created));

Powered by Google App Engine
This is Rietveld 408576698