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

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

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android compilation Created 7 years, 9 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
« no previous file with comments | « chrome/renderer/extensions/miscellaneous_bindings.h ('k') | chrome/renderer/extensions/module_system.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/miscellaneous_bindings.cc
diff --git a/chrome/renderer/extensions/miscellaneous_bindings.cc b/chrome/renderer/extensions/miscellaneous_bindings.cc
index da4c58dce0768c60ec016dc45ae07d32ec29043f..37c10201f0bfc40f3c24e982a5817aee6941a675 100644
--- a/chrome/renderer/extensions/miscellaneous_bindings.cc
+++ b/chrome/renderer/extensions/miscellaneous_bindings.cc
@@ -68,8 +68,9 @@ const char kReceivingEndDoesntExistError[] =
class ExtensionImpl : public extensions::ChromeV8Extension {
public:
- explicit ExtensionImpl(extensions::Dispatcher* dispatcher)
- : extensions::ChromeV8Extension(dispatcher) {
+ explicit ExtensionImpl(extensions::Dispatcher* dispatcher,
+ v8::Handle<v8::Context> context)
+ : extensions::ChromeV8Extension(dispatcher, context) {
RouteStaticFunction("CloseChannel", &CloseChannel);
RouteStaticFunction("PortAddRef", &PortAddRef);
RouteStaticFunction("PortRelease", &PortRelease);
@@ -81,7 +82,8 @@ class ExtensionImpl : public extensions::ChromeV8Extension {
// Sends a message along the given channel.
static v8::Handle<v8::Value> PostMessage(const v8::Arguments& args) {
- content::RenderView* renderview = GetCurrentRenderView();
+ ExtensionImpl* self = GetFromArguments<ExtensionImpl>(args);
+ content::RenderView* renderview = self->GetRenderView();
if (!renderview)
return v8::Undefined();
@@ -181,8 +183,10 @@ class ExtensionImpl : public extensions::ChromeV8Extension {
namespace extensions {
-ChromeV8Extension* MiscellaneousBindings::Get(Dispatcher* dispatcher) {
- return new ExtensionImpl(dispatcher);
+ChromeV8Extension* MiscellaneousBindings::Get(
+ Dispatcher* dispatcher,
+ v8::Handle<v8::Context> context) {
+ return new ExtensionImpl(dispatcher, context);
}
// static
« no previous file with comments | « chrome/renderer/extensions/miscellaneous_bindings.h ('k') | chrome/renderer/extensions/module_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698