*aInstancePtr = (void*)(nsISupports*)(nsIWebShell*)this; NS_ADDREF_THIS(); return NS_OK;
*aResult = (void *)(nsISupports*)this; } else if (aIID.Equals(kIFactoryIID)) { *aResult = (void *)(nsIFactory*)this;
nsWebShell::QueryInterface(REFNSIID aIID, void** aInstancePtr){  nsresult rv = NS_NOINTERFACE;  if (NULL == aInstancePtr) {    return NS_ERROR_NULL_POINTER;  }  if (aIID.Equals(kIWebShellIID)) {    *aInstancePtr = (void*)(nsIWebShell*)this;    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(kIContentViewerContainerIID)) {    *aInstancePtr = (void*)(nsIContentViewerContainer*)this;    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(kIScriptContextOwnerIID)) {    *aInstancePtr = (void*)(nsIScriptContextOwner*)this;    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(kIDocumentLoaderObserverIID)) {    *aInstancePtr = (void*)(nsIDocumentLoaderObserver*)this;    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(kIWebShellContainerIID)) {    *aInstancePtr = (void*)(nsIWebShellContainer*)this;    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(kILinkHandlerIID)) {    //I added this for plugin support of jumping    //through links. maybe there is a better way... MMP    *aInstancePtr = (void*)(nsILinkHandler*)this;    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(kRefreshURLIID)) {    *aInstancePtr = (void*)(nsIRefreshUrl*)this;    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(kINetSupportIID)) {    *aInstancePtr = (void*) ((nsINetSupport*)this);    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(kIClipboardCommandsIID)) {    *aInstancePtr = (void*) ((nsIClipboardCommands*)this);    NS_ADDREF_THIS();    return NS_OK;  }  if (aIID.Equals(kISupportsIID)) {    *aInstancePtr = (void*)(nsISupports*)(nsIWebShell*)this;    NS_ADDREF_THIS();    return NS_OK;  }#if defined(NS_DEBUG)   /*   * Check for the debug-only interface indicating thread-safety   */  static NS_DEFINE_IID(kIsThreadsafeIID, NS_ISTHREADSAFE_IID);  if (aIID.Equals(kIsThreadsafeIID)) {    return NS_OK;  }#endif /* NS_DEBUG */  return rv;}