Bug 292114 InstantiateFullPagePlugin should take nsIURI*, not nsString&

r=jst sr=bz a=asa
This commit is contained in:
cbiesinger%web.de 2005-04-29 12:11:45 +00:00
Родитель d19d8a2ecb
Коммит 1225a042ce
6 изменённых файлов: 25 добавлений и 41 удалений

Просмотреть файл

@ -1363,19 +1363,12 @@ nsObjectFrame::InstantiatePlugin(nsPresContext* aPresContext,
nsCOMPtr<nsIPluginDocument> pDoc (do_QueryInterface(doc));
if (pDoc) { /* full-page mode */
nsCAutoString spec;
rv = aURI->GetSpec(spec);
if (NS_SUCCEEDED(rv)) {
NS_ConvertUTF8toUCS2 url(spec);
nsCOMPtr<nsIStreamListener> stream;
rv = aPluginHost->InstantiateFullPagePlugin(aMimeType, url,
/* resulting stream listener */ *getter_AddRefs(stream),
mInstanceOwner);
if (NS_SUCCEEDED(rv))
pDoc->SetStreamListener(stream);
}
nsCOMPtr<nsIStreamListener> stream;
rv = aPluginHost->InstantiateFullPagePlugin(aMimeType, aURI,
/* resulting stream listener */ *getter_AddRefs(stream),
mInstanceOwner);
if (NS_SUCCEEDED(rv))
pDoc->SetStreamListener(stream);
} else { /* embedded mode */
rv = aPluginHost->InstantiateEmbededPlugin(aMimeType, aURI,
mInstanceOwner);

Просмотреть файл

@ -52,11 +52,10 @@ interface nsIPlugin;
interface nsIURI;
interface nsIDOMPlugin;
[ref] native nsStringRef(nsString);
[ptr] native PRLibraryPtr(PRLibrary);
[ref] native nsIStreamListenerRef(nsIStreamListener *);
[uuid(264c0640-1c31-11d2-a82e-0040959a28c9)]
[uuid(e740d8c4-fd94-456a-9506-9e044c5da27a)]
interface nsIPluginHost : nsIFactory
{
void init();
@ -69,7 +68,7 @@ interface nsIPluginHost : nsIFactory
void instantiateEmbededPlugin(in string aMimeType, in nsIURI aURL, in nsIPluginInstanceOwner aOwner);
void instantiateFullPagePlugin(in string aMimeType, in nsStringRef aURLSpec, in nsIStreamListenerRef aStreamListener, in nsIPluginInstanceOwner aOwner);
void instantiateFullPagePlugin(in string aMimeType, in nsIURI aURI, in nsIStreamListenerRef aStreamListener, in nsIPluginInstanceOwner aOwner);
void setUpPluginInstance(in string aMimeType, in nsIURI aURL, in nsIPluginInstanceOwner aOwner);

Просмотреть файл

@ -80,7 +80,7 @@
// http://www.mozilla.org/projects/nspr/reference/html/prlog.html
#if PLUGIN_LOGGING
#ifdef PLUGIN_LOGGING
class nsPluginLogging
{
@ -95,7 +95,7 @@ public:
#endif // PR_LOGGING
// Quick-use macros
#if PLUGIN_LOGGING
#ifdef PLUGIN_LOGGING
#define NPN_PLUGIN_LOG(a, b) \
PR_BEGIN_MACRO \
PR_LOG(nsPluginLogging::gNPNLog, a, b); \
@ -105,7 +105,7 @@ public:
#define NPN_PLUGIN_LOG(a, b)
#endif
#if PLUGIN_LOGGING
#ifdef PLUGIN_LOGGING
#define NPP_PLUGIN_LOG(a, b) \
PR_BEGIN_MACRO \
PR_LOG(nsPluginLogging::gNPPLog, a, b); \
@ -115,7 +115,7 @@ public:
#define NPP_PLUGIN_LOG(a, b)
#endif
#if PLUGIN_LOGGING
#ifdef PLUGIN_LOGGING
#define PLUGIN_LOG(a, b) \
PR_BEGIN_MACRO \
PR_LOG(nsPluginLogging::gPluginLog, a, b); \

Просмотреть файл

@ -2035,7 +2035,7 @@ _requestread(NPStream *pstream, NPByteRange *rangeList)
NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_RequestRead: stream=%p\n",
(void*)pstream));
#if PLUGIN_LOGGING
#ifdef PLUGIN_LOGGING
for(NPByteRange * range = rangeList; range != nsnull; range = range->next)
PR_LOG(nsPluginLogging::gNPNLog,PLUGIN_LOG_NOISY,
("%i-%i", range->offset, range->offset + range->length - 1));

Просмотреть файл

@ -3503,39 +3503,31 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbededPlugin(const char *aMimeType,
////////////////////////////////////////////////////////////////////////
/* Called by full-page case */
NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
nsString& aURLSpec,
nsIURI* aURI,
nsIStreamListener *&aStreamListener,
nsIPluginInstanceOwner *aOwner)
{
#ifdef PLUGIN_LOGGING
nsCAutoString urlSpec;
aURI->GetSpec(urlSpec);
PLUGIN_LOG(PLUGIN_LOG_NORMAL,
("nsPluginHostImpl::InstatiateFullPagePlugin Begin mime=%s, owner=%p, url=%s\n",
aMimeType, aOwner, NS_LossyConvertUCS2toASCII(aURLSpec).get()));
aMimeType, aOwner, urlSpec.get()));
#endif
nsresult rv;
nsIURI *url;
//create a URL so that the instantiator can do file ext.
//based plugin lookups...
rv = NS_NewURI(&url, aURLSpec);
if (rv != NS_OK)
url = nsnull;
if(FindStoppedPluginForURL(url, aOwner) == NS_OK) {
if(FindStoppedPluginForURL(aURI, aOwner) == NS_OK) {
PLUGIN_LOG(PLUGIN_LOG_NOISY,
("nsPluginHostImpl::InstatiateFullPagePlugin FoundStopped mime=%s\n",aMimeType));
nsIPluginInstance* instance;
aOwner->GetInstance(instance);
if(!aMimeType || PL_strncasecmp(aMimeType, "application/x-java-vm", 21))
rv = NewFullPagePluginStream(aStreamListener, instance);
NewFullPagePluginStream(aStreamListener, instance);
NS_IF_RELEASE(instance);
return NS_OK;
}
rv = SetUpPluginInstance(aMimeType, url, aOwner);
NS_IF_RELEASE(url);
nsresult rv = SetUpPluginInstance(aMimeType, aURI, aOwner);
if (NS_OK == rv)
{
@ -3565,7 +3557,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
PLUGIN_LOG(PLUGIN_LOG_NORMAL,
("nsPluginHostImpl::InstatiateFullPagePlugin End mime=%s, rv=%d, owner=%p, url=%s\n",
aMimeType, rv, aOwner, NS_LossyConvertUCS2toASCII(aURLSpec).get()));
aMimeType, rv, aOwner, urlSpec.get()));
return rv;
}
@ -5901,7 +5893,7 @@ nsresult nsPluginHostImpl::NewEmbededPluginStream(nsIURI* aURL,
if (!aURL)
return NS_OK;
nsPluginStreamListenerPeer *listener = (nsPluginStreamListenerPeer *)new nsPluginStreamListenerPeer();
nsPluginStreamListenerPeer *listener = new nsPluginStreamListenerPeer();
if (listener == nsnull)
return NS_ERROR_OUT_OF_MEMORY;

Просмотреть файл

@ -270,7 +270,7 @@ public:
InstantiateEmbededPlugin(const char *aMimeType, nsIURI* aURL, nsIPluginInstanceOwner *aOwner);
NS_IMETHOD
InstantiateFullPagePlugin(const char *aMimeType, nsString& aURLSpec, nsIStreamListener *&aStreamListener, nsIPluginInstanceOwner *aOwner);
InstantiateFullPagePlugin(const char *aMimeType, nsIURI* aURI, nsIStreamListener *&aStreamListener, nsIPluginInstanceOwner *aOwner);
NS_IMETHOD
SetUpPluginInstance(const char *aMimeType, nsIURI *aURL, nsIPluginInstanceOwner *aOwner);