char * imageURLCString = imageURL.ToNewCString(); char *host = cookie_ParseURL(imageURLCString, GET_HOST_PART); Recycle(imageURLCString); char * hostname = nsnull; StrAllocCopy(hostname, host); Recycle(host); permission_Add(hostname, permission, type, PR_TRUE);
char * objectURLCString = objectURL.ToNewCString(); char *host = cookie_ParseURL(objectURLCString, GET_HOST_PART); Recycle(objectURLCString);   if (permission) { char * hostPtr = host; while (PR_TRUE) { permission_Unblock(hostPtr, type); hostPtr = PL_strchr(hostPtr, '.'); if (!hostPtr) { break; } hostPtr++;  } Recycle(host); return; } permission_Add(host, permission, type, PR_TRUE);
Permission_Add(nsString imageURL, PRBool permission, PRInt32 type) {  if (imageURL.Length() == 0) {    return;  }  char * imageURLCString = imageURL.ToNewCString();  char *host = cookie_ParseURL(imageURLCString, GET_HOST_PART);  Recycle(imageURLCString);  char * hostname = nsnull;  StrAllocCopy(hostname, host);  Recycle(host);  permission_Add(hostname, permission, type, PR_TRUE);}