From 5319190a069ce6657577718a72e645dad45be0af Mon Sep 17 00:00:00 2001 From: xqian6 Date: Thu, 31 May 2012 16:54:04 +0800 Subject: Fix memory leak caused by CSSRuleList wrapper Accessing cssrulelist in javascript will create a new CSSRuleList object and wrapper JS object. The wrapper JS object will be added into hidden array in parent JS object which is alive during the whole execution. Thus memory leak happens (CSSRuleList in webkit, wrapper object and weak global handle in v8). Cherry pick 2 patches from upstream solves the problem: http://trac.webkit.org/changeset/90949 This patch changes hidden reference from array to named property. So new wrapper will replace old wrappper. But the memory leak still exists because the CSSRuleList wrapper will be added into an object group of current document. So they will still be alive during execution. http://trac.webkit.org/changeset/91256 This patch avoids to adding CSSRuleList wrapper into document object group. Combined with the first patch, it can resolve the memory leak problem. Change-Id: Icb523db52963726f27b6c02596822cfb6e8d5049 Author: Vitaly Repeshko Signed-off-by: Xi Qian Signed-off-by: Shuo Gao Signed-off-by: Bruce Beare Signed-off-by: Jack Ren Author-tracking-BZ: 32630 --- Source/WebCore/bindings/v8/WrapperTypeInfo.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Source/WebCore/bindings/v8/WrapperTypeInfo.h') diff --git a/Source/WebCore/bindings/v8/WrapperTypeInfo.h b/Source/WebCore/bindings/v8/WrapperTypeInfo.h index 166d642..c2684d6 100644 --- a/Source/WebCore/bindings/v8/WrapperTypeInfo.h +++ b/Source/WebCore/bindings/v8/WrapperTypeInfo.h @@ -39,8 +39,7 @@ namespace WebCore { static const int v8DOMWrapperTypeIndex = 0; static const int v8DOMWrapperObjectIndex = 1; - static const int v8DOMHiddenReferenceArrayIndex = 2; - static const int v8DefaultWrapperInternalFieldCount = 3; + static const int v8DefaultWrapperInternalFieldCount = 2; static const uint16_t v8DOMSubtreeClassId = 1; -- cgit v1.1