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

@@ -535,6 +535,26 @@ class CefV8Value : public virtual CefBase {
/*--cef()--*/
virtual CefRefPtr<CefBase> GetUserData() =0;
///
// Returns the amount of externally allocated memory registered for the
// object.
///
/*--cef()--*/
virtual int GetExternallyAllocatedMemory() =0;
///
// Adjusts the amount of registered external memory for the object. Used to
// give V8 an indication of the amount of externally allocated memory that is
// kept alive by JavaScript objects. V8 uses this information to decide when
// to perform global garbage collection. Each CefV8Value tracks the amount of
// external memory associated with it and automatically decreases the global
// total by the appropriate amount on its destruction. |change_in_bytes|
// specifies the number of bytes to adjust by. This method returns the number
// of bytes associated with the object after the adjustment.
///
/*--cef()--*/
virtual int AdjustExternallyAllocatedMemory(int change_in_bytes) =0;
// ARRAY METHODS - These methods are only available on arrays.