// static
PermissionStatus* PermissionStatus::take(ScriptPromiseResolver* resolver, WebPermissionStatus* status, WebPermissionType type)
{
    PermissionStatus* permissionStatus = PermissionStatus::create(resolver->executionContext(), *status, type);
    permissionStatus->startListening();
    delete status;
    return permissionStatus;
}
Exemplo n.º 2
0
PermissionStatus* PermissionStatus::createAndListen(
    ExecutionContext* executionContext,
    MojoPermissionStatus status,
    MojoPermissionDescriptor descriptor) {
  PermissionStatus* permissionStatus =
      new PermissionStatus(executionContext, status, std::move(descriptor));
  permissionStatus->suspendIfNeeded();
  permissionStatus->startListening();
  return permissionStatus;
}
PermissionStatus* PermissionStatus::create(ExecutionContext* executionContext, WebPermissionStatus status, WebPermissionType type)
{
    PermissionStatus* permissionStatus = new PermissionStatus(executionContext, status, type);
    permissionStatus->suspendIfNeeded();
    return permissionStatus;
}