Commit graph

52 commits

Author SHA1 Message Date
André Bargull
f1831391a5 Bug 1346211 - Part 2: Split JS::ResetTimeZone into an external and internal implementation. r=Waldo
--HG--
extra : rebase_source : fc82dfa4175065c9d8f32fd140512fe0ecbbd734
2018-08-16 09:13:18 -07:00
Kris Maglione
9604944ae4 Bug 1473631: Part 5 - Replace pref observers with callbacks in RFPService. r=njn
MozReview-Commit-ID: 6rzZNyY8cun

--HG--
extra : rebase_source : 651ba7e475548ab28a678662fbf287faf2dec0aa
2018-07-05 13:49:22 -07:00
Jeff Gilbert
5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Xidorn Quan
5896b33074 Bug 1461933 - Remove ServoBindings.h from ComputedStyleInline.h. r=emilio
For doing this, ServoComputedData is split into separate files, so that
files don't need to include ServoBindings.h just for accessing style
structs from ComputedStyles.

MozReview-Commit-ID: DPAd7PUUCl9

--HG--
extra : rebase_source : 7d6f739b7fb58a46e1624ba62e717412057ea9c1
2018-05-16 15:35:59 +10:00
Tom Ritter
9b2ccc4508 Bug 1418162 Use a build constant to determine update channel, and update ESR equation for 60 r=froydnj,Gijs
Previously we used Services.appinfo.defaultUpdateChannel to determine if we were on ESR
and if so, we would assert to make sure the ESR equation hadn't changed. But that method
is a footgun.  We could use UpdateUtils.getUpdateChannel, but for our purposes here, the
compile-time constant will work just as well.

If it's set correctly, for Mozilla, we will perform our assert check. If it's not set to
esr (e.g. for Tor), they'll skip the assert. They probably want to control their user agent
themselves anyway.

MozReview-Commit-ID: DLnWSEpCVJ6

--HG--
extra : rebase_source : 0559a10ba1d871a598b1004092840ddf502eef47
2018-02-19 09:43:27 -06:00
Tom Ritter
3705fef918 Bug 1446346 Do not clamp or jitter the AudioContext's CurrentTime if its interval is larger than our precision. r=jib
MozReview-Commit-ID: Bc1cto3pBKL

--HG--
extra : rebase_source : ace58df9f1669beacc176ab968f45a09ca44be2e
2018-04-17 15:35:51 -05:00
Tom Ritter
10c0b3f75c Bug 1451790 Set Time Precision to 1ms with Jitter r=baku
MozReview-Commit-ID: 1uvEK2We4OQ

--HG--
extra : rebase_source : 5e6bbabdf390b757f2deac50e97bb5cfbda02982
2018-04-05 11:37:36 -05:00
Tom Ritter
278a49f747 Bug 1448869 Set Timer Precision to 100 us (with Jitter) r=baku
MozReview-Commit-ID: HV1rG4Kzg9k

--HG--
extra : rebase_source : ff1c8afa3a58081a6846f6b5a2dc868e4ae5af61
2018-03-26 11:41:59 -05:00
Tom Ritter
f264d40a2e Bug 1447685 Move nsIRandomGenerator creation out of a lock to avoid a deadlock r=keeler
do_GetService("@mozilla.org/security/random-generator;1" may initialize NSS.
NSS Initialization occurs on Main Thread only.

If we lock on a subthread, then try to initialize NSS, it _might_ be the case
that the main thread is blocked on the same lock (same location or a different
one.) NSS can't initialize on Main Thread - deadlock.

Move do_GetService out of the lock. Now if NSS tries to initialize on a
subthread, the main thead can't be blocked (because the subthread hasn't locked
anything.)

Now, the only statements that occur in locks are pointer asignment, new, memcpy,
and randomGenerator->GenerateRandomBytes.

MozReview-Commit-ID: 9C1Ok910A11

--HG--
extra : rebase_source : 637ca346a343722bd7a4fc68c4fd43a85916d5a6
2018-03-22 13:09:23 -05:00
Tom Ritter
2447e5f827 Bug 1440195 Do not check for NSS Initialization before performing jitter r=keeler
Previously we needed this check because we were jittering before NSS was initialized
and this was causing tests to fail (primarily xpcshell and Marionette) because
NSS was being initialied before there was a profile directory.

In Bug 1443943 we only jitter non-System Principal calls and that reduces the early
jitter causes. Ultimately we got to a place where everything was looking okay whether
or not NSS was initialized by the time we got here, so we can simply this code and
simply always perform jittering (if it's enabled and we're not in System Principal
code.)

MozReview-Commit-ID: Dgfi8Z1hHfB

--HG--
extra : rebase_source : 3fcda9b77f3452d85959a639a7361101cc071cd6
2018-03-09 21:27:44 -06:00
Tom Ritter
82cfa8d0d0 Bug 1440195 Actually integrate the context mix-in into the hash function calculation r=baku
MozReview-Commit-ID: 4k7w683UJOY

--HG--
extra : rebase_source : b0bac35eede3538bb68d37510525716c0a2fbb3d
2018-03-09 16:26:56 -06:00
Tom Ritter
16f0facaae Bug 1440195 For timestamps that are absolute, specify a null context pointer r=baku
Note that by not using the same context pointer for all timestamps within a single
'communication group' (that is, all things that can communication to each other
in JavaScript), it's possible to observe time going backwards.

Imagine comparing
  performance.timeOrigin + performance.now() < new File([], "").lastModified

In theory this should always be true. However, if performance.now() was jittered
up (using one context pointer, because it is a relative timestamp) and File was
jittered down (using a null context pointer, because it is an absolute timestamp)
then this may evaluate to False.

I think this is okay.

MozReview-Commit-ID: BfgbmGS8XdD

--HG--
extra : rebase_source : 1d105d9b63e61561be06dbfe2a3fccf534ee68b3
2018-02-28 15:37:26 -06:00
Tom Ritter
748c732d15 Bug 1440195 Add a per-context mix-in value for our Timer Precision Reduction Functions r=baku
We need to include a seed for each context (origin, iframe, worker, etc) we reduce
the time precision of. This prevents a replay attack of the random midpoint sequence.

MozReview-Commit-ID: EFoHev1SrTM

--HG--
extra : rebase_source : ba92262abaa7b6b20f40423b2dfa749e2a9c43a9
2018-03-09 16:22:37 -06:00
Tom Ritter
04cae16024 Bug 1444588 - Move LRUCache Initialization to startup rather than lazily. r=baku
Before, we would initialize LRUCache on the first instance of
calling the Timer Precision Reduction functions. We would both
allocate and initialize it, and call ClearOnShutdown.

ClearOnShutdown can only be called on the Main Thread, but it
just so happened that we always did that, so there was no
problem. Now that we are not calling precision reduction for
system callers, we were initializing on a non-main-thread and
we need to avoid that.

In the future, we could reduce memory use IF we are not using
the timer precision reduction functions by figuring out how
to initialize this lazily but still on the main thread. For
now, because we are using the timer precision reduction
functions, doing so would not save us any memory.

MozReview-Commit-ID: 6YGeAlCPReZ
2018-03-13 10:58:59 -07:00
Tom Ritter
7145476435 Bug 1442515 Turn MOZ_LOG's in Timer Reduction on in non-debug builds also r=baku
MozReview-Commit-ID: C3JkX8RogeW

--HG--
extra : rebase_source : 99631463616a8ec1071f5f37106772d219cdfe16
2018-03-06 10:15:39 -06:00
Arthur Edelstein
9f50791de3 Bug 1433592 - Don't spoof ctrl key modifier for privacy.resistFingerprinting=true r=masayuki
--HG--
extra : rebase_source : 496e8df361f71471f62854546d15e042ca24e703
2018-03-05 23:23:00 +02:00
Tom Ritter
4d71507eac Bug 1442984 - Correct pointer math in timer fuzzing. r=baku
Negative input times would carry a negative sign all the way
through to where we do pointer math. That's bad, and embaressing.

As far as I know, there was no way to have the resulting value be
outside [-32, 28]. We coerce it down to [0, 28] to always stay in
bounds.
2018-03-05 13:04:32 -06:00
Tom Ritter
5345bfb157 Bug 1425462 Do not use crypto functions if NSS is not initialized. r=nwgh
Doing so caused nearly every xpcshell test to fail, as well as Marionette.
This is safe, because we're not going to be doing any web context stuff before NSS is
initialized, so anything that winds up here won't be exposed to content so we don't
really need to worry about fuzzing its value.

MozReview-Commit-ID: KiFSIbjQnN3

--HG--
extra : rebase_source : cb93648d40e75a7a736763e54dfd8c387249989a
2018-03-02 10:05:19 -06:00
Tom Ritter
e7fb93bb60 Bug 1425462 Refactor the static members into static globals to avoid leakchecks. r=ckerschb
MozReview-Commit-ID: 2lm1Skf3KEH

--HG--
extra : rebase_source : 86c040ec1981464166db47919d00d36817bc2e90
2018-03-01 05:24:36 -06:00
Tom Ritter
c095f67f73 Bug 1425462 Turn jitter on by default. r=luke
MozReview-Commit-ID: 9u0rJ8FoteG

--HG--
extra : rebase_source : 5f5256b92bbc7ff7cdade00d32c9aa9d68650347
2018-02-15 15:35:42 -06:00
Tom Ritter
939dbfc4aa Bug 1425462 Sprinkle some thread safety on the LRU Cache. r=handyman
We use a mozilla:Mutex to avoid race conditions in the LRU Cache

MozReview-Commit-ID: DyeK4RUnGhP

--HG--
extra : rebase_source : d8f134fd33c914066766cc713292cb0246b05467
2018-02-24 08:21:15 -06:00
Tom Ritter
4b715680d2 Bug 1425462 Normalize the JavaScript Engine behavior by adding a callback r=luke
Time Precision Reduction in the JS Engine was handled by a small bit of
duplicated logic. With Time Jittering, and general improvements to the
logic due to float fuzziness, we want to unify the logic for the JS Engine
and the browser into one location. This patch does that.

Note that this will leave the JS Shell without a time jittering implementation.
It currently has a time clamping implementation - but I'm not actually sure if
the shell is doing anything with it, because it's probably not calling
SetTimeResolutionUsec to set it up.  In Bug 1440539 we will add a jitter
implementation for the shell. (And probably turn time rounding and jittering on
for it too.)

MozReview-Commit-ID: 2BTIMzE8MjW

--HG--
extra : rebase_source : db5cd6a219e1b89988f142fc22994bf816507889
2018-02-22 16:05:50 -06:00
Tom Ritter
845ef57dd6 Bug 1425462 When reducing the precision of timestamps, also apply fuzzytime to them r=bkelly
Fuzzytime deterministically generates a random midpoint between two clamped values,
and if the unreduced timestamp is above the midpoint, the time is rounded upwards.
This allows safe time jittering to occur, as time will never go backwards on a given
timeline.

It _is_ possible for time to go backwards when comparing different (but related)
timelines, such as a relative timeline in one page (with its own
performance.timeOrigin) and a relative timeline in an iframe or Worker (which
also has its own performance.timeOrigin). This is the same behavior as the 2ms timer
reduction we previously landed; jitter doesn't make this any better or worse.

MozReview-Commit-ID: IdRLxcWDQBZ

--HG--
extra : rebase_source : 40b29d34e5cc99f9b8e6d5e711a03b9fe9bfa595
2018-03-01 00:07:03 -06:00
Andreea Pavel
bdfa57bfea Backed out changeset f15ab7984211 (bug 1433592) for failing browser chrome at browser/components/resistfingerprinting/test/browser/browser_spoofing_keyboard_event.js on a CLOSED TREE 2018-03-02 13:03:58 +02:00
Arthur Edelstein
84e459b0c3 Bug 1433592 - Don't spoof ctrl key modifier for privacy.resistFingerprinting=true r=masayuki 2018-03-01 16:25:00 +02:00
Dorel Luca
cafaae9ee7 Backed out 6 changesets (bug 1425462) for XPCShell failure on multiple files
Backed out changeset 9ace3811f525 (bug 1425462)
Backed out changeset 7d440e52e3a4 (bug 1425462)
Backed out changeset 85896ea96faf (bug 1425462)
Backed out changeset 127b5d2e6779 (bug 1425462)
Backed out changeset 95ce64d3a29a (bug 1425462)
Backed out changeset ddd2c4da4ba4 (bug 1425462)
2018-03-02 03:33:17 +02:00
Tom Ritter
f30fdd2919 Bug 1425462 Refactor the static members into static globals to avoid leakchecks r=ckerschb
MozReview-Commit-ID: 2lm1Skf3KEH

--HG--
extra : rebase_source : e58301f88481a0f2b1005ed69ab2a8ae2fda3417
2018-03-01 05:24:36 -06:00
Tom Ritter
65a1409f60 Bug 1425462 Turn jitter on by default r=luke
MozReview-Commit-ID: 9u0rJ8FoteG

--HG--
extra : rebase_source : e00a72098e22c3d3f5aa559a65a7efc38ae12ee1
2018-02-15 15:35:42 -06:00
Tom Ritter
d6f1f6bf94 Bug 1425462 Sprinkle some thread safety on the LRU Cache r=handyman
We use a mozilla:Mutex to avoid race conditions in the LRU Cache

MozReview-Commit-ID: DyeK4RUnGhP

--HG--
extra : rebase_source : 5b7dcf41bc8053236372177585af0eb2e3b72055
2018-02-24 08:21:15 -06:00
Tom Ritter
ec702ca7c3 Bug 1425462 Normalize the JavaScript Engine behavior by adding a callback r=luke
Time Precision Reduction in the JS Engine was handled by a small bit of
duplicated logic. With Time Jittering, and general improvements to the
logic due to float fuzziness, we want to unify the logic for the JS Engine
and the browser into one location. This patch does that.

Note that this will leave the JS Shell without a time jittering implementation.
It currently has a time clamping implementation - but I'm not actually sure if
the shell is doing anything with it, because it's probably not calling
SetTimeResolutionUsec to set it up.  In Bug 1440539 we will add a jitter
implementation for the shell. (And probably turn time rounding and jittering on
for it too.)

MozReview-Commit-ID: 2BTIMzE8MjW

--HG--
extra : rebase_source : 035f84a88413e2ea34b239ae0228e9c1ec9a39d7
2018-02-22 16:05:50 -06:00
Tom Ritter
06ecc9a63d Bug 1425462 When reducing the precision of timestamps, also apply fuzzytime to them r=bkelly
Fuzzytime deterministically generates a random midpoint between two clamped values,
and if the unreduced timestamp is above the midpoint, the time is rounded upwards.
This allows safe time jittering to occur, as time will never go backwards on a given
timeline.

It _is_ possible for time to go backwards when comparing different (but related)
timelines, such as a relative timeline in one page (with its own
performance.timeOrigin) and a relative timeline in an iframe or Worker (which
also has its own performance.timeOrigin). This is the same behavior as the 2ms timer
reduction we previously landed; jitter doesn't make this any better or worse.

MozReview-Commit-ID: IdRLxcWDQBZ

--HG--
extra : rebase_source : e455f934e6e6d65d54c122a6cec9f6cabbd5ac78
2018-03-01 00:07:03 -06:00
Tom Ritter
146429718b Bug 1430841 Eliminate float fuzziness in ReduceTimerPrecision r=froydnj
We eliminate float fuzziness by calculating the reduced precision using
integers in microseconds. (This means we automatically lose any granularity
about nanoseconds, but that's okay.)

MozReview-Commit-ID: D9ReLknsafo

--HG--
extra : rebase_source : 5e95427877289d224441f958bc10cd5b0a3621a9
2018-02-12 16:17:03 -06:00
Tom Ritter
affc1f9409 Bug 1430841 Refactor ReduceTimePrecision and add (failing) gtests r=bkelly
This commit adds a gtest calling ReduceTimePrecision that illustrates several
failing test cases from float fuzziness, as well as generating a ton of test
cases at random that also fail.

MozReview-Commit-ID: Epia5gm5Ahb

--HG--
extra : rebase_source : 81ec97b15343cc7d713b2445f127a8e11874cd84
2018-02-12 13:11:18 -06:00
Tom Ritter
41b3b96b98 Bug 1429647 Switch privacy.reduceTimerPrecision and privacy.resistFingerprinting to use Relaxed Semantics r=froydnj,mystor
MozReview-Commit-ID: HdW4tmQAcTT

--HG--
extra : rebase_source : c1e1c44a79cb0449da22c8fce954da078c1972e4
2018-01-24 18:09:43 -06:00
Tom Ritter
8184fa2b43 Bug 1435296 Do not apply timer clamping to CSS animations. r=birtles
This patch creates the capability to have callsites specify if timestamps
should be clamped only in Resist Fingerprinting Mode, or in the more expansive
Timer PRecision Reduction Mode.

Then it changes the CSS Animation callsite to only apply in RFP Mode.

This avoids regressing RFP.

MozReview-Commit-ID: B1pSri0kRk6

--HG--
extra : rebase_source : f3d8c1f9561fbb19d1ca8594ba2b69cffd25445b
2018-02-07 16:50:57 -06:00
Tom Ritter
1c60c301ab Bug 1435296 Bump the default timer precision resolution to 2ms r=baku
MozReview-Commit-ID: G33jNNJVRSU

--HG--
extra : rebase_source : b34e8cb65407c2379e1714aab22b2c8c60d98b57
2018-02-02 11:05:40 -06:00
Boris Zbarsky
53daea632f Bug 1436508 part 9. Remove nsIDOMKeyEvent::DOM_KEY* constants. r=masayuki
MozReview-Commit-ID: JXCCrbaMcn
2018-02-09 11:17:09 -05:00
Tom Ritter
d68ecb1cb9 Bug 1431455 Fix a regression for ResistFingerprinting: use the larger of the reduceTimerPrecision pref and the constant 100ms r=bkelly
MozReview-Commit-ID: 73MpmfEKoQG

--HG--
extra : rebase_source : 0e928c806df56416d45749a9e098ca1a92ddb5fe
2018-01-18 11:25:59 -06:00
Tim Huang
8933d9d799 Bug 1222285 - Part 1: Spoofing the keyboard event to mimc a certain keyboard layout according to the content-language of the document when 'privacy.resistFingerprinting' is true. r=arthuredelstein,masayuki,smaug
This patch makes Firefox to spoof keyboardEvent.code, keyboardEvent.keycode and
modifier states, for 'Shift', 'Alt', 'Control' and 'AltGraph', when 'privacy.resistFingerprinting'
is true. Firefox will spoof keyboard events as a certain keyboard layout according
to the content language of the document, for example, we use US English keyboard for
English content. Right now, it only supports English contents, we will add more
support for more languages later. The spoofing only affects content, chrome
can still see real keyboard events.

MozReview-Commit-ID: 40JPvwLmMMB

--HG--
extra : rebase_source : 870224ba4f87b3e336c5b061ac6859dd1c48c4f2
2017-08-29 11:33:27 +08:00
Tom Ritter
d0170278b3 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

--HG--
extra : rebase_source : e06785203f0f8b01fc7b694ce840f07dc09bc4a1
2018-01-12 13:36:04 -06:00
Tom Ritter
66fa50f4d6 Bug 1429885 Support a rounding value of 0 for reduceTimerPrecision r=bkelly,timhuang
MozReview-Commit-ID: F96EUfXgK9F

--HG--
extra : rebase_source : a07dc479dc895cd06fb59902d1eacaeaec30266b
2018-01-11 14:25:14 -06:00
Tom Ritter
bc92067c8e Bug 1424341 Add privacy.reduceTimerPrecision and privacy.reduceTimerPrecision.microseconds prefs r=bkelly,timhuang
This pref does not override privacy.resistFingerprinting, but when it is set (and
privacy.resistFingerprinting is not) we will still adjust the precision of almost
all timers. The adjustment amount is the second pref, which is defaulted to
20us but now dynamically adjustable (in the scale of microseconds.)

This patch does _not_ address the performance API, which privacy.resistFingerprinting
disables.

We are landing this preffed on at the current value we clamp performance.now() at
which is 20us.

MozReview-Commit-ID: ESZlSvH9w1D

--HG--
extra : rebase_source : a8afead1bdba958c6c7b383b2216dacb3a1b135c
2018-01-09 14:58:34 -06:00
Tim Huang
8a762bcc31 Bug 1404608 - Reveal the real operating system when fingerprinting resistance is enabled. r=arthuredelstein,smaug
This patch makes Firefox not to lie about the real operating system when pref
'privacy.resistFingerprinting' is true. This will also change the testcase as well.

MozReview-Commit-ID: Gdnp2lMU3wr

--HG--
extra : rebase_source : 62c408db6dc372091510fe1adf29f529eae99cdc
2017-12-12 15:25:49 -06:00
Chris Peterson
a0c8081df4 Bug 870698 - Part 4: Replace Equals("") with EqualsLiteral(""). r=erahm
MozReview-Commit-ID: G1GhyvD29WK

--HG--
extra : rebase_source : 115842c37a40041bdca7b4e1ff0a5680b02ced15
extra : source : 90bfff9c01d80086cdc17637f310e898fea295ea
2017-09-06 01:13:45 -07:00
Ethan
d20c7d929c Bug 1393283 - Use the last ESR version as the spoofed Firefox version. r=tihuang, r=mcmanus 2017-09-01 17:29:44 +08:00
Tim Huang
7af48eb06f Bug 1369309 - Part 3: Making the media statistics reports a spoofed value when fingerprinting resistance is enabled. r=cpearce, r=arthuredelstein
This patch makes the media statistics report values with a fixed frames per second
and a dynamic dropped ratio when resistance fingerprinting is enabled. The dropped
rate is decided by the video resolution that it will report a fixed dropped rate
when the video resolution is greater than 480p. And It will report a zero dropped
rate if the video is below or equal to 480p. In addition, it adds three new prefs
that allow us to change the value of frames per second, the dropped ratio and the
threshold of target video resolution. The three prefs are
'privacy.resistFingerprinting.video_frames_per_sec', 'privacy.resistFingerprinting.video_dropped_ratio'
and 'privacy.resistFingerprinting.target_video_res'. The default values of them
are 30, 5 and 480, which means 30 frames per second, 5 percent dropped ratio and
480p.

This also adds a new helper function 'nsContentUtils::ShouldResistFingerprinting(nsIDocument* aDoc)'
for checking whether fingerprinting resistance is enabled for a given docuemnt.
If it is a chrome document, this function will indicate that fingerprinting
resistance is not enabled regardless of the pref 'privacy.resistFingerprinting'.
If it is a content document, the result will depend on the pref.

MozReview-Commit-ID: FbSuRq6Zdnn

--HG--
extra : rebase_source : a62a1be19d9b38520f9eed7164fb258e3354d228
2017-07-17 15:13:55 +08:00
Jan Beich
729edf3c9f Bug 1385597 - Properly restore system timezone on other POSIX systems. r=Ehsan
MozReview-Commit-ID: 4viT99nrph4

--HG--
extra : rebase_source : 2c9abd28d1c11fd6bfa0ffc4326c551ea31f9a7d
2017-07-29 16:16:02 +00:00
Tim Huang
87f6957631 Bug 1382840 - Making the nsRFPService::UpdatePref() to copy the string which been passed to PR_SetEnv(). r=Ehsan
The PR_SetEnv() needs the passing string been intentionally leaked. However,
nsRFPService::UpdatePref() uses PR_SetEnv() without leaking the input string.
This patch is going to fix this by using ToNewCString().

MozReview-Commit-ID: 97QQUk2sjM9

--HG--
extra : rebase_source : 10205fe2e9577d5c985572256a5e9842c46d39be
2017-07-21 11:49:21 +08:00
Doug Thayer
6ce2f09f36 Bug 1361500 - (2) Move e10s check after profile load r=Ehsan
Since user-provided values for the e10s prefs won't be loaded
until the profile's prefs.js file is loaded, we need to wait for
this to occur. The simplest way to do this while keeping the
logic neatly inside nsRFPService seemed to be to add an observer,
but another option would be to just directly call _tzset at the
right time during start-up, or add a static method in nsRFPService
doing this that we could call. This would avoid the overhead of an
observer, but since I don't know how significant that overhead
is I just went with the observer for now.

MozReview-Commit-ID: 6yhvwEoADDy

--HG--
extra : rebase_source : fcb6bfe7136993d2a10bee4f707e4a21230fab27
2017-07-06 09:14:02 -07:00
Doug Thayer
366ebfc80f Bug 1361500 - Don't call _tzset on startup r=arthuredelstein,Ehsan
The reason we call _tzset inside DateTime.cpp is to allow the
privacy.resistFingerprinting pref to mask our timezone by setting
the TZ environment variable. Without _tzset, the changes to the
environment variable won't actually change anything. However, if
a process is started with the TZ environment variable set to
something (like "UTC"), then those changes will be active in
that process. Since we're only masking timezone to JS running in
the content process, and since those content processes will be
started by the parent process which has already set its TZ to UTC,
and will copy that variable to its children, we only need to call
_tzset() when the pref changes, and only in the content process,
provided we are on e10s.

MozReview-Commit-ID: CPU99BGDUPj

--HG--
extra : rebase_source : 4cdf6b5e2aebeff34decd11efa62783f2364dd3a
2017-06-23 12:56:03 -04:00