Bug 717059. Use double ms instead of float so that the types match. r=ehsan

This commit is contained in:
Benoit Girard 2012-01-12 11:50:43 -05:00
parent 7c5bbfb786
commit fdb1323cce
4 changed files with 12 additions and 12 deletions

View File

@ -92,18 +92,18 @@ nsProfiler::IsActive(bool *aIsActive)
}
NS_IMETHODIMP
nsProfiler::GetResponsivenessTimes(PRUint32 *aCount, float **aResult)
nsProfiler::GetResponsivenessTimes(PRUint32 *aCount, double **aResult)
{
unsigned int len = 100;
const float* times = SAMPLER_GET_RESPONSIVENESS();
const double* times = SAMPLER_GET_RESPONSIVENESS();
if (!times) {
*aCount = 0;
*aResult = nsnull;
return NS_OK;
}
float *fs = static_cast<float *>
(nsMemory::Clone(times, len * sizeof(float)));
double *fs = static_cast<double *>
(nsMemory::Clone(times, len * sizeof(double)));
*aCount = len;
*aResult = fs;

View File

@ -35,13 +35,13 @@
#include "nsISupports.idl"
[scriptable, uuid(25db9b8e-8123-4de1-b36d-8bbbedf2cdf4)]
[scriptable, uuid(97c34690-3ca8-4225-9f7d-bcdbb76f29ed)]
interface nsIProfiler : nsISupports
{
void StartProfiler(in PRUint32 aInterval, in PRUint32 aEntries);
void StopProfiler();
string GetProfile();
boolean IsActive();
void GetResponsivenessTimes(out PRUint32 aCount, [retval, array, size_is(aCount)] out float aResult);
void GetResponsivenessTimes(out PRUint32 aCount, [retval, array, size_is(aCount)] out double aResult);
};

View File

@ -116,7 +116,7 @@ public:
, mTagName(aTagName)
{ }
ProfileEntry(char aTagName, float aTagFloat)
ProfileEntry(char aTagName, double aTagFloat)
: mTagFloat(aTagFloat)
, mLeafAddress(0)
, mTagName(aTagName)
@ -127,7 +127,7 @@ public:
private:
union {
const char* mTagData;
float mTagFloat;
double mTagFloat;
Address mTagAddress;
};
Address mLeafAddress;
@ -538,8 +538,8 @@ bool mozilla_sampler_is_active()
return t->IsActive();
}
float sResponsivenessTimes[100];
float sCurrResponsiveness = 0.f;
double sResponsivenessTimes[100];
double sCurrResponsiveness = 0.f;
unsigned int sResponsivenessLoc = 0;
void mozilla_sampler_responsiveness(TimeStamp aTime)
{
@ -561,7 +561,7 @@ void mozilla_sampler_responsiveness(TimeStamp aTime)
sLastTracerEvent = aTime;
}
const float* mozilla_sampler_get_responsiveness()
const double* mozilla_sampler_get_responsiveness()
{
return sResponsivenessTimes;
}

View File

@ -118,7 +118,7 @@ void mozilla_sampler_start(int aEntries, int aInterval);
void mozilla_sampler_stop();
bool mozilla_sampler_is_active();
void mozilla_sampler_responsiveness(TimeStamp time);
const float* mozilla_sampler_get_responsiveness();
const double* mozilla_sampler_get_responsiveness();
void mozilla_sampler_save();
char* mozilla_sampler_get_profile();
void mozilla_sampler_init();