mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 13:57:32 +00:00
Make clean builds work. Do this by removing the sub-class of
nsIDialogParamBlock in nsIPKIParamBlock. Everywhere we want to have bot nsIDialogParamBlock and nsIPKIParamBlock we do QueryInterface to get a pointer to the right interface.
This commit is contained in:
parent
89354c8ed3
commit
7c35b57982
@ -34,10 +34,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nsISupports.idl"
|
#include "nsISupports.idl"
|
||||||
#include "nsIDialogParamBlock.idl"
|
|
||||||
|
|
||||||
[scriptable, uuid(b6fe3d78-1dd1-11b2-9058-ced9016984c8)]
|
[scriptable, uuid(b6fe3d78-1dd1-11b2-9058-ced9016984c8)]
|
||||||
interface nsIPKIParamBlock : nsIDialogParamBlock {
|
interface nsIPKIParamBlock : nsISupports {
|
||||||
|
|
||||||
void setNumberISupports(in PRInt32 numISupports);
|
void setNumberISupports(in PRInt32 numISupports);
|
||||||
void setISupportAtIndex(in PRInt32 index, in nsISupports object);
|
void setISupportAtIndex(in PRInt32 index, in nsISupports object);
|
||||||
|
@ -22,18 +22,21 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
|
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
|
||||||
const nsIX509Cert = Components.interfaces.nsIX509Cert;
|
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
|
||||||
|
const nsIX509Cert = Components.interfaces.nsIX509Cert;
|
||||||
|
|
||||||
var params;
|
var pkiParams;
|
||||||
|
var dialogParams;
|
||||||
|
|
||||||
|
|
||||||
function onLoad()
|
function onLoad()
|
||||||
{
|
{
|
||||||
params = window.arguments[0].QueryInterface(nsIPKIParamBlock);
|
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
|
||||||
var connectURL = params.GetString(1);
|
var isupport = pkiParams.getISupportAtIndex(1);
|
||||||
var isupport = params.getISupportAtIndex(1);
|
|
||||||
var cert = isupport.QueryInterface(nsIX509Cert);
|
var cert = isupport.QueryInterface(nsIX509Cert);
|
||||||
|
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
|
||||||
|
var connectURL = dialogParams.GetString(1);
|
||||||
|
|
||||||
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
|
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
|
||||||
|
|
||||||
@ -53,12 +56,12 @@ function viewCert()
|
|||||||
|
|
||||||
function doOK()
|
function doOK()
|
||||||
{
|
{
|
||||||
params.SetInt(1,1);
|
dialogParams.SetInt(1,1);
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
function doCancel()
|
function doCancel()
|
||||||
{
|
{
|
||||||
params.SetInt(1,0);
|
dialogParams.SetInt(1,0);
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
@ -22,16 +22,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
|
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
|
||||||
const nsIX509Cert = Components.interfaces.nsIX509Cert;
|
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
|
||||||
|
const nsIX509Cert = Components.interfaces.nsIX509Cert;
|
||||||
|
|
||||||
var params;
|
var dialogParams;
|
||||||
|
var pkiParams;
|
||||||
|
|
||||||
|
|
||||||
function onLoad()
|
function onLoad()
|
||||||
{
|
{
|
||||||
params = window.arguments[0].QueryInterface(nsIPKIParamBlock);
|
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
|
||||||
var isupport = params.getISupportAtIndex(1);
|
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
|
||||||
|
|
||||||
|
var isupport = pkiParams.getISupportAtIndex(1);
|
||||||
var cert = isupport.QueryInterface(nsIX509Cert);
|
var cert = isupport.QueryInterface(nsIX509Cert);
|
||||||
|
|
||||||
var bundle = srGetStrBundle("chrome://pippki/locale/newserver.properties");
|
var bundle = srGetStrBundle("chrome://pippki/locale/newserver.properties");
|
||||||
@ -50,14 +54,14 @@ function onLoad()
|
|||||||
|
|
||||||
function doOK()
|
function doOK()
|
||||||
{
|
{
|
||||||
params.SetInt(1,1);
|
dialogParams.SetInt(1,1);
|
||||||
var radioGroup = document.getElementById("trustSiteCert");
|
var radioGroup = document.getElementById("trustSiteCert");
|
||||||
params.SetInt(2,parseInt(radioGroup.selectedItem.data));
|
dialogParams.SetInt(2,parseInt(radioGroup.selectedItem.data));
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
function doCancel()
|
function doCancel()
|
||||||
{
|
{
|
||||||
params.SetInt(1,0);
|
dialogParams.SetInt(1,0);
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
@ -22,17 +22,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
|
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
|
||||||
const nsIX509Cert = Components.interfaces.nsIX509Cert;
|
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
|
||||||
|
const nsIX509Cert = Components.interfaces.nsIX509Cert;
|
||||||
|
|
||||||
var params;
|
var dialogParams;
|
||||||
|
var pkiParams;
|
||||||
|
|
||||||
function onLoad()
|
function onLoad()
|
||||||
{
|
{
|
||||||
params = window.arguments[0].QueryInterface(nsIPKIParamBlock);
|
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
|
||||||
|
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
|
||||||
|
|
||||||
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
|
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
|
||||||
var message1 = params.GetString(1);
|
var message1 = dialogParams.GetString(1);
|
||||||
|
|
||||||
var currDate = new Date();
|
var currDate = new Date();
|
||||||
var message2 = bundle.formatStringFromName("serverCertExpiredMsg2",
|
var message2 = bundle.formatStringFromName("serverCertExpiredMsg2",
|
||||||
@ -44,12 +47,12 @@ function onLoad()
|
|||||||
|
|
||||||
function doOK()
|
function doOK()
|
||||||
{
|
{
|
||||||
params.SetInt(1,1);
|
dialogParams.SetInt(1,1);
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
function doCancel()
|
function doCancel()
|
||||||
{
|
{
|
||||||
params.SetInt(1,0);
|
dialogParams.SetInt(1,0);
|
||||||
window.close();
|
window.close();
|
||||||
}
|
}
|
||||||
|
@ -41,13 +41,11 @@
|
|||||||
<separator/>
|
<separator/>
|
||||||
<text value="&serverCertExpired.continue;" />
|
<text value="&serverCertExpired.continue;" />
|
||||||
<separator/>
|
<separator/>
|
||||||
<!--
|
|
||||||
<box>
|
<box>
|
||||||
<button id="examineCert-button" class="dialog" value="Examine Certificate"
|
<button id="examineCert-button" class="dialog" value="&examineCert.label;"
|
||||||
onclick=""/>
|
onclick=""/>
|
||||||
</box>
|
</box>
|
||||||
<separator/>
|
<separator/>
|
||||||
-->
|
|
||||||
<box>
|
<box>
|
||||||
<button id="ok-button" class="dialog" value="&ok.label;"
|
<button id="ok-button" class="dialog" value="&ok.label;"
|
||||||
style="width: 10ex" onclick="doOK();" disabled="false"/>
|
style="width: 10ex" onclick="doOK();" disabled="false"/>
|
||||||
|
@ -71,10 +71,12 @@ class nsNSSDialogHelper
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
const static char *kDefaultOpenWindowParam;
|
const static char *kDefaultOpenWindowParam;
|
||||||
|
//The params is going to be either a nsIPKIParamBlock or
|
||||||
|
//nsIDialogParamBlock
|
||||||
static nsresult openDialog(
|
static nsresult openDialog(
|
||||||
nsIDOMWindowInternal *window,
|
nsIDOMWindowInternal *window,
|
||||||
const char *url,
|
const char *url,
|
||||||
nsIPKIParamBlock *params);
|
nsISupports *params);
|
||||||
|
|
||||||
static nsresult openDialogVA(nsIDOMWindowInternal *window,
|
static nsresult openDialogVA(nsIDOMWindowInternal *window,
|
||||||
const char *format, ...);
|
const char *format, ...);
|
||||||
@ -122,7 +124,7 @@ nsresult
|
|||||||
nsNSSDialogHelper::openDialog(
|
nsNSSDialogHelper::openDialog(
|
||||||
nsIDOMWindowInternal *window,
|
nsIDOMWindowInternal *window,
|
||||||
const char *url,
|
const char *url,
|
||||||
nsIPKIParamBlock *params)
|
nsISupports *params)
|
||||||
{
|
{
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
nsCOMPtr<nsIDOMWindowInternal> hiddenWindow;
|
nsCOMPtr<nsIDOMWindowInternal> hiddenWindow;
|
||||||
@ -145,7 +147,7 @@ nsNSSDialogHelper::openDialog(
|
|||||||
url,
|
url,
|
||||||
"_blank",
|
"_blank",
|
||||||
nsNSSDialogHelper::kDefaultOpenWindowParam,
|
nsNSSDialogHelper::kDefaultOpenWindowParam,
|
||||||
&NS_GET_IID(nsIPKIParamBlock),
|
&NS_GET_IID(nsISupports),
|
||||||
(nsISupports*)params
|
(nsISupports*)params
|
||||||
);
|
);
|
||||||
if ( !argv ) return NS_ERROR_FAILURE;
|
if ( !argv ) return NS_ERROR_FAILURE;
|
||||||
@ -192,7 +194,8 @@ nsNSSDialogHelper::openDialogVA(nsIDOMWindowInternal *window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ==== */
|
/* ==== */
|
||||||
static NS_DEFINE_CID(kDialogParamBlockCID, NS_PKIPARAMBLOCK_CID);
|
static NS_DEFINE_CID(kDialogParamBlockCID, NS_DialogParamBlock_CID);
|
||||||
|
static NS_DEFINE_CID(kPKIParamBlockCID, NS_PKIPARAMBLOCK_CID);
|
||||||
|
|
||||||
nsNSSDialogs::nsNSSDialogs()
|
nsNSSDialogs::nsNSSDialogs()
|
||||||
{
|
{
|
||||||
@ -240,7 +243,7 @@ nsNSSDialogs::SetPassword(nsIInterfaceRequestor *ctx,
|
|||||||
// Get the parent window for the dialog
|
// Get the parent window for the dialog
|
||||||
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
|
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
|
||||||
|
|
||||||
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kDialogParamBlockCID);
|
nsCOMPtr<nsIDialogParamBlock> block = do_CreateInstance(kDialogParamBlockCID);
|
||||||
if (!block) return NS_ERROR_FAILURE;
|
if (!block) return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
// void ChangePassword(in wstring tokenName, out int status);
|
// void ChangePassword(in wstring tokenName, out int status);
|
||||||
@ -275,7 +278,7 @@ nsNSSDialogs::UnknownIssuer(nsITransportSecurityInfo *socketInfo,
|
|||||||
|
|
||||||
*_retval = PR_FALSE;
|
*_retval = PR_FALSE;
|
||||||
|
|
||||||
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kDialogParamBlockCID);
|
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
|
||||||
|
|
||||||
if (!block)
|
if (!block)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
@ -293,8 +296,8 @@ nsNSSDialogs::UnknownIssuer(nsITransportSecurityInfo *socketInfo,
|
|||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
PRInt32 status;
|
PRInt32 status;
|
||||||
|
nsCOMPtr<nsIDialogParamBlock> dialogBlock = do_QueryInterface(block);
|
||||||
rv = block->GetInt(1, &status);
|
rv = dialogBlock->GetInt(1, &status);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
@ -303,7 +306,7 @@ nsNSSDialogs::UnknownIssuer(nsITransportSecurityInfo *socketInfo,
|
|||||||
} else {
|
} else {
|
||||||
// The user wants to continue, let's figure out
|
// The user wants to continue, let's figure out
|
||||||
// what to do with this cert.
|
// what to do with this cert.
|
||||||
rv = block->GetInt(2, &addType);
|
rv = dialogBlock->GetInt(2, &addType);
|
||||||
switch (addType) {
|
switch (addType) {
|
||||||
case 0:
|
case 0:
|
||||||
*outAddType = ADD_TRUSTED_PERMANENTLY;
|
*outAddType = ADD_TRUSTED_PERMANENTLY;
|
||||||
@ -336,12 +339,13 @@ nsNSSDialogs::MismatchDomain(nsITransportSecurityInfo *socketInfo,
|
|||||||
|
|
||||||
*_retval = PR_FALSE;
|
*_retval = PR_FALSE;
|
||||||
|
|
||||||
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kDialogParamBlockCID);
|
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
|
||||||
|
|
||||||
if (!block)
|
if (!block)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
rv = block->SetString(1, targetURL);
|
nsCOMPtr<nsIDialogParamBlock> dialogBlock = do_QueryInterface(block);
|
||||||
|
rv = dialogBlock->SetString(1, targetURL);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
@ -357,7 +361,7 @@ nsNSSDialogs::MismatchDomain(nsITransportSecurityInfo *socketInfo,
|
|||||||
|
|
||||||
PRInt32 status;
|
PRInt32 status;
|
||||||
|
|
||||||
rv = block->GetInt(1, &status);
|
rv = dialogBlock->GetInt(1, &status);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
@ -380,7 +384,7 @@ nsNSSDialogs::CertExpired(nsITransportSecurityInfo *socketInfo,
|
|||||||
|
|
||||||
*_retval = PR_FALSE;
|
*_retval = PR_FALSE;
|
||||||
|
|
||||||
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kDialogParamBlockCID);
|
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
|
||||||
|
|
||||||
if (!block)
|
if (!block)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
@ -427,7 +431,8 @@ nsNSSDialogs::CertExpired(nsITransportSecurityInfo *socketInfo,
|
|||||||
Recycle(commonName);
|
Recycle(commonName);
|
||||||
Recycle(formattedDatePR);
|
Recycle(formattedDatePR);
|
||||||
|
|
||||||
rv = block->SetString(1,message1);
|
nsCOMPtr<nsIDialogParamBlock> dialogBlock = do_QueryInterface(block);
|
||||||
|
rv = dialogBlock->SetString(1,message1);
|
||||||
|
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
@ -441,7 +446,7 @@ nsNSSDialogs::CertExpired(nsITransportSecurityInfo *socketInfo,
|
|||||||
block);
|
block);
|
||||||
|
|
||||||
PRInt32 status;
|
PRInt32 status;
|
||||||
rv = block->GetInt(1, &status);
|
rv = dialogBlock->GetInt(1, &status);
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
@ -607,13 +612,14 @@ nsNSSDialogs::DownloadCACert(nsIInterfaceRequestor *ctx,
|
|||||||
// Get the parent window for the dialog
|
// Get the parent window for the dialog
|
||||||
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
|
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
|
||||||
|
|
||||||
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kDialogParamBlockCID);
|
nsCOMPtr<nsIDialogParamBlock> block = do_CreateInstance(kDialogParamBlockCID);
|
||||||
if (!block) return NS_ERROR_FAILURE;
|
if (!block) return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
nsXPIDLString commonName;
|
nsXPIDLString commonName;
|
||||||
rv = cert->GetCommonName(getter_Copies(commonName));
|
rv = cert->GetCommonName(getter_Copies(commonName));
|
||||||
if (NS_FAILED(rv))
|
if (NS_FAILED(rv))
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
rv = block->SetString(1, commonName);
|
rv = block->SetString(1, commonName);
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#define _NSPKIPARAMBLOCK_
|
#define _NSPKIPARAMBLOCK_
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsIPKIParamBlock.h"
|
#include "nsIPKIParamBlock.h"
|
||||||
|
#include "nsIDialogParamBlock.h"
|
||||||
|
|
||||||
#define NS_PKIPARAMBLOCK_CID \
|
#define NS_PKIPARAMBLOCK_CID \
|
||||||
{ 0x0bec75a8, 0x1dd2, 0x11b2, \
|
{ 0x0bec75a8, 0x1dd2, 0x11b2, \
|
||||||
@ -43,7 +44,8 @@
|
|||||||
|
|
||||||
#define NS_PKIPARAMBLOCK_CONTRACTID "@mozilla.org/security/pkiparamblock;1"
|
#define NS_PKIPARAMBLOCK_CONTRACTID "@mozilla.org/security/pkiparamblock;1"
|
||||||
|
|
||||||
class nsPKIParamBlock : public nsIPKIParamBlock
|
class nsPKIParamBlock : public nsIPKIParamBlock,
|
||||||
|
public nsIDialogParamBlock
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum { kNumISupports = 4 };
|
enum { kNumISupports = 4 };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user