nsISpeculativeConnect 编辑
netwerk/base/public/nsISpeculativeConnect.idl
Scriptable Lets non-networking code provide hints to the networking layer that an HTTP connection attempt to a particular site is likely to happen soon; this lets the networking layer begin setting up TCP and, if appropriate, SSL handshakes to save time when the connection is actually opened later. 1.0 66 Introduced Gecko 15.0 Inherits from: nsISupports
Last changed in Gecko 15.0 (Firefox 15.0 / Thunderbird 15.0 / SeaMonkey 2.12)To use this service, simply call nsISupports.QueryInterface()
on the nsIIOService
you plan to use for the connection, to get access to the I/O service's implementation of nsISpeculativeConnect. Then call speculativeConnect()
to let the networking layer know what you might be doing in the future.
Method overview
void speculativeConnect(in nsIURI aURI, in nsIInterfaceRequestor aCallbacks, in nsIEventTarget aTarget); |
Methods
speculativeConnect()
Call this method to hint to the networking layer that a new transaction for the specified URI is likely to happen soon. The code implementing this method may use this information to start a TCP and/or SSL level handshake for that resource immediately so that it is ready (or at least in the process of becoming ready) when the transaction is actually submitted.
No obligation is taken on by the implementer, nor is the submitter obligated to actually open the new channel.
void speculativeConnect( in nsIURI aURI, in nsIInterfaceRequestor aCallbacks, in nsIEventTarget aTarget );
Parameters
aURI
- The URI of the hinted transaction.
aCallbacks
- Any security callbacks for use with SSL for interfaces such as
nsIBadCertListener
. May benull
. aTarget
- The thread on which the release of the callbacks will occur. May be
null
for "any thread".
See also
nsIIOService
- Blog post: Making Firefox Search Snappier
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论