| Index: content/renderer/pepper/pepper_try_catch.h
|
| diff --git a/content/renderer/pepper/pepper_try_catch.h b/content/renderer/pepper/pepper_try_catch.h
|
| index 6b767175e2a3bc88d558d505f6b310e308239afa..459cb2c4c9c090071bccffd8f5f720b73a6e01ae 100644
|
| --- a/content/renderer/pepper/pepper_try_catch.h
|
| +++ b/content/renderer/pepper/pepper_try_catch.h
|
| @@ -7,6 +7,7 @@
|
|
|
| #include "base/basictypes.h"
|
| #include "content/common/content_export.h"
|
| +#include "content/renderer/pepper/v8_var_converter.h"
|
| #include "ppapi/c/pp_var.h"
|
| #include "ppapi/shared_impl/scoped_pp_var.h"
|
| #include "v8/include/v8.h"
|
| @@ -19,10 +20,11 @@ class PepperPluginInstanceImpl;
|
| class CONTENT_EXPORT PepperTryCatch {
|
| public:
|
| PepperTryCatch(PepperPluginInstanceImpl* instance,
|
| - bool convert_objects);
|
| + V8VarConverter::AllowObjectVars convert_objects);
|
| virtual ~PepperTryCatch();
|
|
|
| virtual void SetException(const char* message) = 0;
|
| + virtual bool HasException() = 0;
|
| // Gets the plugin context. Virtual so it can be overriden for testing.
|
| virtual v8::Handle<v8::Context> GetContext();
|
|
|
| @@ -34,26 +36,27 @@ class CONTENT_EXPORT PepperTryCatch {
|
| protected:
|
| PepperPluginInstanceImpl* instance_;
|
|
|
| - // Whether To/FromV8 should convert object vars. If set to false, an exception
|
| - // should be set if they are encountered during conversion.
|
| - bool convert_objects_;
|
| + // Whether To/FromV8 should convert object vars. If set to
|
| + // kDisallowObjectVars, an exception should be set if they are encountered
|
| + // during conversion.
|
| + V8VarConverter::AllowObjectVars convert_objects_;
|
| };
|
|
|
| // Catches var exceptions and emits a v8 exception.
|
| class PepperTryCatchV8 : public PepperTryCatch {
|
| public:
|
| PepperTryCatchV8(PepperPluginInstanceImpl* instance,
|
| - bool convert_objects,
|
| + V8VarConverter::AllowObjectVars convert_objects,
|
| v8::Isolate* isolate);
|
| virtual ~PepperTryCatchV8();
|
|
|
| - bool HasException();
|
| bool ThrowException();
|
| void ThrowException(const char* message);
|
| PP_Var* exception() { return &exception_; }
|
|
|
| // PepperTryCatch
|
| virtual void SetException(const char* message) OVERRIDE;
|
| + virtual bool HasException() OVERRIDE;
|
|
|
| private:
|
| PP_Var exception_;
|
| @@ -68,14 +71,12 @@ class PepperTryCatchVar : public PepperTryCatch {
|
| // is responsible for managing the lifetime of the exception. It is valid to
|
| // pass NULL for |exception| in which case no exception will be set.
|
| PepperTryCatchVar(PepperPluginInstanceImpl* instance,
|
| - bool convert_objects,
|
| PP_Var* exception);
|
| virtual ~PepperTryCatchVar();
|
|
|
| - bool HasException();
|
| -
|
| // PepperTryCatch
|
| virtual void SetException(const char* message) OVERRIDE;
|
| + virtual bool HasException() OVERRIDE;
|
|
|
| private:
|
| // Code which uses PepperTryCatchVar doesn't typically have a HandleScope,
|
|
|