Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
PendingPACQuery Class Reference
Inheritance diagram for PendingPACQuery:
Inheritance graph
Collaboration diagram for PendingPACQuery:
Collaboration graph

List of all members.

Public Member Functions

PendingPACQuery (nsPACMan *pacMan, nsIURI *uri, nsPACManCallback *callback)
nsresult Start ()
void Complete (nsresult status, const nsCString &pacString)
void onLookupComplete (in nsICancelable aRequest, in nsIDNSRecord aRecord, in nsresult aStatus)
 called when an asynchronous host lookup completes.

Private Attributes

nsRefPtr< nsPACManCallback > mCallback
nsCOMPtr< nsICancelablemDNSRequest

Detailed Description

Definition at line 77 of file nsPACMan.cpp.

Constructor & Destructor Documentation

nsIURI uri,
nsPACManCallback *  callback 
) [inline]

Definition at line 83 of file nsPACMan.cpp.

    : mPACMan(pacMan)
    , mURI(uri)
    , mCallback(callback)

Member Function Documentation

void PendingPACQuery::Complete ( nsresult  status,
const nsCString pacString 

Definition at line 136 of file nsPACMan.cpp.

  if (!mCallback)

  mCallback->OnQueryComplete(status, pacString);
  mCallback = nsnull;

  if (mDNSRequest) {
    mDNSRequest = nsnull;

Here is the caller graph for this function:

void nsIDNSListener::onLookupComplete ( in nsICancelable  aRequest,
in nsIDNSRecord  aRecord,
in nsresult  aStatus 
) [inherited]

called when an asynchronous host lookup completes.

aRequestthe value returned from asyncResolve.
aRecordthe DNS record corresponding to the hostname that was resolved. this parameter is null if there was an error.
aStatusif the lookup failed, this parameter gives the reason.

Definition at line 105 of file nsPACMan.cpp.

  if (mDNSRequest)
    return NS_OK;  // already started

  nsresult rv;
  nsCOMPtr<nsIDNSService> dns = do_GetService(NS_DNSSERVICE_CONTRACTID, &rv);
  if (NS_FAILED(rv)) {
    NS_WARNING("unable to get the DNS service");
    return rv;

  nsCAutoString host;
  rv = mURI->GetAsciiHost(host);
  if (NS_FAILED(rv))
    return rv;

  nsCOMPtr<nsIEventQueue> eventQ;
  rv = NS_GetCurrentEventQ(getter_AddRefs(eventQ));
  if (NS_FAILED(rv))
    return rv;

  rv = dns->AsyncResolve(host, 0, this, eventQ, getter_AddRefs(mDNSRequest));
  if (NS_FAILED(rv))
    NS_WARNING("DNS AsyncResolve failed");

  return rv;

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

nsRefPtr<nsPACManCallback> PendingPACQuery::mCallback [private]

Definition at line 97 of file nsPACMan.cpp.

Definition at line 98 of file nsPACMan.cpp.

Definition at line 95 of file nsPACMan.cpp.

Definition at line 96 of file nsPACMan.cpp.

The documentation for this class was generated from the following file: