Bug 121599 - [WIN] Replace CF time functions with Windows API functions in WebHistory
Summary: [WIN] Replace CF time functions with Windows API functions in WebHistory
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows 7
: P2 Normal
Assignee: Patrick R. Gansterer
URL:
Keywords:
Depends on: 121601
Blocks: 122010
  Show dependency treegraph
 
Reported: 2013-09-19 03:23 PDT by Patrick R. Gansterer
Modified: 2013-09-27 05:33 PDT (History)
9 users (show)

See Also:


Attachments
Patch (10.43 KB, patch)
2013-09-19 03:30 PDT, Patrick R. Gansterer
eflews.bot: commit-queue-
Details | Formatted Diff | Diff
Patch (8.96 KB, patch)
2013-09-19 03:49 PDT, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff
Patch (8.97 KB, patch)
2013-09-20 05:50 PDT, Patrick R. Gansterer
bfulgham: review-
Details | Formatted Diff | Diff
Patch (7.26 KB, patch)
2013-09-24 01:38 PDT, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff
Patch (7.47 KB, patch)
2013-09-25 12:12 PDT, Patrick R. Gansterer
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick R. Gansterer 2013-09-19 03:23:40 PDT
[WIN] Replace CF time functions with Windows API functions in WebHistory
Comment 1 Patrick R. Gansterer 2013-09-19 03:30:07 PDT
Created attachment 212047 [details]
Patch
Comment 2 EFL EWS Bot 2013-09-19 03:36:52 PDT
Comment on attachment 212047 [details]
Patch

Attachment 212047 [details] did not pass efl-wk2-ews (efl-wk2):
Output: http://webkit-queues.appspot.com/results/1955082
Comment 3 kov's GTK+ EWS bot 2013-09-19 03:37:21 PDT
Comment on attachment 212047 [details]
Patch

Attachment 212047 [details] did not pass gtk-ews (gtk):
Output: http://webkit-queues.appspot.com/results/1955083
Comment 4 Early Warning System Bot 2013-09-19 03:37:26 PDT
Comment on attachment 212047 [details]
Patch

Attachment 212047 [details] did not pass qt-ews (qt):
Output: http://webkit-queues.appspot.com/results/1961107
Comment 5 Early Warning System Bot 2013-09-19 03:38:06 PDT
Comment on attachment 212047 [details]
Patch

Attachment 212047 [details] did not pass qt-wk2-ews (qt-wk2):
Output: http://webkit-queues.appspot.com/results/2006003
Comment 6 Patrick R. Gansterer 2013-09-19 03:49:08 PDT
Created attachment 212049 [details]
Patch
Comment 7 Patrick R. Gansterer 2013-09-20 05:50:00 PDT
Created attachment 212154 [details]
Patch
Comment 8 Brent Fulgham 2013-09-23 15:25:49 PDT
Comment on attachment 212154 [details]
Patch

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

The general intent of this change is fine, but I would prefer not to lose the two methods (ageLimitDate and timeToDate).  The other client I was concerned about uses the WebKIt COM API, so switching to DATE over CFAbsoluteTime should be fine.

r- to avoid removing the two methods, but otherwise this is fine.

> Source/WebKit/win/WebHistory.cpp:645
> +    }

It would be nice if the above code was contained in a  static function that consumed the 'day' argument and returned the 'beginningOfNextDayLocalTime' and 'beginningLocalTime' values.

> Source/WebKit/win/WebHistory.cpp:650
> +    VariantTimeToSystemTime(date, &beginningOfNextDayLocalTime);

... including this fix-up code.

> Source/WebKit/win/WebHistory.cpp:-722
> -CFAbsoluteTime WebHistory::timeToDate(CFAbsoluteTime time)

This is needed by ageLimitDate.

> Source/WebKit/win/WebHistory.cpp:-738
> -HRESULT WebHistory::ageLimitDate(CFAbsoluteTime* time)

I don't think we should get rid of this. I was thinking of making use of it for the WinLauncher program.  But it would be okay to use a DATE argument if you wanted.

> Source/WebKit/win/WebHistory.h:-142
> -    HRESULT ageLimitDate(CFAbsoluteTime* time);

We need to keep this.

> Source/WebKit/win/WebHistory.h:-144
> -    static CFAbsoluteTime timeToDate(CFAbsoluteTime time);

Don't remove this, as it is needed by ageLimitDate.
Comment 9 Patrick R. Gansterer 2013-09-23 15:34:50 PDT
Comment on attachment 212154 [details]
Patch

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

>> Source/WebKit/win/WebHistory.cpp:645
>> +    }
> 
> It would be nice if the above code was contained in a  static function that consumed the 'day' argument and returned the 'beginningOfNextDayLocalTime' and 'beginningLocalTime' values.

sure we want to call VariantTimeToSystemTime(day, &systemTime) then twice? Or pass beginningLocalTime to beginningOfNext() and return it as local time (including the fix-up)

>> Source/WebKit/win/WebHistory.h:-142
>> -    HRESULT ageLimitDate(CFAbsoluteTime* time);
> 
> We need to keep this.

who uses it? it's a private method...
Comment 10 Patrick R. Gansterer 2013-09-23 15:45:58 PDT
Comment on attachment 212154 [details]
Patch

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

>> Source/WebKit/win/WebHistory.cpp:-738
>> -HRESULT WebHistory::ageLimitDate(CFAbsoluteTime* time)
> 
> I don't think we should get rid of this. I was thinking of making use of it for the WinLauncher program.  But it would be okay to use a DATE argument if you wanted.

there is no CF-stuff in the public API, so it can't be used as it is IMO. why keep then a unused method instead of getting it back from svn history when needed?
Comment 11 Brent Fulgham 2013-09-23 16:29:25 PDT
Comment on attachment 212154 [details]
Patch

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

>>> Source/WebKit/win/WebHistory.cpp:645
>>> +    }
>> 
>> It would be nice if the above code was contained in a  static function that consumed the 'day' argument and returned the 'beginningOfNextDayLocalTime' and 'beginningLocalTime' values.
> 
> sure we want to call VariantTimeToSystemTime(day, &systemTime) then twice? Or pass beginningLocalTime to beginningOfNext() and return it as local time (including the fix-up)

Why do we need to call VariantTimeToSystemTime twice? Can't we just return "beginningOfLocalTime" along with "beginningOfNextDayLocalTime" and then use them for the rest of the logic?

>>> Source/WebKit/win/WebHistory.cpp:-738
>>> -HRESULT WebHistory::ageLimitDate(CFAbsoluteTime* time)
>> 
>> I don't think we should get rid of this. I was thinking of making use of it for the WinLauncher program.  But it would be okay to use a DATE argument if you wanted.
> 
> there is no CF-stuff in the public API, so it can't be used as it is IMO. why keep then a unused method instead of getting it back from svn history when needed?

Okay -- you've convinced me.  Ditch it and the "timeToDate" method.

>>> Source/WebKit/win/WebHistory.h:-142
>>> -    HRESULT ageLimitDate(CFAbsoluteTime* time);
>> 
>> We need to keep this.
> 
> who uses it? it's a private method...

Okay

>> Source/WebKit/win/WebHistory.h:-144
>> -    static CFAbsoluteTime timeToDate(CFAbsoluteTime time);
> 
> Don't remove this, as it is needed by ageLimitDate.

Disregard this comment.
Comment 12 Patrick R. Gansterer 2013-09-24 01:38:34 PDT
Created attachment 212439 [details]
Patch
Comment 13 Brent Fulgham 2013-09-25 11:32:13 PDT
Comment on attachment 212439 [details]
Patch

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

Looks good to me, with some minor nits.

> Source/WebKit/win/WebHistory.cpp:100
> +    VariantTimeToSystemTime(day, &systemTime);

We have been prefixing these Windows API calls with :: (e.g., "::VariantTimeToSystemTime(...)" and "::SystemTimeToTzSpecificLocalTime(...)").
Comment 14 Patrick R. Gansterer 2013-09-25 12:12:07 PDT
Created attachment 212615 [details]
Patch
Comment 15 WebKit Commit Bot 2013-09-25 16:16:59 PDT
Comment on attachment 212615 [details]
Patch

Clearing flags on attachment: 212615

Committed r156430: <http://trac.webkit.org/changeset/156430>
Comment 16 WebKit Commit Bot 2013-09-25 16:17:02 PDT
All reviewed patches have been landed.  Closing bug.