author Tom Ritter <>
Fri, 12 Jan 2018 13:36:04 -0600
changeset 399590 17bf5819b42fa3b656f2d3c565bc4fb0ca050066
parent 1 9b2a99adc05e53cd4010de512f50118594756650
permissions -rw-r--r--
Bug 1429764 Do not call ReduceTimerPrecision twice for DOM Navigation timers r=bkelly,timhuang Bug 1429764 details a test failure that was asserting that the performance navigation timers were strictly increasing (or equal). fetchStart should have a timestamp before domainLookupStart. But it didn't. The problem is two-fold. This corrects the test and the issue by addressing one part of the problem, the second part of the problem needs to be written up in a new bug and addressed there. (That bug is not yet filed at writing, but see dependencies of 1429764 in the future to find it.) The second, and underlying, problem is that calling ReduceTimerPrecision with the same value multiple times may continually reduce it. Meaning that the first you call it with, say, .75, (and a precision of .20), it will be reduced to .6. The second time you call it (with .6), instead of staying at .6 it will be reduced to .4. This is because floats are fuzzy. Inside ReduceTimerPrecision we are multiplying a decimal by a decimal, so while floor(.6 / .20) should equal 3, sometimes it's actually 2.999... which gets floors to 2, gets multiplied again by .2, and which results in .4 If that's the underlying problem, the first, and surface, problem is - why are we calling ReduceTimerPrecision multiple times? We shouldn't be. That's what this patch fixes. TimeStampToDOMHighResOrFetchStart will return either TimeStampToDOMHighRes() or FetchStartHighRes(). FetchStartHighRes() internally calls TimeStampToDOMHighRes and then ReduceTimerPrecision - this is where (some of) the two reduction calls happen - because TimeStampToDOMHighRes itself calls ReduceTimerPrecision also. I remove the ReduceTimerPrecision from TimeStampToDOMHighRes. FetchStartHighRes will now only call ReduceTimerPrecision once, at the end of the return. But we have to fix places we call TimeStampToDOMHighResOrFetchStart, because the callers of that function also call ReduceTimerPrecision. So if TimeStampToDOMHighResOrFetchStart returned FetchStartHighRes, we'd be calling ReduceTimerPrecision twice for those callers. So inside first off, we remove the outer call to ReduceTimerPrecision. that surrounds the 5 or so callsites of TimeStampToDOMHighResOrFetchStart. Then inside of TimeStampToDOMHighResOrFetchStart we return either FetchStartHighRes (which is has already called ReduceTimerPrecision) or we call ReduceTimerPrecision with the value. Now. TimeStampToDOMHighRes was used in more places than just FetchStartHighRes - there were several other places where we were doing double rounding, and this fixed those as well. AsyncOpenHighRes, WorkerStartHighRes, DomainLookupEndHighRes, ConnectStartHighRes, SecureConnectionStartHighRes, ConnectEndHighRes, and ResponseEndHighRes. MozReview-Commit-ID: K5nHql135rb

Please be apprised of the following Legal Notices:

A) The U.S. District Court for the Eastern District of Virginia has
ruled that the Netscape Navigator code does not infringe Wang's U.S.
Patent No. 4,751,669 ("the '669 Patent") because: 1) HTML is not
Videotex as defined by the '669 patent; 2) web servers are not central
suppliers; and 3) Navigator does not "connect," as defined by the '669
Patent, to web servers on the Internet. Wang may appeal this decision to
the Federal Circuit. Wang contended that its Patent disclosing a
"Videotex" system, is infringed by the following functionality in the
Netscape Navigator code: 1) the animated logo and status line indicators
--See Claims 1,8 and 9; 2) the "File Save As" function --See Claims
23-27; 3) Bookmarks and Rename Bookmarks in the Properties window --See
Claims 20-22; 4) storing HTML, GIF, and JPEG files and adding filename
extensions --See Claim 38

B) Intermind owns pending U.S. patent applications on communications
systems which employ metadata ("channel objects") to define a control
structure for information transfer. The Netscape code does not infringe
as released; however, modifications which utilize channel objects as
described by Intermind should be considered carefully. The following is
a statement from Intermind: "Intermind's claims fundamentally involve
the use of a control structure to automate communications. ...The
essence of Intermind's top claim is that two devices sender and receiver
have persistent storage, communicate over a network, and exchange a
control structure including metadata which describes: 1) what
information is to be updated, 2) when to update this information, and 3)
how to transfer the updated information. In addition, at least the
receiving device must be able to process the metadata in order to
perform the update determination and transfer. Any digital
communications system which incorporates all of these elements will be
covered by Intermind's patents." See

C) Stac, Inc., and its licensing agent Hi/fn, own several patents which
disclose data compression methods implementing an LZS compression
algorithm, including U.S. Patent Nos. 4,701,745 and 5,016, 009 ("the
Stac Patents"). The Netscape Communicator code does not perform
compression. If you modify the Netscape source code to perform
compression, please take notice of the Stac Patents.

D) Netscape Communications Corporation ("Netscape") does not guarantee
that any source code or executable code available from the
domain is Year 2000 compliant.