Bug 1365513 - Remove the call to AbstractThread::GetCurrent() in nsPermissionManager.cpp. r=mystor

See bug 1365483 for the rationale.

MozReview-Commit-ID: 4sWodnP5MYZ

--HG--
extra : rebase_source : 6a32073e50695ac8f4a540c83f9d2b5542b53585
extra : intermediate-source : 5d7189453d82844d55e3d90c79792b2edd7bdd0d
extra : source : 8b029c32f3512c9d8e92582312459a501594a6e8
This commit is contained in:
JW Wang 2017-05-18 14:14:27 +08:00
Родитель c632a44157
Коммит 1f5623c523
2 изменённых файлов: 8 добавлений и 3 удалений

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

@ -11,6 +11,7 @@
#include "mozilla/dom/ContentChild.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/Services.h"
#include "mozilla/SystemGroup.h"
#include "mozilla/Unused.h"
#include "nsPermissionManager.h"
#include "nsPermission.h"
@ -3356,9 +3357,11 @@ nsPermissionManager::WhenPermissionsAvailable(nsIPrincipal* aPrincipal,
return NS_OK;
}
auto* thread = SystemGroup::AbstractMainThreadFor(TaskCategory::Other);
RefPtr<nsIRunnable> runnable = aRunnable;
GenericPromise::All(AbstractThread::GetCurrent(), promises)->Then(
AbstractThread::GetCurrent(), __func__,
GenericPromise::All(thread, promises)->Then(
thread, __func__,
[runnable] () { runnable->Run(); },
[] () {
NS_WARNING("nsPermissionManager permission promise rejected. We're probably shutting down.");

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

@ -331,7 +331,9 @@ interface nsIPermissionManager : nsISupports
/**
* Add a callback which should be run when all permissions are available for
* the given nsIPrincipal. This method invokes the callback runnable
* synchronously when the permissions are already available.
* synchronously when the permissions are already available. Otherwise the
* callback will be run asynchronously in SystemGroup when all permissions
* are available in the future.
*
* NOTE: This method will not request the permissions be sent by the parent
* process. This should only be used to wait for permissions which may not