Index: chrome/renderer/extensions/module_system.h |
diff --git a/chrome/renderer/extensions/module_system.h b/chrome/renderer/extensions/module_system.h |
index e371865d9cacfb3f560d4fe5cbf0c71786fd1916..e39d84b4727cacb7e9303f871f09f8e024e20983 100644 |
--- a/chrome/renderer/extensions/module_system.h |
+++ b/chrome/renderer/extensions/module_system.h |
@@ -37,10 +37,17 @@ class ModuleSystem : public NativeHandler { |
public: |
class SourceMap { |
public: |
+ virtual ~SourceMap() {} |
virtual v8::Handle<v8::Value> GetSource(const std::string& name) = 0; |
virtual bool Contains(const std::string& name) = 0; |
}; |
+ class ExceptionHandler { |
+ public: |
+ virtual ~ExceptionHandler() {} |
+ virtual void HandleUncaughtException() = 0; |
+ }; |
+ |
// Enables native bindings for the duration of its lifetime. |
class NativesEnabledScope { |
public: |
@@ -99,6 +106,13 @@ class ModuleSystem : public NativeHandler { |
const std::string& module_name, |
const std::string& module_field); |
+ // Called when an exception is thrown but not caught. |
+ void HandleException(const v8::TryCatch& try_catch); |
not at google - send to devlin
2012/11/14 00:00:11
why does this need to be public?
koz (OOO until 15th September)
2012/11/14 06:14:29
Oops, it doesn't. Fixed.
|
+ |
+ void set_exception_handler(scoped_ptr<ExceptionHandler> handler) { |
+ exception_handler_ = handler.Pass(); |
+ } |
+ |
private: |
typedef std::map<std::string, linked_ptr<NativeHandler> > NativeHandlerMap; |
@@ -139,6 +153,9 @@ class ModuleSystem : public NativeHandler { |
// pinned natives as enabled. |
int natives_enabled_; |
+ // Called when an exception is thrown but not caught in JS. |
+ scoped_ptr<ExceptionHandler> exception_handler_; |
+ |
std::set<std::string> overridden_native_handlers_; |
DISALLOW_COPY_AND_ASSIGN(ModuleSystem); |