Bug 790117: XPCOM test harness: Delete unused profiler control functions. r=bsmedberg
authorJim Blandy <jimb@mozilla.com>
Fri, 21 Sep 2012 16:36:13 -0700
changeset 107781 87bcca77b8579875a593fddaa71b8ef91aee8be5
parent 107780 1233552047f475bb011dd35f6ad59dcb63659678
child 107782 6fd36867bac751417fce03468cbe2c771810f24c
push id1708
push userakeybl@mozilla.com
push dateMon, 19 Nov 2012 21:10:21 +0000
treeherdermozilla-esr52@2704e441363f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs790117
milestone18.0a1
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.
xpcom/tests/TestHarness.h
--- a/xpcom/tests/TestHarness.h
+++ b/xpcom/tests/TestHarness.h
@@ -75,67 +75,16 @@ void passed(const char* msg, ...)
   va_start(ap, msg);
   vprintf(msg, ap);
   va_end(ap);
 
   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
 {
 public:
     ScopedLogging()
     {
         NS_LogInit();
     }