Bug 1342872 - part1: Label the runnable dispatched by NS_DispatchToCurrentThread in nsPrintEngine r=bevistseng,jwatt

MozReview-Commit-ID: BZhRUglmbMW

--HG--
extra : rebase_source : 6280fbd5d1c3d4c47c7fd925abfd9e00384b1ab6
This commit is contained in:
Farmer Tseng 2017-03-28 11:50:16 +08:00
Родитель 5d99fc5820
Коммит 6bb21eacb6
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -3556,9 +3556,15 @@ private:
void
nsPrintEngine::FirePrintCompletionEvent()
{
MOZ_ASSERT(NS_IsMainThread());
nsCOMPtr<nsIRunnable> event = new nsPrintCompletionEvent(mDocViewerPrint);
if (NS_FAILED(NS_DispatchToCurrentThread(event)))
NS_WARNING("failed to dispatch print completion event");
nsCOMPtr<nsIContentViewer> cv = do_QueryInterface(mDocViewerPrint);
NS_ENSURE_TRUE_VOID(cv);
nsCOMPtr<nsIDocument> doc = cv->GetDocument();
NS_ENSURE_TRUE_VOID(doc);
NS_ENSURE_SUCCESS_VOID(doc->Dispatch("nsPrintCompletionEvent",
TaskCategory::Other, event.forget()));
}
void