Add methods to CefV8Value for specifying the amount of externally allocated memory associated with the V8 object (issue #478).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@469 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-01-19 18:52:59 +00:00
parent ea3dcc8492
commit 0352efec64
14 changed files with 2039 additions and 1742 deletions

View File

@@ -624,6 +624,37 @@ cef_base_t* CEF_CALLBACK v8value_get_user_data(struct _cef_v8value_t* self) {
return CefBaseCToCpp::Unwrap(_retval);
}
int CEF_CALLBACK v8value_get_externally_allocated_memory(
struct _cef_v8value_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefV8ValueCppToC::Get(self)->GetExternallyAllocatedMemory();
// Return type: simple
return _retval;
}
int CEF_CALLBACK v8value_adjust_externally_allocated_memory(
struct _cef_v8value_t* self, int change_in_bytes) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
int _retval = CefV8ValueCppToC::Get(self)->AdjustExternallyAllocatedMemory(
change_in_bytes);
// Return type: simple
return _retval;
}
int CEF_CALLBACK v8value_get_array_length(struct _cef_v8value_t* self) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@@ -855,6 +886,10 @@ CefV8ValueCppToC::CefV8ValueCppToC(CefV8Value* cls)
struct_.struct_.set_value_byaccessor = v8value_set_value_byaccessor;
struct_.struct_.get_keys = v8value_get_keys;
struct_.struct_.get_user_data = v8value_get_user_data;
struct_.struct_.get_externally_allocated_memory =
v8value_get_externally_allocated_memory;
struct_.struct_.adjust_externally_allocated_memory =
v8value_adjust_externally_allocated_memory;
struct_.struct_.get_array_length = v8value_get_array_length;
struct_.struct_.get_function_name = v8value_get_function_name;
struct_.struct_.get_function_handler = v8value_get_function_handler;

View File

@@ -590,6 +590,33 @@ CefRefPtr<CefBase> CefV8ValueCToCpp::GetUserData() {
return CefBaseCppToC::Unwrap(_retval);
}
int CefV8ValueCToCpp::GetExternallyAllocatedMemory() {
if (CEF_MEMBER_MISSING(struct_, get_externally_allocated_memory))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->get_externally_allocated_memory(struct_);
// Return type: simple
return _retval;
}
int CefV8ValueCToCpp::AdjustExternallyAllocatedMemory(int change_in_bytes) {
if (CEF_MEMBER_MISSING(struct_, adjust_externally_allocated_memory))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->adjust_externally_allocated_memory(struct_,
change_in_bytes);
// Return type: simple
return _retval;
}
int CefV8ValueCToCpp::GetArrayLength() {
if (CEF_MEMBER_MISSING(struct_, get_array_length))
return 0;

View File

@@ -66,6 +66,8 @@ class CefV8ValueCToCpp
PropertyAttribute attribute) OVERRIDE;
virtual bool GetKeys(std::vector<CefString>& keys) OVERRIDE;
virtual CefRefPtr<CefBase> GetUserData() OVERRIDE;
virtual int GetExternallyAllocatedMemory() OVERRIDE;
virtual int AdjustExternallyAllocatedMemory(int change_in_bytes) OVERRIDE;
virtual int GetArrayLength() OVERRIDE;
virtual CefString GetFunctionName() OVERRIDE;
virtual CefRefPtr<CefV8Handler> GetFunctionHandler() OVERRIDE;