зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1363474 - Add a method to ask whether it's safe to run code related to a given SchedulerGroup (r=froydnj)
MozReview-Commit-ID: F8uZUTfUM9v
This commit is contained in:
Родитель
2f4cd5e241
Коммит
24b1d128db
|
@ -57,10 +57,19 @@ public:
|
|||
SchedulerGroup* mPrevRunningDispatcher;
|
||||
};
|
||||
|
||||
// This function returns true if it's currently safe to run code associated
|
||||
// with this SchedulerGroup. It will return true either if we're inside an
|
||||
// unlabeled runnable or if we're inside a runnable labeled with this
|
||||
// SchedulerGroup.
|
||||
bool IsSafeToRun() const
|
||||
{
|
||||
return !sRunningDispatcher || mAccessValid;
|
||||
}
|
||||
|
||||
// Ensure that it's valid to access the TabGroup at this time.
|
||||
void ValidateAccess() const
|
||||
{
|
||||
MOZ_ASSERT(!sRunningDispatcher || mAccessValid);
|
||||
MOZ_ASSERT(IsSafeToRun());
|
||||
}
|
||||
|
||||
class Runnable final : public mozilla::Runnable
|
||||
|
|
Загрузка…
Ссылка в новой задаче