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

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

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: windows interactive_ui_tests fix Created 7 years, 10 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 211ad62ebd65082784a7bfc48976424647670f34..22af19cf1b95bad4955a46bfb4f72d584394df3a 100644
--- a/chrome/renderer/extensions/runtime_custom_bindings.cc
+++ b/chrome/renderer/extensions/runtime_custom_bindings.cc
@@ -18,8 +18,10 @@ using content::V8ValueConverter;
namespace extensions {
-RuntimeCustomBindings::RuntimeCustomBindings(ChromeV8Context* context)
- : ChromeV8Extension(NULL), context_(context) {
+RuntimeCustomBindings::RuntimeCustomBindings(Dispatcher* dispatcher,
+ ChromeV8Context* context)
+ : ChromeV8Extension(dispatcher, context->v8_context()),
+ context_(context) {
RouteFunction("GetManifest",
base::Bind(&RuntimeCustomBindings::GetManifest, base::Unretained(this)));
RouteStaticFunction("OpenChannelToExtension", &OpenChannelToExtension);
@@ -33,7 +35,8 @@ v8::Handle<v8::Value> RuntimeCustomBindings::OpenChannelToExtension(
const v8::Arguments& args) {
// Get the current RenderView so that we can send a routed IPC message from
// the correct source.
- content::RenderView* renderview = GetCurrentRenderView();
+ RuntimeCustomBindings* self = GetFromArguments<RuntimeCustomBindings>(args);
+ content::RenderView* renderview = self->GetRenderView();
if (!renderview)
return v8::Undefined();
@@ -61,7 +64,8 @@ v8::Handle<v8::Value> RuntimeCustomBindings::OpenChannelToNativeApp(
const v8::Arguments& args) {
// Get the current RenderView so that we can send a routed IPC message from
// the correct source.
- content::RenderView* renderview = GetCurrentRenderView();
+ RuntimeCustomBindings* self = GetFromArguments<RuntimeCustomBindings>(args);
+ content::RenderView* renderview = self->GetRenderView();
if (!renderview)
return v8::Undefined();

Powered by Google App Engine
This is Rietveld 408576698