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

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: test: sender.tab.status = 'complete' 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
« no previous file with comments | « extensions/renderer/resources/messaging.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fc3297cdf13726ae74e82b4bde005d1e14a41b9e 100644
--- a/extensions/renderer/runtime_custom_bindings.cc
+++ b/extensions/renderer/runtime_custom_bindings.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
+#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_view.h"
#include "content/public/renderer/v8_value_converter.h"
#include "extensions/common/extension.h"
@@ -46,10 +47,10 @@ RuntimeCustomBindings::~RuntimeCustomBindings() {
void RuntimeCustomBindings::OpenChannelToExtension(
const v8::FunctionCallbackInfo<v8::Value>& args) {
- // Get the current RenderView so that we can send a routed IPC message from
+ // Get the current RenderFrame so that we can send a routed IPC message from
// the correct source.
- content::RenderView* renderview = context()->GetRenderView();
- if (!renderview)
+ content::RenderFrame* renderframe = context()->GetRenderFrame();
+ if (!renderframe)
return;
// The Javascript code should validate/fill the arguments.
@@ -70,12 +71,9 @@ void RuntimeCustomBindings::OpenChannelToExtension(
bool include_tls_channel_id =
args.Length() > 2 ? args[2]->BooleanValue() : false;
int port_id = -1;
- renderview->Send(
- new ExtensionHostMsg_OpenChannelToExtension(renderview->GetRoutingID(),
- info,
- channel_name,
- include_tls_channel_id,
- &port_id));
+ renderframe->Send(new ExtensionHostMsg_OpenChannelToExtension(
+ renderframe->GetRoutingID(), info, channel_name, include_tls_channel_id,
+ &port_id));
args.GetReturnValue().Set(static_cast<int32_t>(port_id));
}
« no previous file with comments | « extensions/renderer/resources/messaging.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698