Beispiel #1
0
NS_IMETHODIMP
SmsRequest::NotifyMessageGot(nsIDOMMozSmsMessage *aMessage)
{
  if (mParent) {
    SmsMessageData data = SmsMessageData(static_cast<SmsMessage*>(aMessage)->GetData());
    return SendMessageReply(MessageReply(ReplyGetMessage(data)));
  }
  return NotifySuccess<nsIDOMMozSmsMessage*>(aMessage);

}
Beispiel #2
0
NS_IMETHODIMP
SmsRequestParent::NotifyMessageGot(nsISupports *aMessage)
{
    NS_ENSURE_TRUE(!mActorDestroyed, NS_ERROR_FAILURE);

    ContentParent *parent = static_cast<ContentParent*>(Manager()->Manager());
    MobileMessageData data;
    if (GetMobileMessageDataFromMessage(parent, aMessage, data)) {
        return SendReply(ReplyGetMessage(data));
    }

    return NS_ERROR_FAILURE;
}
Beispiel #3
0
NS_IMETHODIMP
SmsRequestParent::NotifyMessageGot(nsISupports *aMessage)
{
  nsCOMPtr<nsIDOMMozMmsMessage> mms = do_QueryInterface(aMessage);
  if (mms) {
    MmsMessage *msg = static_cast<MmsMessage*>(mms.get());
    ContentParent *parent = static_cast<ContentParent*>(Manager()->Manager());
    MmsMessageData data;
    if (!msg->GetData(parent, data)) {
      return NS_ERROR_FAILURE;
    }
    return SendReply(ReplyGetMessage(MobileMessageData(data)));
  }

  nsCOMPtr<nsIDOMMozSmsMessage> sms = do_QueryInterface(aMessage);
  if (sms) {
    SmsMessage* msg = static_cast<SmsMessage*>(sms.get());
    return SendReply(ReplyGetMessage(MobileMessageData(msg->GetData())));
  }

  return NS_ERROR_FAILURE;
}