Bug 232715 - problems with browser after disk sleep. r=pinkerton,sr=sfraser,a=asa

This commit is contained in:
pedemont%us.ibm.com 2004-09-22 18:50:53 +00:00
Родитель 2612c3dddc
Коммит 68529d0e86
1 изменённых файлов: 4 добавлений и 7 удалений

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

@ -202,16 +202,14 @@ void nsToolkitBase::SetupQuartzRendering()
// see // see
// http://developer.apple.com/techpubs/macosx/Darwin/General/IOKitFundamentals/PowerMgmt/chapter_10_section_8.html // http://developer.apple.com/documentation/DeviceDrivers/Conceptual/IOKitFundamentals/PowerMgmt/chapter_10_section_3.html
static void ToolkitSleepWakeCallback(void *refCon, io_service_t service, natural_t messageType, void * messageArgument) static void ToolkitSleepWakeCallback(void *refCon, io_service_t service, natural_t messageType, void * messageArgument)
{ {
switch (messageType) switch (messageType)
{ {
case kIOMessageSystemWillSleep: case kIOMessageSystemWillSleep:
// Handle demand sleep (such as sleep caused by running out of // System is going to sleep now.
// batteries, closing the lid of a laptop, or selecting
// sleep from the Apple menu.
nsToolkitBase::PostSleepWakeNotification("sleep_notification"); nsToolkitBase::PostSleepWakeNotification("sleep_notification");
::IOAllowPowerChange(gRootPort, (long)messageArgument); ::IOAllowPowerChange(gRootPort, (long)messageArgument);
break; break;
@ -221,7 +219,7 @@ static void ToolkitSleepWakeCallback(void *refCon, io_service_t service, natural
// and will sleep soon so you must either allow or cancel // and will sleep soon so you must either allow or cancel
// this notification. Important: if you donÕt respond, there will // this notification. Important: if you donÕt respond, there will
// be a 30-second timeout before the computer sleeps. // be a 30-second timeout before the computer sleeps.
nsToolkitBase::PostSleepWakeNotification("sleep_notification"); // In Mozilla's case, we always allow sleep.
::IOAllowPowerChange(gRootPort,(long)messageArgument); ::IOAllowPowerChange(gRootPort,(long)messageArgument);
break; break;
@ -230,7 +228,6 @@ static void ToolkitSleepWakeCallback(void *refCon, io_service_t service, natural
nsToolkitBase::PostSleepWakeNotification("wake_notification"); nsToolkitBase::PostSleepWakeNotification("wake_notification");
break; break;
} }
} }
void void
@ -271,7 +268,7 @@ nsToolkitBase::RemoveSleepWakeNotifcations()
{ {
if (mSleepWakeNotificationRLS) if (mSleepWakeNotificationRLS)
{ {
IODeregisterForSystemPower(&mPowerNotifier); ::IODeregisterForSystemPower(&mPowerNotifier);
::CFRunLoopRemoveSource(::CFRunLoopGetCurrent(), ::CFRunLoopRemoveSource(::CFRunLoopGetCurrent(),
mSleepWakeNotificationRLS, mSleepWakeNotificationRLS,
kCFRunLoopDefaultMode); kCFRunLoopDefaultMode);