I want to handle all Get/Set operation of a object (CefV8Value) using CefV8Accessor. I have a code like below. In this, whenever I access 'myObject.myProperty', my MyAccessor's Set/Get is getting called.
My question is, can I make MyAccessor as default Accessor for all the properties of a object?
Example: In Java Script, if I set/get any property value in 'myObject' (like 'myObject.yourProperty = "abc"' ), the call should come to my MyAccessor object.
class MyAccessor : public CefV8Accessor
{
....
};
// Create Accessor
CefRefPtr<CefV8Accessor> myAccessorObj = new MyAccessor();
// Create the new V8 object.
CefRefPtr<CefV8Value> dwObjectPtr = CefV8Value::CreateObject(NULL, myAccessorObj );
// Adding myObject in the global scope.
globalObj->SetValue("myObject", dwObjectPtr, V8_PROPERTY_ATTRIBUTE_NONE);
// Register an identifier whose access will be forwarded to the CefV8Accessor
dwObjectPtr->SetValue("myProperty", V8_ACCESS_CONTROL_DEFAULT, V8_PROPERTY_ATTRIBUTE_NONE);
Regards,
tumapathy