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
Родитель 67b5a8d4fe
Коммит 8a41ff6217
4 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

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

Просмотреть файл

@ -35,13 +35,13 @@
#include "nsISupports.idl" #include "nsISupports.idl"
[scriptable, uuid(25db9b8e-8123-4de1-b36d-8bbbedf2cdf4)] [scriptable, uuid(97c34690-3ca8-4225-9f7d-bcdbb76f29ed)]
interface nsIProfiler : nsISupports interface nsIProfiler : nsISupports
{ {
void StartProfiler(in PRUint32 aInterval, in PRUint32 aEntries); void StartProfiler(in PRUint32 aInterval, in PRUint32 aEntries);
void StopProfiler(); void StopProfiler();
string GetProfile(); string GetProfile();
boolean IsActive(); 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);
}; };

Просмотреть файл

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

Просмотреть файл

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