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

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

Issue 15855010: Make ExtensionMsg_MessageInvoke run a module system function rather than a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: go Created 7 years, 7 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/extension_helper.cc
diff --git a/chrome/renderer/extensions/extension_helper.cc b/chrome/renderer/extensions/extension_helper.cc
index a5e7ef48347afc013c0d161442927ac040bf6f32..2d9bb711169bbf753d2083b7a7d15ad98449bd02 100644
--- a/chrome/renderer/extensions/extension_helper.cc
+++ b/chrome/renderer/extensions/extension_helper.cc
@@ -11,6 +11,7 @@
#include "base/lazy_instance.h"
#include "base/message_loop.h"
#include "base/utf_string_conversions.h"
+#include "base/values.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/render_messages.h"
@@ -250,16 +251,20 @@ void ExtensionHelper::OnExtensionResponse(int request_id,
}
void ExtensionHelper::OnExtensionMessageInvoke(const std::string& extension_id,
+ const std::string& module_name,
const std::string& function_name,
const base::ListValue& args,
bool user_gesture) {
scoped_ptr<WebScopedUserGesture> web_user_gesture;
- if (user_gesture) {
+ if (user_gesture)
web_user_gesture.reset(new WebScopedUserGesture);
- }
-
- dispatcher_->v8_context_set().DispatchChromeHiddenMethod(
- extension_id, function_name, args, render_view());
+ dispatcher_->v8_context_set().ForEach(
koz (OOO until 15th September) 2013/05/31 04:28:44 It feels a little weird to have to pass Dispatcher
not at google - send to devlin 2013/05/31 22:47:07 I had decided to do it this way because there were
+ extension_id,
+ render_view(),
+ base::Bind(&Dispatcher::CallModuleMethod,
+ module_name,
+ function_name,
+ &args));
}
void ExtensionHelper::OnExtensionDispatchOnConnect(
@@ -364,7 +369,8 @@ void ExtensionHelper::OnAppWindowClosed() {
dispatcher_->v8_context_set().GetByV8Context(script_context);
if (!chrome_v8_context)
return;
- chrome_v8_context->CallChromeHiddenMethod("OnAppWindowClosed", 0, NULL, NULL);
+ chrome_v8_context->module_system()->CallModuleMethod(
+ "app.window", "onAppWindowClosed");
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698