r=vidur, av

a=brendan
bug=49525

This simple fix just adds parameters to an existing method in an XPCOM
safe way, by defining a new method at the end of the interface
definition with the additional parameters.

Original method:

    NS_IMETHOD
    GetURL(nsISupports* pluginInst,
           const char* url,
           const char* target = NULL,
           nsIPluginStreamListener* streamListener = NULL,
           const char* altHost = NULL,
           const char* referrer = NULL,
           PRBool forceJSEnabled = PR_FALSE) = 0;

New method:

    NS_IMETHOD
    GetURLWithHeaders(nsISupports* pluginInst,
                      const char* url,
                      const char* target = NULL,
                      nsIPluginStreamListener* streamListener = NULL,
                      const char* altHost = NULL,
                      const char* referrer = NULL,
                      PRBool forceJSEnabled = PR_FALSE,
                      PRUint32 getHeadersLength = 0,
                      const char* getHeaders = NULL) = 0;

I have modified nsPluginHostImpl.h to include this new method, and
modified nsPluginHostImpl.cpp so that its GetURL calls GetURLWithHeaders
with null values for the last two params.

M modules/plugin/public/nsIPluginManager.h
M modules/plugin/nglsrc/nsPluginHostImpl.cpp
M modules/plugin/nglsrc/nsPluginHostImpl.h
This commit is contained in:
edburns@acm.org
2000-09-14 22:57:56 +00:00
parent 69c6964d59
commit 13cf732a0e
6 changed files with 130 additions and 12 deletions

View File

@@ -1533,6 +1533,20 @@ NS_IMETHODIMP nsPluginHostImpl::GetURL(nsISupports* pluginInst,
const char* altHost,
const char* referrer,
PRBool forceJSEnabled)
{
return GetURLWithHeaders(pluginInst, url, target, streamListener,
altHost, referrer, forceJSEnabled, nsnull, nsnull);
}
NS_IMETHODIMP nsPluginHostImpl::GetURLWithHeaders(nsISupports* pluginInst,
const char* url,
const char* target,
nsIPluginStreamListener* streamListener,
const char* altHost,
const char* referrer,
PRBool forceJSEnabled,
PRUint32 getHeadersLength,
const char* getHeaders)
{
nsAutoString string; string.AssignWithConversion(url);
nsIPluginInstance *instance;
@@ -1567,7 +1581,8 @@ NS_IMETHODIMP nsPluginHostImpl::GetURL(nsISupports* pluginInst,
else if (0 == PL_strcmp(target, "_current"))
target = "_self";
rv = owner->GetURL(url, target, nsnull, 0, nsnull, nsnull);
rv = owner->GetURL(url, target, nsnull, 0, (void *) getHeaders,
getHeadersLength);
}
NS_RELEASE(peer);
@@ -1575,7 +1590,8 @@ NS_IMETHODIMP nsPluginHostImpl::GetURL(nsISupports* pluginInst,
}
if (nsnull != streamListener)
rv = NewPluginURLStream(string, instance, streamListener);
rv = NewPluginURLStream(string, instance, streamListener,
nsnull, nsnull, getHeaders, getHeadersLength);
NS_RELEASE(instance);
}