A number of places in JS need to drain the current thread's event queue,
which cannot be done with nsIThreadManager::spinEventLoopUntil, since we
need to not wait for an incoming event when attempting to process one.
xpcom/build/PoisonIOInterposerBase.cpp:79:21 [-Wunused-member-function] unused member function 'Clear'
MozReview-Commit-ID: ITI1mZk0DTx
--HG--
extra : source : 77e0683d430bac85376b476a783862db7acc384c
extra : intermediate-source : 935b7d158e4a1d2727998b0c2e7a9122ebefa257
mozilla::EditorBase stores nsISelectionController and nsIDocument with nsWeakPtr. However, nsWeakPtr requires QI to retrieve actual pointer and it makes some damage to the performance. If mozilla::WeakPter were available for them, it'd be great. However, it's not available with nsISelectionController nor nsIDocument because it's possible to implement SupportsWeakPtr only with their subclasses but the subclasses shouldn't be referred by editor. Therefore, this patch creates mozilla::CachedWeakPtr<class T> which stores both raw pointer (as cache) and nsWeakPtr and when its cache is requested, it checks if the object referred by nsWeakPtr is still alive.
Additionally, this patch hides the members from subclasses of EditorBase for reducing the maintenance cost.
MozReview-Commit-ID: FvtM7453Vv8
--HG--
extra : rebase_source : a524a8ea327c3993645fafa81db8aef65090f1e0
Check if the receiver has SetDeadline and use a specialization that
doesn't use it if it isn't present. This makes it possible to call:
NewIdleRunnable(obj, Obj::Method)
where Obj doesn't need to implement SetDeadline. This makes it easier
to avoid unnecessary wrappers.
--HG--
extra : rebase_source : 83c30b0590475d65b072b41c466321330af07dc7
Once the |aPayload| argument to profile_add_marker() became a UniquePtr the
default value of nullptr caused compilation difficulties that could only be
fixed by #including ProfilerMarkerPayload.h into lots of additional places
(because the UniquePtr<T> instantiation required the T to be fully defined). To
get around this I just split profile_add_marker() into two functions, one with
1 argument and one with 2 arguments.
The patch also removes the definition of PROFILER_MARKER_PAYLOAD in the case
where MOZ_GECKO_PROFILER isn't defined. A comment explains why.
This was causing a crash on nightly. The browser would try to collect only a
native stack, and then attempt to dereference the null pointer for the
pseudostack. I think this didn't happen on infra as it only occurs when the user
has hung a sufficient number of times.
MozReview-Commit-ID: 6RSW2llKBjT
This patch uses the profiler_suspend_sample_thread method which was added in
part 1.
With this patch, we no longer manually run code to pause the target thread,
instead using the profiler's provided code to do so. In addition, we no longer
manually walk the stack to collect native stack frames, instead relying on the
profiler's cross-platform stack walking logic.
This helps remove some of the code from ThreadStackHelper which was redundant
with the profiler. Much of the pseudostack code in ThreadStackHelper is also
redundant, and should hopefully be eliminated in a follow-up.
MozReview-Commit-ID: 4RjLHt6inH9
Also change nsClassHashtable::LookupOrAdd to not regard existing entries with
a nullptr value as non-existent. This is to make it consistent with
nsBaseHashtable::LookupForAdd() and other methods.
MozReview-Commit-ID: 1wYqK8XQbyW