зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1647115 - Add a runTaskLocked method in SourceCompressionTask. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D80893
This commit is contained in:
Родитель
499048fe86
Коммит
7bf85e3823
|
@ -2217,13 +2217,9 @@ void HelperThread::handleCompressionWorkload(
|
|||
currentTask.emplace(task.get());
|
||||
}
|
||||
|
||||
{
|
||||
AutoUnlockHelperThreadState unlock(locked);
|
||||
|
||||
// release the pointer, inside runTask the SourceCompressTask pointer will
|
||||
// be stored in compressionFinishedList.
|
||||
task.release()->runTask();
|
||||
}
|
||||
// Release the pointer, inside runTaskLocked the SourceCompressTask pointer
|
||||
// will be stored in compressionFinishedList.
|
||||
task.release()->runTaskLocked(locked);
|
||||
|
||||
currentTask.reset();
|
||||
|
||||
|
|
|
@ -831,6 +831,7 @@ class SourceCompressionTask : public RunnableTask {
|
|||
}
|
||||
|
||||
void runTask() override;
|
||||
void runTaskLocked(AutoLockHelperThreadState& locked);
|
||||
void complete();
|
||||
|
||||
ThreadType threadType() override { return ThreadType::THREAD_TYPE_COMPRESS; }
|
||||
|
|
|
@ -2548,21 +2548,29 @@ void ScriptSource::performTaskWork(SourceCompressionTask* task) {
|
|||
}
|
||||
|
||||
void SourceCompressionTask::runTask() {
|
||||
if (!shouldCancel()) {
|
||||
TraceLoggerThread* logger = TraceLoggerForCurrentThread();
|
||||
AutoTraceLog logCompile(logger, TraceLogger_CompressSource);
|
||||
if (shouldCancel()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ScriptSource* source = sourceHolder_.get();
|
||||
MOZ_ASSERT(source->hasUncompressedSource());
|
||||
TraceLoggerThread* logger = TraceLoggerForCurrentThread();
|
||||
AutoTraceLog logCompile(logger, TraceLogger_CompressSource);
|
||||
|
||||
source->performTaskWork(this);
|
||||
ScriptSource* source = sourceHolder_.get();
|
||||
MOZ_ASSERT(source->hasUncompressedSource());
|
||||
|
||||
source->performTaskWork(this);
|
||||
}
|
||||
|
||||
void SourceCompressionTask::runTaskLocked(AutoLockHelperThreadState& locked) {
|
||||
{
|
||||
AutoUnlockHelperThreadState unlock(locked);
|
||||
this->runTask();
|
||||
}
|
||||
|
||||
{
|
||||
AutoLockHelperThreadState lock;
|
||||
AutoEnterOOMUnsafeRegion oomUnsafe;
|
||||
if (!HelperThreadState().compressionFinishedList(lock).append(this)) {
|
||||
oomUnsafe.crash("handleCompressionWorkload");
|
||||
if (!HelperThreadState().compressionFinishedList(locked).append(this)) {
|
||||
oomUnsafe.crash("SourceCompressionTask::runTaskLocked");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче