Bug 794127 - hal::AdjustSystemClock should take a 64-bit value. r=cjones

This commit is contained in:
Gene Lian 2012-09-26 11:51:29 +08:00
parent bc17ca2619
commit aa922bc172
7 changed files with 10 additions and 10 deletions

View File

@ -48,7 +48,7 @@ TimeManager::Set(const JS::Value& date, JSContext* ctx) {
return NS_ERROR_INVALID_ARG;
}
hal::AdjustSystemClock(JS_DoubleToInt32(dateMSec - nowMSec));
hal::AdjustSystemClock(dateMSec - nowMSec);
return NS_OK;
}

View File

@ -441,7 +441,7 @@ NotifySystemTimeChange(const hal::SystemTimeChange& aReason)
}
void
AdjustSystemClock(int32_t aDeltaMilliseconds)
AdjustSystemClock(int64_t aDeltaMilliseconds)
{
AssertMainThread();
PROXY_IF_SANDBOXED(AdjustSystemClock(aDeltaMilliseconds));

View File

@ -242,7 +242,7 @@ void NotifyNetworkChange(const hal::NetworkInformation& aNetworkInfo);
* Adjusting system clock.
* @param aDeltaMilliseconds The difference compared with current system clock.
*/
void AdjustSystemClock(int32_t aDeltaMilliseconds);
void AdjustSystemClock(int64_t aDeltaMilliseconds);
/**
* Set timezone

View File

@ -11,7 +11,7 @@ namespace mozilla {
namespace hal_impl {
void
AdjustSystemClock(int32_t aDeltaMilliseconds)
AdjustSystemClock(int64_t aDeltaMilliseconds)
{}
void

View File

@ -615,7 +615,7 @@ sys_clock_settime(clockid_t clk_id, const struct timespec *tp)
}
void
AdjustSystemClock(int32_t aDeltaMilliseconds)
AdjustSystemClock(int64_t aDeltaMilliseconds)
{
if (aDeltaMilliseconds == 0) {
return;
@ -626,8 +626,8 @@ AdjustSystemClock(int32_t aDeltaMilliseconds)
// Preventing context switch before setting system clock
sched_yield();
clock_gettime(CLOCK_REALTIME, &now);
now.tv_sec += aDeltaMilliseconds/1000;
now.tv_nsec += (aDeltaMilliseconds%1000)*NsecPerMsec;
now.tv_sec += aDeltaMilliseconds / 1000;
now.tv_nsec += (aDeltaMilliseconds % 1000) * NsecPerMsec;
if (now.tv_nsec >= NsecPerSec)
{
now.tv_sec += 1;

View File

@ -131,7 +131,7 @@ parent:
sync GetScreenBrightness() returns (double brightness);
SetScreenBrightness(double brightness);
AdjustSystemClock(int32_t aDeltaMilliseconds);
AdjustSystemClock(int64_t aDeltaMilliseconds);
SetTimezone(nsCString aTimezoneSpec);
sync GetTimezone()
returns (nsCString aTimezoneSpec);

View File

@ -184,7 +184,7 @@ GetLight(hal::LightType light, hal::LightConfiguration* aConfig)
}
void
AdjustSystemClock(int32_t aDeltaMilliseconds)
AdjustSystemClock(int64_t aDeltaMilliseconds)
{
Hal()->SendAdjustSystemClock(aDeltaMilliseconds);
}
@ -592,7 +592,7 @@ public:
}
virtual bool
RecvAdjustSystemClock(const int32_t &aDeltaMilliseconds) MOZ_OVERRIDE
RecvAdjustSystemClock(const int64_t &aDeltaMilliseconds) MOZ_OVERRIDE
{
if (!AssertAppProcessPermission(this, "time")) {
return false;