This includes tests that cover both regular CFI stack walking as well as
pathological corner cases.
MozReview-Commit-ID: GDARnPSemyu
--HG--
extra : source : 1a140f07e06de7e7d96a37d693db832311b301ae
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
It's simple enough that having a separate function isn't helpful.
MozReview-Commit-ID: Ke9BIfp9yHU
--HG--
extra : rebase_source : 57aee451b8fd3450da4a604cefbf9fafda894b1c
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
This is a follow-up patch for bug 1392970. Since we only set CustomElementDefinition on a custom element
which is "custom", we could add more assertion to ensure that.
MozReview-Commit-ID: 2sLP53bAYVV
--HG--
extra : rebase_source : 523761aa7312ddfaaf91f79e39c44ddce5cf9335
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
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 : e611e57de4f059275ae2908f7300065cf953461d
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 : f8d26a8c9f7ea911272113efc56744df639c5ccf
There's not much use using |protected| in a |final| class.
MozReview-Commit-ID: IECyfNGZsL5
--HG--
extra : rebase_source : bc9597ee45583e809f89f7e558cc325460390f98
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 : e5d10e42401136a9a82d665d9717cf71ecf7e4ae
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 : 32950f00975f7d9df63fa0af1c36e82b58516245
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 : f453d31215de3fdb0c5b6176becf2669e7ad55f1
It's simple enough that having a separate function isn't helpful.
MozReview-Commit-ID: Ke9BIfp9yHU
--HG--
extra : rebase_source : de1518544ddb28185635628c33d356ab07480c1c
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 : 93f963d3ba445c1c3a482fa95dbab33e57dae188