当前位置: 首页>>代码示例>>C++>>正文


C++ BluetoothService::ConfirmReceivingFile方法代码示例

本文整理汇总了C++中BluetoothService::ConfirmReceivingFile方法的典型用法代码示例。如果您正苦于以下问题:C++ BluetoothService::ConfirmReceivingFile方法的具体用法?C++ BluetoothService::ConfirmReceivingFile怎么用?C++ BluetoothService::ConfirmReceivingFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BluetoothService的用法示例。


在下文中一共展示了BluetoothService::ConfirmReceivingFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: BluetoothVoidReplyRunnable

nsresult
BluetoothAdapter::ConfirmReceivingFile(const nsAString& aDeviceAddress,
                                       bool aConfirmation,
                                       nsIDOMDOMRequest** aRequest)
{
    BluetoothService* bs = BluetoothService::Get();
    if (!bs) {
        NS_WARNING("BluetoothService not available!");
        return NS_ERROR_FAILURE;
    }

    nsCOMPtr<nsIDOMRequestService> rs =
        do_GetService("@mozilla.org/dom/dom-request-service;1");

    if (!rs) {
        NS_WARNING("No DOMRequest Service!");
        return NS_ERROR_FAILURE;
    }

    nsCOMPtr<nsIDOMDOMRequest> req;
    nsresult rv = rs->CreateRequest(GetOwner(), getter_AddRefs(req));
    if (NS_FAILED(rv)) {
        NS_WARNING("Can't create DOMRequest!");
        return NS_ERROR_FAILURE;
    }

    nsRefPtr<BluetoothVoidReplyRunnable> result =
        new BluetoothVoidReplyRunnable(req);
    bs->ConfirmReceivingFile(aDeviceAddress, aConfirmation, result);

    req.forget(aRequest);

    return NS_OK;
}
开发者ID:,项目名称:,代码行数:34,代码来源:

示例2: BluetoothVoidReplyRunnable

nsresult
BluetoothAdapter::ConfirmReceivingFile(const nsAString& aDeviceAddress,
                                       bool aConfirmation,
                                       nsIDOMDOMRequest** aRequest)
{
  nsCOMPtr<nsIDOMDOMRequest> req;
  nsresult rv;
  rv = PrepareDOMRequest(GetOwner(), getter_AddRefs(req));
  NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);

  nsRefPtr<BluetoothVoidReplyRunnable> results =
    new BluetoothVoidReplyRunnable(req);

  BluetoothService* bs = BluetoothService::Get();
  NS_ENSURE_TRUE(bs, NS_ERROR_FAILURE);
  bs->ConfirmReceivingFile(aDeviceAddress, aConfirmation, results);

  req.forget(aRequest);
  return NS_OK;
}
开发者ID:TelefonicaPushServer,项目名称:mozilla-central,代码行数:20,代码来源:BluetoothAdapter.cpp

示例3: BluetoothVoidReplyRunnable

already_AddRefed<DOMRequest>
BluetoothAdapter::ConfirmReceivingFile(const nsAString& aDeviceAddress,
                                       bool aConfirmation, ErrorResult& aRv)
{
  nsCOMPtr<nsPIDOMWindow> win = GetOwner();
  if (!win) {
    aRv.Throw(NS_ERROR_FAILURE);
    return nullptr;
  }

  nsRefPtr<DOMRequest> request = new DOMRequest(win);
  nsRefPtr<BluetoothVoidReplyRunnable> results =
    new BluetoothVoidReplyRunnable(request);

  BluetoothService* bs = BluetoothService::Get();
  if (!bs) {
    aRv.Throw(NS_ERROR_FAILURE);
    return nullptr;
  }
  bs->ConfirmReceivingFile(aDeviceAddress, aConfirmation, results);

  return request.forget();
}
开发者ID:Geek-in-Training,项目名称:mozilla-central,代码行数:23,代码来源:BluetoothAdapter.cpp


注:本文中的BluetoothService::ConfirmReceivingFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。