- Add support for entering a V8 context asynchronously (issue #203).

- Add support for V8 accessors (issue #203).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@215 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-04-07 01:58:49 +00:00
parent 36f3f3d021
commit 7ec29b5d87
19 changed files with 772 additions and 17 deletions

View File

@@ -11,6 +11,7 @@
//
#include "libcef_dll/cpptoc/base_cpptoc.h"
#include "libcef_dll/cpptoc/v8accessor_cpptoc.h"
#include "libcef_dll/cpptoc/v8handler_cpptoc.h"
#include "libcef_dll/ctocpp/v8context_ctocpp.h"
#include "libcef_dll/ctocpp/v8value_ctocpp.h"
@@ -79,6 +80,24 @@ CefRefPtr<CefV8Value> CefV8Value::CreateObject(CefRefPtr<CefBase> user_data)
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateObject(CefRefPtr<CefBase> user_data,
CefRefPtr<CefV8Accessor> accessor)
{
cef_base_t* baseStruct = NULL;
if(user_data)
baseStruct = CefBaseCppToC::Wrap(user_data);
cef_v8accessor_t* accessorStruct = NULL;
if(accessor)
accessorStruct = CefV8AccessorCppToC::Wrap(accessor);
cef_v8value_t* impl = cef_v8value_create_object_with_accessor(baseStruct,
accessorStruct);
if(impl)
return CefV8ValueCToCpp::Wrap(impl);
return NULL;
}
CefRefPtr<CefV8Value> CefV8Value::CreateArray()
{
cef_v8value_t* impl = cef_v8value_create_array();
@@ -176,6 +195,14 @@ bool CefV8ValueCToCpp::IsFunction()
return struct_->is_function(struct_)?true:false;
}
bool CefV8ValueCToCpp::IsSame(CefRefPtr<CefV8Value> that)
{
if(CEF_MEMBER_MISSING(struct_, is_same))
return false;
return struct_->is_same(struct_, CefV8ValueCToCpp::Unwrap(that))?true:false;
}
bool CefV8ValueCToCpp::GetBoolValue()
{
if(CEF_MEMBER_MISSING(struct_, get_bool_value))
@@ -285,6 +312,16 @@ bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr<CefV8Value> value)
CefV8ValueCToCpp::Unwrap(value))?true:false;
}
bool CefV8ValueCToCpp::SetValue(const CefString& key, AccessControl settings,
PropertyAttribute attribute)
{
if(CEF_MEMBER_MISSING(struct_, set_value_byaccessor))
return false;
return struct_->set_value_byaccessor(struct_, key.GetStruct(),
settings, attribute)?true:false;
}
bool CefV8ValueCToCpp::GetKeys(std::vector<CefString>& keys)
{
if(CEF_MEMBER_MISSING(struct_, get_keys))