From bebe87aa2675385db413db0b41dad102eb493339 Mon Sep 17 00:00:00 2001 From: ganchuantao Date: Thu, 26 Jun 2025 06:20:32 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20enableLeakWatcher=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ganchuantao --- api/@ohos.hiviewdfx.jsLeakWatcher.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts b/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts index 745057c40a..b551a0aa52 100644 --- a/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts +++ b/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts @@ -64,5 +64,19 @@ declare namespace jsLeakWatcher { * @since 12 */ function dump(filePath: string): Array; + + /** + * Enables or disables jsLeakWatcher. + * + * @param { boolean } isEnabled - Whether to enable or disable jsLeankWatcher. The value true means to enable the feature, and false means th opposite. + * @param { Array } config - Array of types of objects to watch + * @param { Callback> } callback - Callback invoked when an object-related memory leak is detected. + * @throws { BusinessError } 10801001 - The parameter isEnabled is invalid. + * @throws { BusinessError } 10801002 - The parameter config is invalid. + * @throws { BusinessError } 10801003 - The parameter callback is invalid. + * @syscap SystemCapability.HiviewDFX.HiChecker + * @since 20 + */ + function enableLeakWatcher(isEnabled: boolean, config: Array, callback: Callback>): void } export default jsLeakWatcher; -- Gitee From 29188e50caa02af541298d130fc3d964016d205c Mon Sep 17 00:00:00 2001 From: ganchuantao Date: Fri, 27 Jun 2025 06:10:39 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ganchuantao --- api/@ohos.hiviewdfx.jsLeakWatcher.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts b/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts index b551a0aa52..80e67f4e41 100644 --- a/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts +++ b/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts @@ -68,12 +68,16 @@ declare namespace jsLeakWatcher { /** * Enables or disables jsLeakWatcher. * - * @param { boolean } isEnabled - Whether to enable or disable jsLeankWatcher. The value true means to enable the feature, and false means th opposite. - * @param { Array } config - Array of types of objects to watch + * @param { boolean } isEnabled - Whether to enable or disable jsLeankWatcher. The value true means to enable the feature, and false means the opposite. + * @param { Array } config - Array of types of objects to watch. * @param { Callback> } callback - Callback invoked when an object-related memory leak is detected. * @throws { BusinessError } 10801001 - The parameter isEnabled is invalid. * @throws { BusinessError } 10801002 - The parameter config is invalid. * @throws { BusinessError } 10801003 - The parameter callback is invalid. + * Input parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types; + * 3.Parameter verification failed. * @syscap SystemCapability.HiviewDFX.HiChecker * @since 20 */ -- Gitee From 26f4c268dab6106773616fe2c1b7218e5fddf90d Mon Sep 17 00:00:00 2001 From: ganchuantao Date: Fri, 27 Jun 2025 06:25:17 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ganchuantao --- api/@ohos.hiviewdfx.jsLeakWatcher.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts b/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts index 80e67f4e41..a4eaf9d9f5 100644 --- a/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts +++ b/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts @@ -68,6 +68,10 @@ declare namespace jsLeakWatcher { /** * Enables or disables jsLeakWatcher. * + * This interface can detect js object memory leaks in a single call, which is more concise than the previous method + * requiring four function (enable,watch,check dump) calls.If there is a memory leak, the leak file will be + * returned to the developer through the callback function. + * * @param { boolean } isEnabled - Whether to enable or disable jsLeankWatcher. The value true means to enable the feature, and false means the opposite. * @param { Array } config - Array of types of objects to watch. * @param { Callback> } callback - Callback invoked when an object-related memory leak is detected. -- Gitee From b4c6a36f3181b9d4da9113beb9518ac3bc1be9dc Mon Sep 17 00:00:00 2001 From: ganchuantao Date: Mon, 7 Jul 2025 07:05:30 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8D=E5=AD=97?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ganchuantao --- api/@ohos.hiviewdfx.jsLeakWatcher.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts b/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts index a4eaf9d9f5..d4e1f95b15 100644 --- a/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts +++ b/api/@ohos.hiviewdfx.jsLeakWatcher.d.ts @@ -73,7 +73,7 @@ declare namespace jsLeakWatcher { * returned to the developer through the callback function. * * @param { boolean } isEnabled - Whether to enable or disable jsLeankWatcher. The value true means to enable the feature, and false means the opposite. - * @param { Array } config - Array of types of objects to watch. + * @param { Array } configs - Array of types of objects to watch. * @param { Callback> } callback - Callback invoked when an object-related memory leak is detected. * @throws { BusinessError } 10801001 - The parameter isEnabled is invalid. * @throws { BusinessError } 10801002 - The parameter config is invalid. @@ -85,6 +85,6 @@ declare namespace jsLeakWatcher { * @syscap SystemCapability.HiviewDFX.HiChecker * @since 20 */ - function enableLeakWatcher(isEnabled: boolean, config: Array, callback: Callback>): void + function enableLeakWatcher(isEnabled: boolean, configs: Array, callback: Callback>): void } export default jsLeakWatcher; -- Gitee