Bug 134293 - [Mac] Update the time base of event's timestamp when the system time changes
Summary: [Mac] Update the time base of event's timestamp when the system time changes
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-24 23:56 PDT by Benjamin Poulain
Modified: 2014-06-25 13:42 PDT (History)
6 users (show)

See Also:


Attachments
Patch (2.38 KB, patch)
2014-06-25 00:01 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 2014-06-24 23:56:26 PDT
[Mac] Update the time base of event's timestamp when the system time changes
Comment 1 Benjamin Poulain 2014-06-25 00:01:41 PDT
Created attachment 233793 [details]
Patch
Comment 2 WebKit Commit Bot 2014-06-25 00:03:08 PDT
Attachment 233793 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:332:  More than one command on the same line  [whitespace/newline] [4]
ERROR: Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:332:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:338:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:339:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:340:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 5 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Anders Carlsson 2014-06-25 07:18:22 PDT
Comment on attachment 233793 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=233793&action=review

> Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:332
> +        void (^updateBlock)(NSNotification *) = Block_copy(^(NSNotification *){ updateSystemStartupTimeIntervalSince1970(); });

There's no need to copy the block, it will be copied by addObserverForName. I'd just use a lambda instead of a block too (they're implicitly converted to blocks, so something like):

auto updateBlock = [](NSNotification *) { updateSystemStartupTimeIntervalSince1970(); };
Comment 4 Benjamin Poulain 2014-06-25 09:40:15 PDT
(In reply to comment #3)
> (From update of attachment 233793 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=233793&action=review
> 
> > Source/WebCore/platform/mac/PlatformEventFactoryMac.mm:332
> > +        void (^updateBlock)(NSNotification *) = Block_copy(^(NSNotification *){ updateSystemStartupTimeIntervalSince1970(); });
> 
> There's no need to copy the block, it will be copied by addObserverForName. I'd just use a lambda instead of a block too (they're implicitly converted to blocks, so something like):

The reason I did that is to avoid having the block copied twice with 2 separate heap allocation.
Comment 5 Benjamin Poulain 2014-06-25 13:42:45 PDT
Comment on attachment 233793 [details]
Patch

Clearing flags on attachment: 233793

Committed r170434: <http://trac.webkit.org/changeset/170434>
Comment 6 Benjamin Poulain 2014-06-25 13:42:49 PDT
All reviewed patches have been landed.  Closing bug.