diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_profile_stats.cpp')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_profile_stats.cpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_profile_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_profile_stats.cpp new file mode 100644 index 0000000000..a2a08ccda2 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_profile_stats.cpp @@ -0,0 +1,63 @@ +/* ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Communicator client code, released March 31, 1998. + * + * The Initial Developer of the Original Code is + * Netscape Communications Corporation. + * Portions created by Netscape are Copyright (C) 1998-1999 + * Netscape Communications Corporation. All Rights Reserved. + * + * Contributor(s): + * + * IBM + * - Binding to permit interfacing between Mozilla and SWT + * - Copyright (C) 2004, 2006 IBM Corp. All Rights Reserved. + * + * ***** END LICENSE BLOCK ***** */ + +#include "swt.h" +#include "xpcom_profile_stats.h" + +#ifdef NATIVE_STATS + +int XPCOM_PROFILE_nativeFunctionCount = 4; +int XPCOM_PROFILE_nativeFunctionCallCount[4]; +char * XPCOM_PROFILE_nativeFunctionNames[] = { + "NS_1NewProfileDirServiceProvider", + "ProfileDirServiceProvider_1Register", + "ProfileDirServiceProvider_1SetProfileDir", + "ProfileDirServiceProvider_1Shutdown", +}; + +#define STATS_NATIVE(func) Java_org_eclipse_swt_tools_internal_NativeStats_##func + +JNIEXPORT jint JNICALL STATS_NATIVE(XPCOM_1PROFILE_1GetFunctionCount) + (JNIEnv *env, jclass that) +{ + return XPCOM_PROFILE_nativeFunctionCount; +} + +JNIEXPORT jstring JNICALL STATS_NATIVE(XPCOM_1PROFILE_1GetFunctionName) + (JNIEnv *env, jclass that, jint index) +{ + return env->NewStringUTF(XPCOM_PROFILE_nativeFunctionNames[index]); +} + +JNIEXPORT jint JNICALL STATS_NATIVE(XPCOM_1PROFILE_1GetFunctionCallCount) + (JNIEnv *env, jclass that, jint index) +{ + return XPCOM_PROFILE_nativeFunctionCallCount[index]; +} + +#endif |