nsIWeakReference 编辑

xpcom/base/nsIWeakReference.idlScriptable This interface represents a proxy for an XPCOM object. It allows a consumer to hold an indirect, non-owning reference to an XPCOM object. Inherits from: nsISupports Last changed in Gecko 0.9.9

An instance of nsIWeakReference is a proxy object that cooperates with its referent to give clients a non-owning, non-dangling reference. Clients own the nsIWeakReference instance.

Method overview

void QueryReferent( in nsIIDRef uuid, [iid_is(uuid), retval] out nsQIResult result );

Methods

QueryReferent()

This method queries an interface on the referent if it exists, and like nsISupports.QueryInterface(), produces an owning reference to the desired interface.")}} It is designed to look and act exactly like (a proxied) nsISupports.QueryInterface(). Do not hold on to the produced interface permanently; that would defeat the purpose of using a non-owning nsIWeakReference in the first place.

void QueryReferent(
  in nsIIDRef uuid,
  [iid_is(uuid), retval] out nsQIResult result
);
Parameters
uuid
The UUID of the requested interface.
result
The resulting interface pointer.
Exceptions thrown
NS_ERROR_NULL_POINTER
The referent no longer exists.
NS_ERROR_NO_INTERFACE
The requested interface is not available.

Remarks

This interface was frozen for Gecko 0.9.9. See bug 48726 for details. From Gecko 2.0 interfaces are no longer frozen.

See also

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:44 次

字数:3165

最后编辑:7 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文