|ClearOnShutdown| deletes pointers by assigning |nullptr|. This
patch converts |gNfcService| to a smart pointer, so that cleaning
its value during shutdown will actually destruct the instance.
The main thread writes the NFC thread's field in the NFC service
instance, but the function |assertIsNfcServiceThread| uses this
value on the NFC worker thread itself. Also clearing this value
happens on main, while the NFC thread still executes code. Calls
to |assertIsNfcServiceThread| can therefore fail if they occur
during an NFC shutdown.
This patch replaces the unsafe and racy |assertIsNfcServiceThread|
with the much simpler |NfcConsumer::IsNfcServiceThread|. The new
method tests the current thread against a thread pointer that has
been stored in |NfcConsumer|.
This patch moves |NfcEventDispatcher| to the namespace of |NfcConsumer|
and renames it to |DispatchNfcEventRunnable|. The NFC service is stored
in the runnable itself.
This patch moves NFC thread onto the NFC service thread by applying
the following changes:
* The methods |Start| and |Shutdown| now send runnables to the NFC
thread that start or stop an NFC consumer. After shutting down a
cleanu-up runnable frees all resources on the main thread.
* Received messages are forwarded directly from the I/O thread to
the NFC thread and unpacked there. There's no intermediate hop
over the main thread any more.
* Similarly to receiving, packed massages are forwarded directly
from the NFC thread to the I/O thread. No intermediate hop over
main is required.
* On connection errors, |NfcConsumer| sends a runnable to the main
thread to shutdown NFC.
After this change, we have ShallowSizeOf{In,Ex}cludingThis(), which don't do
anything to measure children. (They can be combined with iteration to measure
children.)
--HG--
extra : rebase_source : f98420176f50990bbc5a25e35788328154cfeb00
It is now no longer necessary to clear zero bins because these are zeroed
in the FFTBlock constructor.
nsTArray bounds assertions now apply.
--HG--
extra : rebase_source : 18c07ecb51f9cb3c199536fe59110093db2295d4
After this change, we have ShallowSizeOf{In,Ex}cludingThis(), which don't do
anything to measure children. (They can be combined with iteration to measure
children.)
And we still have the existing single-arg SizeOf{In,Ex}cluding() functions,
which work if the entry type itself defines SizeOfExcludingThis().
--HG--
extra : rebase_source : f93de9b789c21b1b148bed9de795f663f77c9dd9
Don't rely on MaybeCreateDocShell to set mRemoteFrame so we don't have
to call MaybeCreateDocShell in weird places. Instead we set mRemoteFrame
early in the nsFrameLoader constructor. This should still allow us to
switch default remoteness dynamically.