Closed Bug 367658 Opened 18 years ago Closed 18 years ago

implement nsIIdleService on OS X

Categories

(Core :: Widget, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: sdwilsh, Assigned: sdwilsh)

References

Details

Attachments

(1 file, 3 obsolete files)

It'd be nice to have an implementation for this on OS X as well.
Depends on: 367548
Attached patch v1.0 (obsolete) — Splinter Review
I can't test this due to issues with building, but I want my work somewhere other than just on my computer. Feedback welcome.
Assignee: general → comrade693+bmo
Status: NEW → ASSIGNED
No longer depends on: 367548
I *think* that patch works, but I'm going to let Gijs report on it working or not since he's had much more experience with the idleService stuff already (and knows how to test the heck out of it).
Attached patch v1.1 (obsolete) — Splinter Review
whoops - Gijs pointed out that I was doing my conversion wrong. With that fixed, this works.
Attachment #256036 - Attachment is obsolete: true
Attachment #256556 - Flags: review?(joshmoz)
Comment on attachment 256556 [details] [diff] [review] v1.1 + nsIdleServiceMac.mm \ The file names should just be "nsIdleService.mm", "nsIdleService.h". This is how we want all of our files named, though there are legacy exceptions. The directory they live in tells you the OS. +#ifndef __nsIdleServiceMac_h__ The include guard name should be "nsIdleService_h_" in line with the rest of cocoa widgets. Double underscores are reserved and should not be used. Please change this in the top and bottom of the header. + if (rval != KERN_SUCCESS) { + return NS_ERROR_FAILURE; + } cocoa widgets style nit - Remove braces on these one line blocks so there is a little less clutter. There are one-line if blocks all over. If any block in an if-elsif-else statement is > 1 line, then all should have braces. Please post another patch with these changes. Otherwise looks good! Thanks.
Attachment #256556 - Flags: review?(joshmoz) → review-
Attached patch v1.2 (obsolete) — Splinter Review
Alright, this addresses your comments with the exception of the file name issue. I thought we could change it, but then when I did a test compile I realized that we #include "nsIdleService.h" - which is defined elsewhere and is what allows us to not implement all of the interface for just our widget. So, to go along with other files in the widget dir that seem to be in a similar situation, I tossed on a Cocoa to the end. Hopefully this works. Pending r+, I need to know who's a good candidate for requesting sr from.
Attachment #256556 - Attachment is obsolete: true
Attachment #256761 - Flags: review?(joshmoz)
Attached patch v1.3Splinter Review
We can all agree on file names now!
Attachment #256761 - Attachment is obsolete: true
Attachment #256797 - Flags: superreview?
Attachment #256797 - Flags: review?(joshmoz)
Attachment #256761 - Flags: review?(joshmoz)
Attachment #256797 - Flags: superreview? → superreview?(mikepinkerton)
Comment on attachment 256797 [details] [diff] [review] v1.3 Thanks!
Attachment #256797 - Flags: review?(joshmoz) → review+
Comment on attachment 256797 [details] [diff] [review] v1.3 + NS_IMETHOD GetIdleTime(PRUint32* idleTime); isn't there a macro for this in nsIIdleService? sr=pink
Attachment #256797 - Flags: superreview?(mikepinkerton) → superreview+
(In reply to comment #8) > + NS_IMETHOD GetIdleTime(PRUint32* idleTime); > > isn't there a macro for this in nsIIdleService? No, this is just one method - everything else is defined in nsIdleService and we inherit from that.
Whiteboard: [checkin needed]
widget/src/cocoa/Makefile.in: 1.65 widget/src/cocoa/nsIdleServiceX.h: 1.1 widget/src/cocoa/nsIdleServiceX.mm: 1.1 widget/src/cocoa/nsWidgetFactory.mm: 1.31
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: