It's silly to use prmem.h within Firefox code given that in our configuration
its functions are just wrappers for malloc() et al. (Indeed, in some places we
mix PR_Malloc() with free(), or malloc() with PR_Free().)
This patch removes all uses, except for the places where we need to use
PR_Free() to free something allocated by another NSPR function; in those cases
I've added a comment explaining which function did the allocation.
--HG--
extra : rebase_source : 0f781bca68b5bf3c4c191e09e277dfc8becffa09
All the instances are converted as follows.
- nsSubstring --> nsAString
- nsCSubstring --> nsACString
--HG--
extra : rebase_source : cfd2238c52e3cb4d13e3bd5ddb80ba6584ab6d91
All the instances are converted as follows.
- nsAFlatString --> nsString
- nsAFlatCString --> nsCString
--HG--
extra : rebase_source : b37350642c58a85a08363df2e7c610873faa6e41
This patch is mainly for adjusting the value of INLINESPELL_CHECK_TIMEOUT
from 50ms to 1ms. The value means how long the main thread is blocked
for spelling check, and 50ms is too long. It causes significant delays
when a rich content document is loading, and the user tries to
type immediately before spell checking is done.
With the INLINESPELL_CHECK_TIMEOUT setting to 1ms, it's possible to be
too short to less powerful machines. Therefore we add
INLINESPELL_MINIMUM_WORDS_BEFORE_TIMEOUT to ensure at least N words were
checked.
MozReview-Commit-ID: 2PmAOWs5qjn
--HG--
extra : rebase_source : a173b07eb072348d042639ccfa636a2efeec9ae4
We keep checking if a node is a text node when building soft text and
set spell checking range in DoSpellCheck. However, simply checking text
node is not optimal, we could furthur exclude text node in script and
style tags. There might be more cases we could consider to exclude.
--HG--
extra : rebase_source : 7be2615c8baa5b7af425caa792398e2101d84744
We use ClassifyCharacter for detecting all possibilities of word
boudaries when building mRealWords but not when building soft text.
This inconsistency leads us repeatedly checking the same set of words
in some cases.
--HG--
extra : rebase_source : 01834f49584ee696a4caec240d16356db8efe5bd
Avoids a thread-safety race condition on shutdown where we could try to finalize a statement twice.
Allows the async thread to be referenced until ShutdownAsyncThread, so async finalizers can make use of it.
Removes the no more useful mAsyncExecutionThreadIsAlive.
Nullifies the sqlite3_mutex pointer when the connection is closed, since it would be a dangling pointer.
Use a ScopeExit to ensure the connection and the mutex pointers are always nullified on failure.
Makes asyncClose bailout early if a Close method was already invoked before.
Makes AsyncInitDatabase not use AsyncClose to just shutdown the async thread.
Fixes various unfinalized statements in consumers code.
Makes mConnectionClosed better follow mDBConn status.
Replaces some mutex locking isClosed() calls with lockless isConnectionReadyOnThisThread.
MozReview-Commit-ID: 6sftFehsQTt
--HG--
extra : rebase_source : 2bf3088b500376e58e62e8f078d9950588adc649
nsRange::DoSetRange() adds/remove its root to/from mutation observer, initializes common ancestor, registers itself to the common ancestor, unregisters itself from old common ancestor, and notifies selection listeners of selection change.
However, those runtime cost is expensive but on the other hand, a lot of callers set both start and end of the range and that causes calling DoSetRange() twice.
This patch renames Set() to SetStartAndEnd() for easier to understand the meaning and make it call DoSetRange() only once.
MozReview-Commit-ID: FRV55tuBAgg
--HG--
extra : rebase_source : 67adf929cf119e2425f7d3741651217522094590
See bug 1365483 for the rationale.
MozReview-Commit-ID: 4sWodnP5MYZ
--HG--
extra : rebase_source : 6a32073e50695ac8f4a540c83f9d2b5542b53585
extra : intermediate-source : 5d7189453d82844d55e3d90c79792b2edd7bdd0d
extra : source : 8b029c32f3512c9d8e92582312459a501594a6e8
The permissions manager store uses principal origins with suffix in the
key entry, but for the API entry points where we accept a raw nsIURI, we
currently mint a new codebase principal with a blank OriginAttributes
only to read out the origin string effectively, since the suffix is
guaranteed to always be an empty string in this case.
This can be slow, so this patch adds a fast path to bypass minting a new
principal and uses ContentPrincipal::GenerateOriginNoSuffixFromURI() to
generate the origin string from the input nsIURI directly.
This function is arguably nicer than calling NS_ProcessNextEvent
manually, is slightly more efficient, and will enable better auditing
for NS_ProcessNextEvent when we do Quantum DOM scheduling changes.
This patch is mainly for adjusting the value of INLINESPELL_CHECK_TIMEOUT
from 50ms to 1ms. The value means how long the main thread is blocked
for spelling check, and 50ms is too long. It causes significant delays
when a rich content document is loading, and the user tries to
type immediately before spell checking is done.
With the INLINESPELL_CHECK_TIMEOUT setting to 1ms, it's possible to be
too short to less powerful machines. Therefore we add
INLINESPELL_MINIMUM_WORDS_BEFORE_TIMEOUT to ensure at least N words were
checked.
MozReview-Commit-ID: 1KYeFpggZGn
--HG--
extra : rebase_source : d7733dd37a923e6d6afb7f88174f352d28d4a3c4
clang's -Wcomma warning warns about suspicious use of the comma operator such as calling a function for side effects within an expression. Check NS_SUCCEEDED() to use HasMoreElement() in an expression and confirm that it actually returned a legitimate out parameter.
extensions/spellcheck/src/mozSpellChecker.cpp:532:54 [-Wcomma] possible misuse of comma operator here
MozReview-Commit-ID: 3GnKVvx8Nu4
--HG--
extra : rebase_source : 0ceaaad16e3d701e24029e431a9d577e9636d626
extra : source : ceb864752cc324d629118d44f22a01d9594b26fd