Re: [webkit-dev] Networking proxy on iOS

2016-05-23 Thread Sam Weinig
> On May 22, 2016, at 3:39 PM, Daniel Olegovich Lazarenko > wrote: > > What if I make a bug report in bugzilla about making a design spec of this > feature. I could then write down implementation details options and summarize > all points we've discussed here. Maybe in a

Re: [webkit-dev] RFC: stop using std::chrono, go back to using doubles for time

2016-05-23 Thread Geoffrey Garen
>> Can we go with “WallClock” and “MonotonicClock” instead of “WallTime” and >> “MonotonicTime"? Clock is a nice clear noun. Also, time is an illusion >> caused by parallax in the astral plane. > > I think time is the right term. "3pm" is a "time", not a "clock". Also 42 > seconds since

Re: [webkit-dev] RFC: stop using std::chrono, go back to using doubles for time

2016-05-23 Thread Antti Koivisto
I think the actual issue here was that std::chrono::duration can't represent infinite duration and some of our code has been hacking around that with std::chrono::duration::max(). Clock time + duration is not going to overflow if the duration is natural (a finite constant or produced by diffing

Re: [webkit-dev] RFC: stop using std::chrono, go back to using doubles for time

2016-05-23 Thread Filip Pizlo
On May 23, 2016, at 11:16 AM, Geoffrey Garen wrote: >> 3 - There exists a solution - non-templated custom classes - that removes >> both classes of subtle bugs, without the template creep. > > Hard to argue with this. > > Can we go with “WallClock” and “MonotonicClock”

Re: [webkit-dev] RFC: stop using std::chrono, go back to using doubles for time

2016-05-23 Thread Geoffrey Garen
> 3 - There exists a solution - non-templated custom classes - that removes > both classes of subtle bugs, without the template creep. Hard to argue with this. Can we go with “WallClock” and “MonotonicClock” instead of “WallTime” and “MonotonicTime"? Clock is a nice clear noun. Also, time is

Re: [webkit-dev] RFC: stop using std::chrono, go back to using doubles for time

2016-05-23 Thread Geoffrey Garen
Since double is not a user-defined type, my understanding is that your template specializations in the std namespace are undefined behavior. Geoff > On May 22, 2016, at 10:46 PM, Michal Debski wrote: > > Hi, > > sorry but this really bugs me. Isn't this enough? > >

Re: [webkit-dev] RFC: stop using std::chrono, go back to using doubles for time

2016-05-23 Thread Brian Burg
+1 to Michael’s point. Naming of variables holding seconds/milliseconds is all over the place. So, I would favor using Seconds/WallTime/MonotonicTime classes, since they will basically guarantee that the variable name and/or type will describe the units near use-sites and avoid ambiguity. Not

Re: [webkit-dev] RFC: stop using std::chrono, go back to using doubles for time

2016-05-23 Thread Michael Catanzaro
On Mon, 2016-05-23 at 07:27 -0700, Filip Pizło wrote: > You guys are making a convincing case for > Seconds/WallTime/MonotonicTime! > > -Filip I will add: the convention "double means seconds" is very much not obvious. It's OK when we're careful to consistently use "seconds" in function and

Re: [webkit-dev] RFC: stop using std::chrono, go back to using doubles for time

2016-05-23 Thread Filip Pizło
You guys are making a convincing case for Seconds/WallTime/MonotonicTime! -Filip > On May 22, 2016, at 11:19 PM, Ryosuke Niwa wrote: > > I'm with Brady here. In WebCore, there are enough DOM and network > APIs that mix wall time and monotonically increasing time (e.g. there

Re: [webkit-dev] RFC: stop using std::chrono, go back to using doubles for time

2016-05-23 Thread Filip Pizło
-Filip > On May 23, 2016, at 12:12 AM, Michal Debski wrote: > > Please this example: http://ideone.com/c640Xd > I'm not going to write "WTF::now()" every time I want the time. That's awful! One of the problems with chrono is the use of awkward templates throughout

Re: [webkit-dev] RFC: stop using std::chrono, go back to using doubles for time

2016-05-23 Thread Michal Debski
Please this example: http://ideone.com/c640Xd From cppreference: "(time_point) is implemented as if it stores a value of typeDuration indicating the time interval from the start of the Clock's epoch." "If Rep is floating point, then the duration can represent fractions of ticks."

Re: [webkit-dev] RFC: stop using std::chrono, go back to using doubles for time

2016-05-23 Thread Filip Pizlo
> On May 22, 2016, at 10:46 PM, Michal Debski wrote: > > Hi, > > > > sorry but this really bugs me. Isn't this enough? > > > > namespace WTF { > > using nanoseconds = std::chrono::duration; > using microseconds = std::chrono::duration

Re: [webkit-dev] RFC: stop using std::chrono, go back to using doubles for time

2016-05-23 Thread Ryosuke Niwa
I'm with Brady here. In WebCore, there are enough DOM and network APIs that mix wall time and monotonically increasing time (e.g. there has been proposals to use monodically increasing time in event.prototype.timeStamp even though various event related code relies on it being a wall clock time)