RESOLVED FIXED Bug 77885
Use CMClock as a timing source for PlatformClock where available.
https://bugs.webkit.org/show_bug.cgi?id=77885
Summary Use CMClock as a timing source for PlatformClock where available.
Jer Noble
Reported 2012-02-06 11:07:54 PST
Use CMClock as a timing source for PlatformClock where available.
Attachments
Patch (14.05 KB, patch)
2012-02-06 11:17 PST, Jer Noble
no flags
Patch (13.85 KB, patch)
2012-02-06 11:18 PST, Jer Noble
eric.carlson: review+
Jer Noble
Comment 1 2012-02-06 11:17:08 PST
Jer Noble
Comment 2 2012-02-06 11:18:40 PST
Eric Carlson
Comment 3 2012-02-07 08:29:59 PST
Comment on attachment 125672 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=125672&action=review > Source/WebCore/platform/mac/PlatformClockCM.mm:48 > +static const int32_t DefaultTimeScale = 1000; Please include a comment explaining why 1000 is the best magic timescale. > Source/WebCore/platform/mac/PlatformClockCM.mm:57 > + CMAudioDeviceClockCreate(kCFAllocatorDefault, NULL, &rawClockPtr); > + RetainPtr<CMClockRef> clock(AdoptCF, rawClockPtr); > + initializeWithTimingSource(clock.get()); Is the temporary RetainPtr necessary?
Jer Noble
Comment 4 2012-02-07 09:53:49 PST
(In reply to comment #3) > (From update of attachment 125672 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=125672&action=review > > > Source/WebCore/platform/mac/PlatformClockCM.mm:48 > > +static const int32_t DefaultTimeScale = 1000; > > Please include a comment explaining why 1000 is the best magic timescale. Sure thing. > > Source/WebCore/platform/mac/PlatformClockCM.mm:57 > > + CMAudioDeviceClockCreate(kCFAllocatorDefault, NULL, &rawClockPtr); > > + RetainPtr<CMClockRef> clock(AdoptCF, rawClockPtr); > > + initializeWithTimingSource(clock.get()); > > Is the temporary RetainPtr necessary? Not strictly, no. But the RetainPtr takes care of null-checking before calling CFRelease, and does so even if an exception is thrown. And I've been yelled at* for not using RetainPtrs for temporary variables before. ;) *figuratively
Jer Noble
Comment 5 2012-02-07 12:48:47 PST
Note You need to log in before you can comment on or make changes to this bug.