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

Unified Diff: chrome/renderer/extensions/runtime_custom_bindings.cc

Issue 23057005: In extension messaging, use the sender frame's URL as the sender URL rather (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add test, rebase Created 7 years, 4 months 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: chrome/renderer/extensions/runtime_custom_bindings.cc
diff --git a/chrome/renderer/extensions/runtime_custom_bindings.cc b/chrome/renderer/extensions/runtime_custom_bindings.cc
index 4f364a36746849504981349c69c9e9300206b383..77b69ff618c14c36f6e90637d6f71e11c2158466 100644
--- a/chrome/renderer/extensions/runtime_custom_bindings.cc
+++ b/chrome/renderer/extensions/runtime_custom_bindings.cc
@@ -54,9 +54,9 @@ void RuntimeCustomBindings::OpenChannelToExtension(
CHECK(args[0]->IsString() && args[1]->IsString());
ExtensionMsg_ExternalConnectionInfo info;
- info.source_id = context()->extension() ? context()->extension()->id() : "";
+ info.source_id = context()->GetExtensionID();
info.target_id = *v8::String::Utf8Value(args[0]->ToString());
- info.source_url = renderview->GetWebView()->mainFrame()->document().url();
+ info.source_url = context()->GetURL();
std::string channel_name = *v8::String::Utf8Value(args[1]->ToString());
int port_id = -1;
renderview->Send(new ExtensionHostMsg_OpenChannelToExtension(

Powered by Google App Engine
This is Rietveld 408576698