Bug 790117: XPCOM test harness: Delete unused profiler control functions. r=bsmedberg

These functions are entirely unused, but we also now have
JS_DefineProfilingFunctions, present in both browser and JavaScript shell,
for doing what these functions were presumably intended for.
This commit is contained in:
Jim Blandy 2012-09-21 16:36:13 -07:00
parent 04963c0cd1
commit 6ba9527009

View File

@ -79,57 +79,6 @@ void passed(const char* msg, ...)
putchar('\n');
}
//-----------------------------------------------------------------------------
// Code profiling
//
static const char* gCurrentProfile;
/**
* If the build has been configured properly, start the best code profiler
* available on this platform.
*
* This is NOT thread safe.
*
* @precondition Profiling is not started
* @param profileName A descriptive name for this profiling run. Every
* attempt is made to name the profile data according
* to this name, but check your platform's profiler
* documentation for what this means.
* @return true if profiling was available and successfully started.
* @see StopProfiling
*/
inline bool
StartProfiling(const char* profileName)
{
NS_ASSERTION(profileName, "need a name for this profile");
NS_PRECONDITION(!gCurrentProfile, "started a new profile before stopping another");
JSBool ok = JS_StartProfiling(profileName);
gCurrentProfile = profileName;
return ok ? true : false;
}
/**
* Stop the platform's profiler. For what this means, what happens after
* stopping, and how the profile data can be accessed, check the
* documentation of your platform's profiler.
*
* This is NOT thread safe.
*
* @precondition Profiling was started
* @return true if profiling was successfully stopped.
* @see StartProfiling
*/
inline bool
StopProfiling()
{
NS_PRECONDITION(gCurrentProfile, "tried to stop profile before starting one");
const char* profileName = gCurrentProfile;
gCurrentProfile = 0;
return JS_StopProfiling(profileName) ? true : false;
}
//-----------------------------------------------------------------------------
class ScopedLogging