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

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: 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/miscellaneous_bindings.cc
diff --git a/chrome/renderer/extensions/miscellaneous_bindings.cc b/chrome/renderer/extensions/miscellaneous_bindings.cc
index facdec740dc724cd417fa73cbf92a10db3cac9a6..35d24bd4ffc3af735bbf6ed5bcb6313834d0a80c 100644
--- a/chrome/renderer/extensions/miscellaneous_bindings.cc
+++ b/chrome/renderer/extensions/miscellaneous_bindings.cc
@@ -65,8 +65,9 @@ const char kPortClosedError[] = "Attempting to use a disconnected port object";
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);
@@ -78,7 +79,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();
@@ -178,8 +180,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

Powered by Google App Engine
This is Rietveld 408576698