mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Hide CEF internal V8 attributes from JavaScript (issue #316).
- Add a PropertyAttribute parameter to CefV8Value::SetValue() (issue #412). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@358 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -135,17 +135,19 @@ void InitBindingTest(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefV8Value> testObjPtr = CefV8Value::CreateObject(NULL);
|
||||
// Add the new V8 object to the global window object with the name
|
||||
// "cef_test".
|
||||
object->SetValue("cef_test", testObjPtr);
|
||||
object->SetValue("cef_test", testObjPtr, V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
|
||||
// Create an instance of ClientV8FunctionHandler as the V8 handler.
|
||||
CefRefPtr<CefV8Handler> handlerPtr = new ClientV8FunctionHandler();
|
||||
|
||||
// Add a new V8 function to the cef_test object with the name "Dump".
|
||||
testObjPtr->SetValue("Dump",
|
||||
CefV8Value::CreateFunction("Dump", handlerPtr));
|
||||
CefV8Value::CreateFunction("Dump", handlerPtr),
|
||||
V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
// Add a new V8 function to the cef_test object with the name "Call".
|
||||
testObjPtr->SetValue("Call",
|
||||
CefV8Value::CreateFunction("Call", handlerPtr));
|
||||
CefV8Value::CreateFunction("Call", handlerPtr),
|
||||
V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
}
|
||||
|
||||
void RunBindingTest(CefRefPtr<CefBrowser> browser)
|
||||
|
@@ -49,10 +49,12 @@ public:
|
||||
retval = CefV8Value::CreateObject(NULL);
|
||||
// Add a string parameter to the new V8 object.
|
||||
retval->SetValue("param", CefV8Value::CreateString(
|
||||
"Retrieving a parameter on a native object succeeded."));
|
||||
"Retrieving a parameter on a native object succeeded."),
|
||||
V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
// Add a function to the new V8 object.
|
||||
retval->SetValue("GetMessage",
|
||||
CefV8Value::CreateFunction("GetMessage", this));
|
||||
CefV8Value::CreateFunction("GetMessage", this),
|
||||
V8_PROPERTY_ATTRIBUTE_NONE);
|
||||
return true;
|
||||
}
|
||||
else if(name == "GetMessage")
|
||||
|
Reference in New Issue
Block a user