-struct ReleaseNPObject {
- void operator()(NPObject* o) const { blink::WebBindings::releaseObject(o); }
-};
+class PepperTryCatchForTest : public PepperTryCatch {
+ public:
+ explicit PepperTryCatchForTest(PepperPluginInstanceImpl* instance)
+ : PepperTryCatch(instance, V8VarConverter::kAllowObjectVars),
+ handle_scope_(instance->GetIsolate()),
+ context_scope_(v8::Context::New(instance->GetIsolate())) {}
+
+ virtual void SetException(const char* message) OVERRIDE { NOTREACHED(); }
+ virtual bool HasException() OVERRIDE { return false; }
+ virtual v8::Handle<v8::Context> GetContext() OVERRIDE {
+ return instance_->GetIsolate()->GetCurrentContext();
+ }