Граф коммитов

13792 Коммитов

Автор SHA1 Сообщение Дата
Nicholas Nethercote ee320f219e Bug 1413811 (part 3) - Rename RegisterPriorityCallback(). r=glandium.
MozReview-Commit-ID: 5Ov1cHgfB5Y

--HG--
extra : rebase_source : 767ae8c0390f68555e334945cb5479479a52e1ef
2017-11-02 17:20:36 +11:00
Nicholas Nethercote d8ca9e91d7 Bug 1413811 (part 2) - Factor out similarities between RegisterPriorityCallback() and Preferences::RegisterCallback(). r=glandium.
MozReview-Commit-ID: 8K3RNjZTSc3

--HG--
extra : rebase_source : 1bd0aacc120248f024e2e428af40087bba3f6848
2017-11-02 17:13:47 +11:00
Nicholas Nethercote 90032b0798 Bug 1413811 (part 1) - Avoid PrefCallback for pref callbacks registered with Preferences::RegisterCallback(). r=glandium.
Pref callbacks registered via Preferences::Add*VarCache() are wrapped in a
ValueObserver -- which groups all callback requests that have the same prefname
and callback function -- and the ValueObserver is put into gObserverTable. This
is reasonable.

Observers registered via nsPrefBranch::Add{Weak,Strong}Observer() are wrapped
in a PrefCallback, and the PrefCallback is put into sRootBranch->mObservers.
This is also reasonable.

Pref callbacks registered via Preferences::RegisterCallback() are conceptually
similar to those registered via Preferences::Add*VarCache(). However, they are
implemented by using *both* of the above mechanisms: they are wrapped in a
ValueObserver which is put into gObserverTable, *and* that ValueObserver is then
wrapped in a PrefCallback which is put into sRootBranch->mObservers.

Using both mechanisms isn't necessary, so this patch removes the
PrefCallback/mObservers part. This makes Preferences::RegisterCallback() work
in much the same way as Preferences::Add*VarCache().

Specifically:

- Preferences::RegisterCallback() now calls PREF_RegisterCallback() instead of
  Preferences::AddStrongObserver(). This makes it more similar to
  RegisterPriorityCallback().

- Preferences::UnregisterCallback() now explicitly calls
  PREF_UnregisterCallback() instead of Preferences::RemoveObserver (which
  previously happened via ~ValueObserver() when the ValueObserver was removed
  from gObserverTable and its refcount dropped to zerod).

MozReview-Commit-ID: 1tEQNeYrBUU

--HG--
extra : rebase_source : 431a42402397a172d562b81b8d46418503bb8dfe
2017-11-02 17:11:51 +11:00
NARCIS BELEUZU a6cf88a4bf Merge mozilla-central to inbound. r=merge a=merge on CLOSED TREE 2017-11-03 12:22:35 +02:00
NARCIS BELEUZU 2e3654a915 Merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-11-03 12:04:55 +02:00
Sebastian Hengst e9b3a258b8 merge mozilla-central to autoland. r=merge a=merge 2017-11-02 23:15:55 +01:00
Sebastian Hengst 68106833b3 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: xcHQOq7Rbv
2017-11-02 22:59:04 +01:00
Nicolas B. Pierron f955d25394 Bug 1405738 - Enable the JavaScript Start-up Bytecode Cache. r=mrbkap 2017-11-02 16:31:45 +00:00
Nicholas Nethercote 9245fb0232 Bug 1413400 (part 2) - Make Preferences::sPreferences a StaticRefPtr. r=froydnj.
The notable part of this change is Shutdown(). I've made it just null out
sPreferences, contrary to the old comment, which was strange for a couple of
reasons:

- ~Preferences() used to null out sPreference, which is backwards compared to
  how this sort of thing normally works.

- In both the before and after cases, as far as I can tell,
  Preferences::Shutdown() is called but ~Preferences() is never called;
  something keeps the singleton Preferences instance alive until process
  termination.

MozReview-Commit-ID: Ab0ui31rVcI
2017-11-01 13:55:28 +11:00
Nicholas Nethercote 3baceb4b37 Bug 1413400 (part 1) - Move s{,Default}RootBranch into Preferences. r=froydnj.
sRootBranch and sDefaultRootBranch have the same lifetime as sPreferences, so
this patch makes them non-static nsCOMPtr<> members of Preferences.

MozReview-Commit-ID: 1TLhh13ZpBI

--HG--
extra : rebase_source : 9419cd205b9a06f7ae82722a6732e3fc2722473b
2017-11-01 13:41:14 +11:00
Nicholas Nethercote b9c6a1d730 Bug 1413413 (part 2) - Remove support for extensions having their own prefs file. r=glandium,kmag.
It's no longer needed, now that legacy extensions aren't supported.

Pieces removed include the following.

- The "load-extension-default" observer notification.

- The code for reading defaults/preferences/*.js from extensions.

- The unit test for this stuff.

- A crash reporter annotation relating to very long prefs set by add-ons.

- All references to "ExtPrefDL".

MozReview-Commit-ID: KMBoYn3uZ3x

--HG--
extra : rebase_source : 4dc8ffd425c6cdf06806409090c4f9d04a64930b
2017-10-31 16:34:57 +11:00
Nicholas Nethercote 08cb1f38b2 Bug 1413413 (part 1) - Remove unused "@mozilla.org/preferences;1" ID. r=glandium.
MozReview-Commit-ID: 9d1ca2R6fNb

--HG--
extra : rebase_source : a7377b8b242cf07eb7a48cd0cb431b4768792326
2017-10-31 16:34:38 +11:00
Christian Holler 49da770167 Bug 1413696 - Add default prefs for ASan Reporter. r=froydnj
MozReview-Commit-ID: 9a1uLem2UOQ

--HG--
extra : rebase_source : c5ebd17f06221a5045dd864d74bc7365227e4fbf
2017-11-01 22:32:19 +01:00
Jean-Yves Avenard 96d64e1c44 Bug 1392961 - Add preference to make VP9 the preferred video codec. r=jesup
Behaviour is controlled through the media.navigator.video.vp9_preferred preference.

MozReview-Commit-ID: J06ArFYNmTk

--HG--
extra : rebase_source : a25bd4783fde0acf8291ee440745a619d3fa7db8
2017-10-19 15:18:51 +02:00
Andreas Pehrson 46edadb25e Bug 1409727 - Add a mode and pref to disallow frame drops in MediaRecorder. r=SingingTree
MozReview-Commit-ID: CJBJURDn7gB

--HG--
extra : rebase_source : 248e904879dc68fcce7f041b9ebaed82e7aba9ed
2017-10-19 14:38:07 +02:00
Andreas Pehrson 0ed4ac3622 Bug 1409727 - Expose the audio node recording pref to about:config. r=jib
MozReview-Commit-ID: DbPH3umsH9v

--HG--
extra : rebase_source : 0cd5647995ea425dcaaadca5d429e4d2d1d52295
2017-10-19 14:37:13 +02:00
Nicholas Nethercote ede7a0db1d Bug 1413085 - Inline and remove pref_SetPref(). r=glandium.
It has a single call site.

MozReview-Commit-ID: Hdt1KkG2jTV

--HG--
extra : rebase_source : 0b851491f08646fbd4d8a4862601f8cadad02522
2017-11-01 08:59:30 +11:00
Nicholas Nethercote 559a3f06ee Bug 1413085 - Make PREF_Get{CString,Int,Bool}Pref() more uniform. r=glandium.
This patch does the following.

- Reduces nesting and simplifies control flow by handling failure cases
  earlier, and makes all three functions have identical structure.

- Avoids unnecessary temporary local variables, including |rv|.

- Removes low-value comments, including some misleading ones (e.g. "This
  function will perform conversion...").

- PREF_GetCStringValue() previously did not check HasDefaultValue(), unlike the
  other two. It now does.

- PREF_GetCStringValue() now calls SetIsVoid(true) at the start, so that
  aValueOut will be Voided on all failure paths.

MozReview-Commit-ID: 2uCSv76Y8eu

--HG--
extra : rebase_source : 9ca9148ad0a5069bdd3e08aec0038216d27ea092
2017-11-01 08:55:07 +11:00
Sebastian Hengst 2181970726 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-11-01 00:39:58 +01:00
Nicholas Nethercote af33aed804 Bug 1412718 (part 2) - Improve nsPrefBranch::DeleteBranch(). r=glandium.
This patch converts it to use Gecko strings instead of C strings, which makes
it much nicer.

MozReview-Commit-ID: KtRp3vaXwN5

--HG--
extra : rebase_source : c6788cbed5c4b932eb5b4119c407aea538cb1799
2017-11-01 08:28:10 +11:00
Nicholas Nethercote 89134cc30a Bug 1412718 (part 1) - Inline and remove PREF_DeleteBranch(). r=glandium.
It has a single call site.

MozReview-Commit-ID: BH7GuipEgl

--HG--
extra : rebase_source : fa13eb8be2a088b717d834686d60b4eea6b1df4d
2017-11-01 07:59:40 +11:00
Nicholas Nethercote 8bd05bfcc0 Bug 1412949 - Remove SystemMemoryReporter. r=erahm.
This was created for B2G and isn't really useful otherwise. It only works on
Linux, and it's behind the memory.system_memory_reporter pref, which is false
by default.

The patch also removes LinuxUtils.{h,cpp}, which is no longer used.

--HG--
extra : rebase_source : b97a018be11a79f83855a73b88020bfa86e60f78
2017-10-31 12:49:41 +11:00
Alessio Placitelli 5230ddc6b6 Bug 1412845 - Whitelist the "default" channel in Prferences.cpp. r=chutten
This is needed for local developer builds to enable extended
telemetry recording by default. As a consequence, other subsystems
relying on this prefs will turn on (e.g. experiments, BHR, ...).

MozReview-Commit-ID: W3RarufCdY

--HG--
extra : rebase_source : 8690e969baad1b9191ea3fef9fb7dd6e41e00de7
2017-10-31 08:53:32 +01:00
Bas Schouten cbbc50786e Bug 1412850: Release capture drawtargets on the paint thread. r=rhunt
MozReview-Commit-ID: AD3F5DfGAkp
2017-10-30 15:50:25 +01:00
Chris H-C 84de24dd05 bug 1406391 - Lock toolkit.telemetry.enabled based on channel r=froydnj
In Unified Telemetry toolkit.telemetry.enabled controls whether we send base
collection data or extended collection. The difference is mostly in volume, not
in kind (though extended collection has a little stricter testing and monitoring
requirements).

Since the Preferences UI change in Firefox 56, users no longer have the ability
to change toolkit.telemetry.enabled. This is a good thing as for pre-release
users very few disabled extended collection, and even fewer release users
enabled it. This provides uniform collection based on channel which should
eventually net us some efficiencies.

Until then we need to align our use of the toolkit.telemetry.enabled pref with
the UI change that has already shipped. This is accomplished by locking t.t.e
to 'true' on pre-release channels and locking it to 'false' on everything else.

This doesn't apply to Android as it doesn't (yet) use Unified Telemetry. t.t.e
means something rather different there.

MozReview-Commit-ID: EOpWm8b0jWA
2017-10-30 10:47:39 -04:00
Coroiu Cristina de62a69e14 Merge inbound to mozilla-central r=merge a=merge 2017-10-30 12:16:47 +02:00
Nicholas Nethercote 9252435548 Bug 1410794 (attempt 2) - Change some |string| occurrences in nsIPrefBranch.idl to |ACString|. r=erahm.
This makes the code nicer. In particular, it removes many getter_Copies()
calls. The patch also converts a lot of nsCStrings to nsAutoCString, which will
avoid heap allocation in the common case.

The patch also renames PREF_CopyCharPref() as PREF_GetCStringPref(), because
it's actually getting a string, not a char, and that matches the existing
GetCString() and GetDefaultCString() methods. Correspondingly, it also renames
PREF_SetCharPref() as PREF_SetCStringPref().

The |aPrefName| arguments in nsIPrefBranch.idl remain as |string| because they
almost always involve passing in C string literals, and passing "foo" is much
nicer than passing NS_LITERAL_CSTRING("foo").

It's worth noting that early versions of this patch used |AUTF8String| instead
of |ACString|. But it turns out that libpref stores prefs internally as Latin1.
And |ACString| is compatible with Latin1 but |AUTF8String| isn't, because
non-ASCII Latin1 strings are not valid UTF-8!

MozReview-Commit-ID: D3f7a1Vl1oE

--HG--
extra : rebase_source : e6e4b15d6d210cfd93686f96400281f02bd1d06b
2017-10-27 10:30:33 +11:00
Sebastian Hengst 3792a177e6 merge autoland to mozilla-central. r=merge a=merge
MozReview-Commit-ID: IZImXBBcbVQ
2017-10-28 10:25:57 +02:00
Phil Ringnalda 4bc2b1615d Backed out 4 changesets (bug 1408433, bug 1406391, bug 1408512) for crashing tests by touching the network contacting incoming.telemetry.mozilla.org on nightly builds
Backed out changeset 9bfd4b0927dc (bug 1408433)
Backed out changeset 555850d5107e (bug 1408512)
Backed out changeset 15d959b9123e (bug 1406391)
Backed out changeset e1f34ba9cecc (bug 1406391)

MozReview-Commit-ID: BVoGRsD73Hf
2017-10-27 21:08:27 -07:00
Chris H-C be62507aa8 bug 1406391 - Lock toolkit.telemetry.enabled based on channel r=froydnj
In Unified Telemetry toolkit.telemetry.enabled controls whether we send base
collection data or extended collection. The difference is mostly in volume, not
in kind (though extended collection has a little stricter testing and monitoring
requirements).

Since the Preferences UI change in Firefox 56, users no longer have the ability
to change toolkit.telemetry.enabled. This is a good thing as for pre-release
users very few disabled extended collection, and even fewer release users
enabled it. This provides uniform collection based on channel which should
eventually net us some efficiencies.

Until then we need to align our use of the toolkit.telemetry.enabled pref with
the UI change that has already shipped. This is accomplished by locking t.t.e
to 'true' on pre-release channels and locking it to 'false' on everything else.

This doesn't apply to Android as it doesn't (yet) use Unified Telemetry. t.t.e
means something rather different there.

MozReview-Commit-ID: EOpWm8b0jWA
2017-10-27 10:59:36 -04:00
Xidorn Quan b24625e376 Bug 1411532 part 1 - Add a pref for enabling stylo on chrome documents. r=bz
MozReview-Commit-ID: 7Zbh4Mf43xC

--HG--
extra : rebase_source : f9e4d0b6d1234cb8efcfbaaab2a349d2a082dd6e
2017-10-27 15:07:51 +11:00
Sebastian Hengst 5c15da1f08 merge mozilla-inbound to mozilla-central. r=merge a=merge
--HG--
rename : testing/talos/tests/__init__.py => testing/talos/talos/unittests/__init__.py
rename : testing/talos/tests/browser_output.ts.txt => testing/talos/talos/unittests/browser_output.ts.txt
rename : testing/talos/tests/browser_output.tsvg.txt => testing/talos/talos/unittests/browser_output.tsvg.txt
rename : testing/talos/tests/profile.tgz => testing/talos/talos/unittests/profile.tgz
rename : testing/talos/tests/ps-Acj.out => testing/talos/talos/unittests/ps-Acj.out
rename : testing/talos/tests/test_talosconfig_browser_config.json => testing/talos/talos/unittests/test_talosconfig_browser_config.json
rename : testing/talos/tests/test_talosconfig_test_config.json => testing/talos/talos/unittests/test_talosconfig_test_config.json
rename : testing/talos/tests/xrestop_output.txt => testing/talos/talos/unittests/xrestop_output.txt
2017-10-27 12:45:34 +03:00
Nicholas Nethercote 63f0f0af1c Bug 1411480 (attempt 2) - Change PrefSaveData's element type. r=glandium.
Because nsCString is nicer than UniqueFreePtr<char>.

The patch also streamlines pref_savePrefs(). And also changes StrEscape() to
always put quotations around the result, because that's needed in both call
sites.

MozReview-Commit-ID: HT7HZz4QiSN

--HG--
extra : rebase_source : 442bb6002e004803a9ecb637239a000f11ec5774
2017-10-26 16:48:11 +11:00
Nicholas Nethercote bfdd7e8e70 Bug 1411480 (attempt 2) - Simplify pref_HashPref()'s workings. r=glandium.
First, the patch removes the return values from PrefTypeFlags::Set*(). They
allow chained calls, but they're barely used and they just make the code harder
to read.

Second, the patch changes pref_SetValue() to not modify and return the pref
flags. It's clearer if the flags changing is done separately. This requires
passing pref_SetValue() the old type instead of the flags.

MozReview-Commit-ID: HZVS2TIlBIY

--HG--
extra : rebase_source : 6638244214cda15ceae5a1930659aed434d8261b
2017-10-26 16:36:17 +11:00
Nicholas Nethercote 7a6dc9eed0 Bug 1411480 (attempt 2) - Make CallbackNode::mDomain const. r=glandium.
MozReview-Commit-ID: EvLC5FrMyKy

--HG--
extra : rebase_source : f31ddbc01716a539ad3a92154de1a6a49ad9a42a
2017-10-26 16:27:12 +11:00
Nicholas Nethercote 6e67b39c9c Bug 1411480 (attempt 2) - Make PrefValue::mStringVal const. r=glandium.
This makes it clear that the stored string values are never modified.

It requires some const_casts to free the strings, but that feels like an ok
trade-off.

MozReview-Commit-ID: JikBT3uwpfq

--HG--
extra : rebase_source : 1720969ba2c1ae245dff91a6d3a85d48fb669ced
2017-10-26 16:27:09 +11:00
Nicholas Nethercote ad06d5cebc Bug 1411480 (attempt 2) - Use |private| instead of |protected| in nsPrefBranch. r=glandium.
There's not much use using |protected| in a |final| class.

MozReview-Commit-ID: IECyfNGZsL5

--HG--
extra : rebase_source : e734b360c18e5e040bea186d5aedf91137711861
2017-10-26 16:26:24 +11:00
Nicholas Nethercote 2c49c63d40 Bug 1411480 (attempt 2) - Remove pref_savePrefs()'s argument. r=glandium.
It's always gHashTable, and all the other functions in this file work directly
on gHashTable rather than taking a parameter.

MozReview-Commit-ID: BDCEvcMlo8P

--HG--
extra : rebase_source : 8f136c100f2a4f7b2b34cfa884b8cc91c2d80e3a
2017-10-26 16:26:24 +11:00
Jeremy Chen ce49bc7b7c Bug 1411517 - stylo: "layout.css.stylo-blocklist.enabled" pref's default value should be false. r=xidorn
At present, the "layout.css.stylo-blocklist.blocked_domains" pref is empty. It
is probably meaningless to set "layout.css.stylo-blocklist.enabled" pref to true
by default. We can set "layout.css.stylo-blocklist.enabled" pref to true by the
styloblocklist system add-on once the "layout.css.stylo-blocklist.blocked_domains"
pref is non-empty.

MozReview-Commit-ID: 2B5JnGEafLo

--HG--
extra : rebase_source : 7b694a2cbe70d2d09c1a5c2c2e4c6eec31f39a1e
2017-10-26 22:19:08 +02:00
Sebastian Hengst 5848bd39ab Merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 26KLqf6YOiM
2017-10-27 00:10:27 +02:00
Sebastian Hengst b181c484ad merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: LcCWQzgwIBi
2017-10-26 23:57:40 +02:00
Kris Maglione cbb83dfe9a Bug 1409249: Follow-up: Fix libjar ref counting bustage. r=bustage
MozReview-Commit-ID: IbazBuzLGvN

--HG--
extra : rebase_source : a8f9c3562868b190ffa336cb306903c5608a4f5f
2017-10-25 23:05:02 -07:00
Nicholas Nethercote 5f344fea70 Bug 1411480 (attempt 2) - Remove the machinery for choosing the dirty callback. r=glandium.
It's unnecessarily general, because we only ever use
Preferences::DirtyCallback() as the callback.

And because it's no longer a callback, the patch renames DirtyCallback() as
HandleDirty().

MozReview-Commit-ID: Hl50dcxfVQq

--HG--
extra : rebase_source : 5807d2ed650466f85cd7325f2adccdc177ccb4d2
2017-10-26 16:14:01 +11:00
Nicholas Nethercote 0416bcac82 Bug 1411480 (attempt 2) - Inline and remove PREF_GetPrefType(). r=glandium.
It has a single call site.

MozReview-Commit-ID: o5CwR8Od7o

--HG--
extra : rebase_source : 85663f6414ae7214d2ba32a0bb3b3166da2c89c5
2017-10-26 16:14:00 +11:00
Nicholas Nethercote 9e821ded90 Bug 1411480 (attempt 2) - Inline and remove pref_[SG]etInitPhase(). r=glandium.
They both have a single use.

MozReview-Commit-ID: 4Jj64B6NV0o

--HG--
extra : rebase_source : 19c1d93393688daee5b7670be241785639df81d2
2017-10-26 16:14:00 +11:00
Nicholas Nethercote 3418db65be Bug 1411480 (attempt 2) - Inline and remove pref_SetWatchingPref(). r=glandium.
It's simple enough that having a separate function isn't helpful.

MozReview-Commit-ID: Ke9BIfp9yHU

--HG--
extra : rebase_source : 57aee451b8fd3450da4a604cefbf9fafda894b1c
2017-10-26 16:14:00 +11:00
Nicholas Nethercote dc68184056 Bug 1411480 (attempt 2) - Inline and remove the parser's pref_DoCallback() function. r=glandium.
Preferences.cpp has two functions named pref_DoCallback(). One of them has a
single use in the parser. This patch inlines that single use to remove the name
duplication.

MozReview-Commit-ID: HnyteQ0N5M1

--HG--
extra : rebase_source : 37a34f3fbe866eee71a7bf0bba07d9d67cc8c81d
2017-10-26 15:32:15 +11:00
Kris Maglione 257d9118dc Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj
Right now, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR expects singleton
constructors to return already-addrefed raw pointers, and while it accepts
constructors that return already_AddRefed, most existing don't do so.

Meanwhile, the convention elsewhere is that a raw pointer return value is
owned by the callee, and that the caller needs to addref it if it wants to
keep its own reference to it.

The difference in convention makes it easy to leak (I've definitely caused
more than one shutdown leak this way), so it would be better if we required
the singleton getters to return an explicit already_AddRefed, which would
behave the same for all callers.


This also cleans up several singleton constructors that left a dangling
pointer to their singletons when their initialization methods failed, when
they released their references without clearing their global raw pointers.

MozReview-Commit-ID: 9peyG4pRYcr

--HG--
extra : rebase_source : 2f5bd89c17cb554541be38444672a827c1392f3f
2017-10-16 21:08:42 -07:00
Phil Ringnalda 535f8401d0 Backed out 11 changesets (bug 1411480) for libpref xpcshell test failures
Backed out changeset 0f266ffacf0d (bug 1411480)
Backed out changeset 75212b4a8c0a (bug 1411480)
Backed out changeset 0c807a8e8b29 (bug 1411480)
Backed out changeset 21324f73db0c (bug 1411480)
Backed out changeset f7de6fa0ef2c (bug 1411480)
Backed out changeset b7cdbe5153fa (bug 1411480)
Backed out changeset 8a66ec3e8338 (bug 1411480)
Backed out changeset 3fdf2ac7762d (bug 1411480)
Backed out changeset eaa177ef5f60 (bug 1411480)
Backed out changeset e87ba9542cf8 (bug 1411480)
Backed out changeset f1cf84a50ebc (bug 1411480)

MozReview-Commit-ID: GEVRPZp5eSH
2017-10-25 20:03:25 -07:00
Nicholas Nethercote 14790e76d7 Bug 1411480 - Make CallbackNode::mDomain const. r=glandium.
MozReview-Commit-ID: EvLC5FrMyKy

--HG--
extra : rebase_source : d5998326dd40365903554094b9038248095020dc
2017-10-26 12:29:41 +11:00