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

Unified Diff: extensions/renderer/module_system.h

Issue 2423043003: [Extensions] Convert some callers of ScriptContext::CallFunction (Closed)
Patch Set: d'oh Created 4 years, 2 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 | « extensions/renderer/json_schema_unittest.cc ('k') | extensions/renderer/module_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/module_system.h
diff --git a/extensions/renderer/module_system.h b/extensions/renderer/module_system.h
index 4ce545860f067f4553d45bcfa61c191f4a6da1c4..1797f9ce0d028c4d5ad18efbbe515aa416a8a338 100644
--- a/extensions/renderer/module_system.h
+++ b/extensions/renderer/module_system.h
@@ -91,8 +91,11 @@ class ModuleSystem : public ObjectBackedNativeHandler,
// Calls the specified method exported by the specified module. This is
// equivalent to calling require('module_name').method_name() from JS.
- v8::Local<v8::Value> CallModuleMethod(const std::string& module_name,
- const std::string& method_name);
+ // DEPRECATED: see crbug.com/629431
+ // TODO(devlin): Remove these.
+ v8::Local<v8::Value> CallModuleMethod(
+ const std::string& module_name,
+ const std::string& method_name);
v8::Local<v8::Value> CallModuleMethod(
const std::string& module_name,
const std::string& method_name,
@@ -102,6 +105,17 @@ class ModuleSystem : public ObjectBackedNativeHandler,
int argc,
v8::Local<v8::Value> argv[]);
+ // Same as the above, but allows for blocking execution.
+ void CallModuleMethodSafe(const std::string& module_name,
+ const std::string& method_name);
+ void CallModuleMethodSafe(const std::string& module_name,
+ const std::string& method_name,
+ std::vector<v8::Local<v8::Value>>* args);
+ void CallModuleMethodSafe(const std::string& module_name,
+ const std::string& method_name,
+ int argc,
+ v8::Local<v8::Value> argv[]);
+
// Register |native_handler| as a potential target for requireNative(), so
// calls to requireNative(|name|) from JS will return a new object created by
// |native_handler|.
@@ -218,6 +232,10 @@ class ModuleSystem : public ObjectBackedNativeHandler,
// See |clobbered_native_handlers_|.
void ClobberExistingNativeHandler(const std::string& name);
+ // Returns the v8::Function associated with the given module and method name.
+ v8::Local<v8::Function> GetModuleFunction(const std::string& module_name,
+ const std::string& method_name);
+
ScriptContext* context_;
// A map from module names to the JS source for that module. GetSource()
« no previous file with comments | « extensions/renderer/json_schema_unittest.cc ('k') | extensions/renderer/module_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698