Esempio n. 1
0
  NS_IMETHOD
  Run() override
  {
    MOZ_ASSERT(NS_IsMainThread());
    MOZ_ASSERT(mReply);

    if (mRequest) {
      // Must do this first because Send__delete__ will delete mRequest.
      mRequest->RequestComplete();

      if (!mRequest->Send__delete__(mRequest, *mReply)) {
        BT_WARNING("Failed to send response to child process!");
        return NS_ERROR_FAILURE;
      }
    }

    ReleaseMembers();
    return NS_OK;
  }
Esempio n. 2
0
bool
BluetoothParent::RecvPBluetoothRequestConstructor(
                                                PBluetoothRequestParent* aActor,
                                                const Request& aRequest)
{
  BluetoothRequestParent* actor = static_cast<BluetoothRequestParent*>(aActor);

#ifdef DEBUG
  actor->mRequestType = aRequest.type();
#endif

  switch (aRequest.type()) {
    case Request::TGetAdaptersRequest:
      return actor->DoRequest(aRequest.get_GetAdaptersRequest());
    case Request::TStartBluetoothRequest:
      return actor->DoRequest(aRequest.get_StartBluetoothRequest());
    case Request::TStopBluetoothRequest:
      return actor->DoRequest(aRequest.get_StopBluetoothRequest());
    case Request::TSetPropertyRequest:
      return actor->DoRequest(aRequest.get_SetPropertyRequest());
    case Request::TStartDiscoveryRequest:
      return actor->DoRequest(aRequest.get_StartDiscoveryRequest());
    case Request::TStopDiscoveryRequest:
      return actor->DoRequest(aRequest.get_StopDiscoveryRequest());
    case Request::TPairRequest:
      return actor->DoRequest(aRequest.get_PairRequest());
    case Request::TUnpairRequest:
      return actor->DoRequest(aRequest.get_UnpairRequest());
    case Request::TPairedDevicePropertiesRequest:
      return actor->DoRequest(aRequest.get_PairedDevicePropertiesRequest());
    case Request::TConnectedDevicePropertiesRequest:
      return actor->DoRequest(aRequest.get_ConnectedDevicePropertiesRequest());
    case Request::TFetchUuidsRequest:
      return actor->DoRequest(aRequest.get_FetchUuidsRequest());
    case Request::TSetPinCodeRequest:
      return actor->DoRequest(aRequest.get_SetPinCodeRequest());
    case Request::TSetPasskeyRequest:
      return actor->DoRequest(aRequest.get_SetPasskeyRequest());
    case Request::TConfirmPairingConfirmationRequest:
      return actor->DoRequest(aRequest.get_ConfirmPairingConfirmationRequest());
    case Request::TDenyPairingConfirmationRequest:
      return actor->DoRequest(aRequest.get_DenyPairingConfirmationRequest());
    case Request::TConnectRequest:
      return actor->DoRequest(aRequest.get_ConnectRequest());
    case Request::TDisconnectRequest:
      return actor->DoRequest(aRequest.get_DisconnectRequest());
    case Request::TSendFileRequest:
      return actor->DoRequest(aRequest.get_SendFileRequest());
    case Request::TStopSendingFileRequest:
      return actor->DoRequest(aRequest.get_StopSendingFileRequest());
    case Request::TConfirmReceivingFileRequest:
      return actor->DoRequest(aRequest.get_ConfirmReceivingFileRequest());
    case Request::TDenyReceivingFileRequest:
      return actor->DoRequest(aRequest.get_DenyReceivingFileRequest());
    case Request::TConnectScoRequest:
      return actor->DoRequest(aRequest.get_ConnectScoRequest());
    case Request::TDisconnectScoRequest:
      return actor->DoRequest(aRequest.get_DisconnectScoRequest());
    case Request::TIsScoConnectedRequest:
      return actor->DoRequest(aRequest.get_IsScoConnectedRequest());
#ifdef MOZ_B2G_RIL
    case Request::TAnswerWaitingCallRequest:
      return actor->DoRequest(aRequest.get_AnswerWaitingCallRequest());
    case Request::TIgnoreWaitingCallRequest:
      return actor->DoRequest(aRequest.get_IgnoreWaitingCallRequest());
    case Request::TToggleCallsRequest:
      return actor->DoRequest(aRequest.get_ToggleCallsRequest());
#endif
    case Request::TSendMetaDataRequest:
      return actor->DoRequest(aRequest.get_SendMetaDataRequest());
    case Request::TSendPlayStatusRequest:
      return actor->DoRequest(aRequest.get_SendPlayStatusRequest());
    case Request::TConnectGattClientRequest:
      return actor->DoRequest(aRequest.get_ConnectGattClientRequest());
    case Request::TDisconnectGattClientRequest:
      return actor->DoRequest(aRequest.get_DisconnectGattClientRequest());
    case Request::TDiscoverGattServicesRequest:
      return actor->DoRequest(aRequest.get_DiscoverGattServicesRequest());
    case Request::TUnregisterGattClientRequest:
      return actor->DoRequest(aRequest.get_UnregisterGattClientRequest());
    case Request::TGattClientReadRemoteRssiRequest:
      return actor->DoRequest(aRequest.get_GattClientReadRemoteRssiRequest());
    default:
      MOZ_CRASH("Unknown type!");
  }

  MOZ_CRASH("Should never get here!");
}
Esempio n. 3
0
bool
BluetoothParent::RecvPBluetoothRequestConstructor(
                                                PBluetoothRequestParent* aActor,
                                                const Request& aRequest)
{
  BluetoothRequestParent* actor = static_cast<BluetoothRequestParent*>(aActor);

#ifdef DEBUG
  actor->mRequestType = aRequest.type();
#endif

  switch (aRequest.type()) {
    case Request::TGetAdaptersRequest:
      return actor->DoRequest(aRequest.get_GetAdaptersRequest());
    case Request::TStartBluetoothRequest:
      return actor->DoRequest(aRequest.get_StartBluetoothRequest());
    case Request::TStopBluetoothRequest:
      return actor->DoRequest(aRequest.get_StopBluetoothRequest());
    case Request::TSetPropertyRequest:
      return actor->DoRequest(aRequest.get_SetPropertyRequest());
    case Request::TStartDiscoveryRequest:
      return actor->DoRequest(aRequest.get_StartDiscoveryRequest());
    case Request::TStopDiscoveryRequest:
      return actor->DoRequest(aRequest.get_StopDiscoveryRequest());
    case Request::TStartLeScanRequest:
      return actor->DoRequest(aRequest.get_StartLeScanRequest());
    case Request::TStopLeScanRequest:
      return actor->DoRequest(aRequest.get_StopLeScanRequest());
    case Request::TStartAdvertisingRequest:
      return actor->DoRequest(aRequest.get_StartAdvertisingRequest());
    case Request::TStopAdvertisingRequest:
      return actor->DoRequest(aRequest.get_StopAdvertisingRequest());
    case Request::TPairRequest:
      return actor->DoRequest(aRequest.get_PairRequest());
    case Request::TUnpairRequest:
      return actor->DoRequest(aRequest.get_UnpairRequest());
    case Request::TPairedDevicePropertiesRequest:
      return actor->DoRequest(aRequest.get_PairedDevicePropertiesRequest());
    case Request::TConnectedDevicePropertiesRequest:
      return actor->DoRequest(aRequest.get_ConnectedDevicePropertiesRequest());
    case Request::TFetchUuidsRequest:
      return actor->DoRequest(aRequest.get_FetchUuidsRequest());
    case Request::TPinReplyRequest:
      return actor->DoRequest(aRequest.get_PinReplyRequest());
    case Request::TSspReplyRequest:
      return actor->DoRequest(aRequest.get_SspReplyRequest());
    case Request::TSetPinCodeRequest:
      return actor->DoRequest(aRequest.get_SetPinCodeRequest());
    case Request::TSetPasskeyRequest:
      return actor->DoRequest(aRequest.get_SetPasskeyRequest());
    case Request::TConfirmPairingConfirmationRequest:
      return actor->DoRequest(aRequest.get_ConfirmPairingConfirmationRequest());
    case Request::TDenyPairingConfirmationRequest:
      return actor->DoRequest(aRequest.get_DenyPairingConfirmationRequest());
    case Request::TConnectRequest:
      return actor->DoRequest(aRequest.get_ConnectRequest());
    case Request::TDisconnectRequest:
      return actor->DoRequest(aRequest.get_DisconnectRequest());
    case Request::TSendFileRequest:
      return actor->DoRequest(aRequest.get_SendFileRequest());
    case Request::TStopSendingFileRequest:
      return actor->DoRequest(aRequest.get_StopSendingFileRequest());
    case Request::TConfirmReceivingFileRequest:
      return actor->DoRequest(aRequest.get_ConfirmReceivingFileRequest());
    case Request::TDenyReceivingFileRequest:
      return actor->DoRequest(aRequest.get_DenyReceivingFileRequest());
    case Request::TConnectScoRequest:
      return actor->DoRequest(aRequest.get_ConnectScoRequest());
    case Request::TDisconnectScoRequest:
      return actor->DoRequest(aRequest.get_DisconnectScoRequest());
    case Request::TIsScoConnectedRequest:
      return actor->DoRequest(aRequest.get_IsScoConnectedRequest());
    case Request::TSetObexPasswordRequest:
      return actor->DoRequest(aRequest.get_SetObexPasswordRequest());
    case Request::TRejectObexAuthRequest:
      return actor->DoRequest(aRequest.get_RejectObexAuthRequest());
    case Request::TReplyTovCardPullingRequest:
      return actor->DoRequest(aRequest.get_ReplyTovCardPullingRequest());
    case Request::TReplyToPhonebookPullingRequest:
      return actor->DoRequest(aRequest.get_ReplyToPhonebookPullingRequest());
    case Request::TReplyTovCardListingRequest:
      return actor->DoRequest(aRequest.get_ReplyTovCardListingRequest());
    case Request::TReplyToFolderListingRequest:
      return actor->DoRequest(aRequest.get_ReplyToFolderListingRequest());
    case Request::TReplyToMessagesListingRequest:
      return actor->DoRequest(aRequest.get_ReplyToMessagesListingRequest());
    case Request::TReplyToGetMessageRequest:
      return actor->DoRequest(aRequest.get_ReplyToGetMessageRequest());
    case Request::TReplyToSetMessageStatusRequest:
      return actor->DoRequest(aRequest.get_ReplyToSetMessageStatusRequest());
    case Request::TReplyToSendMessageRequest:
      return actor->DoRequest(aRequest.get_ReplyToSendMessageRequest());
    case Request::TReplyToMessageUpdateRequest:
      return actor->DoRequest(aRequest.get_ReplyToMessageUpdateRequest());
#ifdef MOZ_B2G_RIL
    case Request::TAnswerWaitingCallRequest:
      return actor->DoRequest(aRequest.get_AnswerWaitingCallRequest());
    case Request::TIgnoreWaitingCallRequest:
      return actor->DoRequest(aRequest.get_IgnoreWaitingCallRequest());
    case Request::TToggleCallsRequest:
      return actor->DoRequest(aRequest.get_ToggleCallsRequest());
#endif
    case Request::TSendMetaDataRequest:
      return actor->DoRequest(aRequest.get_SendMetaDataRequest());
    case Request::TSendPlayStatusRequest:
      return actor->DoRequest(aRequest.get_SendPlayStatusRequest());
    case Request::TConnectGattClientRequest:
      return actor->DoRequest(aRequest.get_ConnectGattClientRequest());
    case Request::TDisconnectGattClientRequest:
      return actor->DoRequest(aRequest.get_DisconnectGattClientRequest());
    case Request::TDiscoverGattServicesRequest:
      return actor->DoRequest(aRequest.get_DiscoverGattServicesRequest());
    case Request::TGattClientStartNotificationsRequest:
      return actor->DoRequest(
        aRequest.get_GattClientStartNotificationsRequest());
    case Request::TGattClientStopNotificationsRequest:
      return actor->DoRequest(
        aRequest.get_GattClientStopNotificationsRequest());
    case Request::TUnregisterGattClientRequest:
      return actor->DoRequest(aRequest.get_UnregisterGattClientRequest());
    case Request::TGattClientReadRemoteRssiRequest:
      return actor->DoRequest(aRequest.get_GattClientReadRemoteRssiRequest());
    case Request::TGattClientReadCharacteristicValueRequest:
      return actor->DoRequest(
        aRequest.get_GattClientReadCharacteristicValueRequest());
    case Request::TGattClientWriteCharacteristicValueRequest:
      return actor->DoRequest(
        aRequest.get_GattClientWriteCharacteristicValueRequest());
    case Request::TGattClientReadDescriptorValueRequest:
      return actor->DoRequest(
        aRequest.get_GattClientReadDescriptorValueRequest());
    case Request::TGattClientWriteDescriptorValueRequest:
      return actor->DoRequest(
        aRequest.get_GattClientWriteDescriptorValueRequest());
    case Request::TGattServerRegisterRequest:
      return actor->DoRequest(
        aRequest.get_GattServerRegisterRequest());
    case Request::TGattServerConnectPeripheralRequest:
      return actor->DoRequest(
        aRequest.get_GattServerConnectPeripheralRequest());
    case Request::TGattServerDisconnectPeripheralRequest:
      return actor->DoRequest(
        aRequest.get_GattServerDisconnectPeripheralRequest());
    case Request::TUnregisterGattServerRequest:
      return actor->DoRequest(aRequest.get_UnregisterGattServerRequest());
    case Request::TGattServerAddServiceRequest:
      return actor->DoRequest(aRequest.get_GattServerAddServiceRequest());
    case Request::TGattServerAddIncludedServiceRequest:
      return actor->DoRequest(
               aRequest.get_GattServerAddIncludedServiceRequest());
    case Request::TGattServerAddCharacteristicRequest:
      return actor->DoRequest(
               aRequest.get_GattServerAddCharacteristicRequest());
    case Request::TGattServerAddDescriptorRequest:
      return actor->DoRequest(aRequest.get_GattServerAddDescriptorRequest());
    case Request::TGattServerRemoveServiceRequest:
      return actor->DoRequest(aRequest.get_GattServerRemoveServiceRequest());
    case Request::TGattServerStartServiceRequest:
      return actor->DoRequest(aRequest.get_GattServerStartServiceRequest());
    case Request::TGattServerStopServiceRequest:
      return actor->DoRequest(aRequest.get_GattServerStopServiceRequest());
    case Request::TGattServerSendResponseRequest:
      return actor->DoRequest(aRequest.get_GattServerSendResponseRequest());
    case Request::TGattServerSendIndicationRequest:
      return actor->DoRequest(
        aRequest.get_GattServerSendIndicationRequest());
    default:
      MOZ_CRASH("Unknown type!");
  }

  MOZ_CRASH("Should never get here!");
}