PRUint32 i; for (i = 0; i < count; i++) { nsXBLBindingRequest* req = (nsXBLBindingRequest*)mBindingRequests.ElementAt(i); req->DocumentLoaded(mBindingDocument);
for (i = 0; i < count; i++) { nsXBLBindingRequest* req = (nsXBLBindingRequest*)mBindingRequests.ElementAt(i); req->DocumentLoaded(mBindingDocument); }
nsXBLStreamListener::Load(nsIDOMEvent* aEvent){  nsresult rv = NS_OK;  // Remove ourselves from the set of pending docs.  nsCOMPtr<nsIBindingManager> bindingManager;  mDocument->GetBindingManager(getter_AddRefs(bindingManager));  nsCOMPtr<nsIURI> uri(mBindingDocument->GetDocumentURL());  nsXPIDLCString str;  uri->GetSpec(getter_Copies(str));  bindingManager->RemoveLoadingDocListener((const char*)str);  PRUint32 count = mBindingRequests.Count();    nsCOMPtr<nsIContent> root = getter_AddRefs(mBindingDocument->GetRootContent());  if (root)    nsXBLService::StripWhitespaceNodes(root);  // Put our doc in the doc table.  nsCOMPtr<nsIXBLDocumentInfo> info;  NS_NewXBLDocumentInfo(mBindingDocument, getter_AddRefs(info));   // If the doc is a chrome URI, then we put it into the XUL cache.  PRBool cached = PR_FALSE;  if (IsChromeURI(uri) && gXULUtils->UseXULCache()) {    cached = PR_TRUE;    gXULCache->PutXBLDocumentInfo(info);    // Cache whether or not this chrome XBL can execute scripts.    nsCOMPtr<nsIChromeRegistry> reg(do_GetService(kChromeRegistryCID, &rv));    if (NS_SUCCEEDED(rv) && reg) {      PRBool allow = PR_TRUE;      reg->AllowScriptsForSkin(uri, &allow);      info->SetScriptAccess(allow);    }  }    if (!cached)    bindingManager->PutXBLDocumentInfo(info);  // Notify all pending requests that their bindings are  // ready and can be installed.  PRUint32 i;  for (i = 0; i < count; i++) {    nsXBLBindingRequest* req = (nsXBLBindingRequest*)mBindingRequests.ElementAt(i);    req->DocumentLoaded(mBindingDocument);  }    for (i = 0; i < count; i++) {    nsXBLBindingRequest* req = (nsXBLBindingRequest*)mBindingRequests.ElementAt(i);    delete req;  }  nsCOMPtr<nsIDOMEventReceiver> rec(do_QueryInterface(mBindingDocument));  rec->RemoveEventListener(NS_ConvertASCIItoUCS2("load"), (nsIDOMLoadListener*)this, PR_FALSE);  mDocument = nsnull;  mBindingDocument = nsnull;  return rv;}