// static
PermissionStatus* PermissionStatus::take(ScriptPromiseResolver* resolver, WebPermissionStatus* status, WebPermissionType type)
{
    PermissionStatus* permissionStatus = PermissionStatus::create(resolver->executionContext(), *status, type);
    permissionStatus->startListening();
    delete status;
    return permissionStatus;
}
Пример #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;
}