RESOLVED FIXED 46935
WebCore uses the main thread to process sleep notifications
https://bugs.webkit.org/show_bug.cgi?id=46935
Summary WebCore uses the main thread to process sleep notifications
Anders Carlsson
Reported 2010-09-30 14:06:31 PDT
WebCore uses the main thread to process sleep notifications
Attachments
Patch (10.57 KB, patch)
2010-09-30 14:23 PDT, Anders Carlsson
darin: review+
Anders Carlsson
Comment 1 2010-09-30 14:09:07 PDT
Anders Carlsson
Comment 2 2010-09-30 14:23:02 PDT
Darin Adler
Comment 3 2010-09-30 14:39:17 PDT
Comment on attachment 69383 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=69383&action=review > WebCore/platform/mac/SharedTimerMac.mm:40 > +#define IOKIT_CAN_USE_LIBDISPATCH 1 I’d like this to be reversed. Maybe IOKIT_WITHOUT_LIBDISPATCH? > WebCore/platform/mac/SharedTimerMac.mm:67 > + static void systemPowerCallback(void* context, io_service_t service, uint32_t messageType, void* messageArgument); > + void systemPowerCallback(io_service_t service, uint32_t messageType, void* messageArgument); The argument name service could be left out in these two function declarations. > WebCore/platform/mac/SharedTimerMac.mm:143 > +#ifdef IOKIT_CAN_USE_LIBDISPATCH > + // We need to call the timer functions on the main thread. > + CFRunLoopPerformBlock(CFRunLoopGetMain(), kCFRunLoopCommonModes, ^() { > +#endif > > - if (WebCore::sharedTimer) { > - WebCore::stopSharedTimer(); > - WebCore::timerFired(0, 0); > + if (sharedTimer) { > + stopSharedTimer(); > + timerFired(0, 0); > } > + > +#ifdef IOKIT_CAN_USE_LIBDISPATCH > + }); > +#endif > } You could do this more cleanly if the body here was a member function. Then you could call it in the block and in the #else and not feel the need to use #if in this fancier way.
mitz
Comment 4 2010-09-30 14:40:47 PDT
Comment on attachment 69383 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=69383&action=review > WebCore/WebCore.xcodeproj/project.pbxproj:20875 > + developmentRegion = English; Please don’t commit this. > WebCore/platform/mac/SharedTimerMac.mm:30 > +#import <IOKit/pwr_mgt/IOPMLib.h> > +#import <IOKit/IOMessage.h> I comes before p. > WebCore/platform/mac/SharedTimerMac.mm:67 > + void systemPowerCallback(io_service_t service, uint32_t messageType, void* messageArgument); This is not a great name for this method.
Anders Carlsson
Comment 5 2010-09-30 15:02:07 PDT
Note You need to log in before you can comment on or make changes to this bug.