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

Unified Diff: chrome/renderer/extensions/module_system.h

Issue 11312157: Add ExceptionHandler to ModuleSystem, remove heap allocated v8::TryCatch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « no previous file | chrome/renderer/extensions/module_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | chrome/renderer/extensions/module_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698