Chromium Code Reviews| Index: chrome/renderer/extensions/module_system.h |
| diff --git a/chrome/renderer/extensions/module_system.h b/chrome/renderer/extensions/module_system.h |
| index 4f790842aec9f0a5095e355b90c10a2d991a837b..ccd6c4af03297a080f4e0a99b9c6539124147d5e 100644 |
| --- a/chrome/renderer/extensions/module_system.h |
| +++ b/chrome/renderer/extensions/module_system.h |
| @@ -86,6 +86,7 @@ class ModuleSystem : public NativeHandler { |
| // |native_handler|. |
| void RegisterNativeHandler(const std::string& name, |
| scoped_ptr<NativeHandler> native_handler); |
| + bool HasNativeHandler(const std::string& name); |
| // Causes requireNative(|name|) to look for its module in |source_map_| |
| // instead of using a registered native handler. This can be used in unit |
| @@ -100,6 +101,14 @@ class ModuleSystem : public NativeHandler { |
| const v8::AccessorInfo& info); |
| // Make |object|.|field| lazily evaluate to the result of |
| + // require(|module_name|)[|module_field|](|arg|). |
|
not at google - send to devlin
2012/12/13 22:26:40
This is pretty cool, though see comment in schema_
|
| + void SetLazyField(v8::Handle<v8::Object> object, |
| + const std::string& field, |
| + const std::string& module_name, |
| + const std::string& module_field, |
| + const std::string& arg); |
| + |
| + // Make |object|.|field| lazily evaluate to the result of |
| // require(|module_name|)[|module_field|]. |
| void SetLazyField(v8::Handle<v8::Object> object, |
| const std::string& field, |
| @@ -124,6 +133,12 @@ class ModuleSystem : public NativeHandler { |
| v8::Handle<v8::Value> RunString(v8::Handle<v8::String> code, |
| v8::Handle<v8::String> name); |
| + // Call |value| with arguments |argv| and return the result. |
| + v8::Handle<v8::Value> CallModuleMethod(v8::Local<v8::Value> value, |
| + int argc, |
| + v8::Handle<v8::Value> argv[]); |
| + |
| + |
| // Return the named source file stored in the source map. |
| // |args[0]| - the name of a source file in source_map_. |
| v8::Handle<v8::Value> GetSource(v8::Handle<v8::String> source_name); |