we no longer consider failures from GetAttributes() or even expect the

plugin host to implement it.
This commit is contained in:
michaelp%netscape.com 1998-09-27 22:16:00 +00:00
Родитель 2cff76a750
Коммит 774736760d
2 изменённых файлов: 56 добавлений и 60 удалений

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

@ -91,9 +91,9 @@ NS_IMETHODIMP ns4xPluginInstance :: QueryInterface(const nsIID& iid, void** inst
NS_IMETHODIMP ns4xPluginInstance :: Initialize(nsIPluginInstancePeer* peer) NS_IMETHODIMP ns4xPluginInstance :: Initialize(nsIPluginInstancePeer* peer)
{ {
PRUint16 count; PRUint16 count = 0;
const char* const* names; const char* const* names = nsnull;
const char* const* values; const char* const* values = nsnull;
NS_ASSERTION(peer != NULL, "null peer"); NS_ASSERTION(peer != NULL, "null peer");
@ -102,40 +102,38 @@ NS_IMETHODIMP ns4xPluginInstance :: Initialize(nsIPluginInstancePeer* peer)
NS_ADDREF(fPeer); NS_ADDREF(fPeer);
nsresult error; nsresult error;
nsIPluginTagInfo *taginfo; nsIPluginTagInfo *taginfo = nsnull;
error = fPeer->QueryInterface(kIPluginTagInfoIID, (void **)&taginfo); error = fPeer->QueryInterface(kIPluginTagInfoIID, (void **)&taginfo);
if (NS_OK == error) if (NS_OK == error)
{ {
if ((error = taginfo->GetAttributes(count, names, values)) != NS_OK) taginfo->GetAttributes(count, names, values);
return error; NS_IF_RELEASE(taginfo);
if (fCallbacks->newp == NULL)
return NS_ERROR_FAILURE; // XXX right error?
// XXX Note that the NPPluginType_* enums were crafted to be
// backward compatible...
nsPluginMode mode;
nsMIMEType mimetype;
fPeer->GetMode(&mode);
fPeer->GetMIMEType(&mimetype);
error = (nsresult)
CallNPP_NewProc(fCallbacks->newp,
(char *)mimetype,
&fNPP,
(PRUint16)mode,
count,
(char**)names,
(char**)values,
NULL); // saved data
NS_RELEASE(taginfo);
} }
if (fCallbacks->newp == NULL)
return NS_ERROR_FAILURE; // XXX right error?
// XXX Note that the NPPluginType_* enums were crafted to be
// backward compatible...
nsPluginMode mode;
nsMIMEType mimetype;
fPeer->GetMode(&mode);
fPeer->GetMIMEType(&mimetype);
error = (nsresult)
CallNPP_NewProc(fCallbacks->newp,
(char *)mimetype,
&fNPP,
(PRUint16)mode,
count,
(char**)names,
(char**)values,
NULL); // saved data
return error; return error;
} }

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

@ -91,9 +91,9 @@ NS_IMETHODIMP ns4xPluginInstance :: QueryInterface(const nsIID& iid, void** inst
NS_IMETHODIMP ns4xPluginInstance :: Initialize(nsIPluginInstancePeer* peer) NS_IMETHODIMP ns4xPluginInstance :: Initialize(nsIPluginInstancePeer* peer)
{ {
PRUint16 count; PRUint16 count = 0;
const char* const* names; const char* const* names = nsnull;
const char* const* values; const char* const* values = nsnull;
NS_ASSERTION(peer != NULL, "null peer"); NS_ASSERTION(peer != NULL, "null peer");
@ -102,40 +102,38 @@ NS_IMETHODIMP ns4xPluginInstance :: Initialize(nsIPluginInstancePeer* peer)
NS_ADDREF(fPeer); NS_ADDREF(fPeer);
nsresult error; nsresult error;
nsIPluginTagInfo *taginfo; nsIPluginTagInfo *taginfo = nsnull;
error = fPeer->QueryInterface(kIPluginTagInfoIID, (void **)&taginfo); error = fPeer->QueryInterface(kIPluginTagInfoIID, (void **)&taginfo);
if (NS_OK == error) if (NS_OK == error)
{ {
if ((error = taginfo->GetAttributes(count, names, values)) != NS_OK) taginfo->GetAttributes(count, names, values);
return error; NS_IF_RELEASE(taginfo);
if (fCallbacks->newp == NULL)
return NS_ERROR_FAILURE; // XXX right error?
// XXX Note that the NPPluginType_* enums were crafted to be
// backward compatible...
nsPluginMode mode;
nsMIMEType mimetype;
fPeer->GetMode(&mode);
fPeer->GetMIMEType(&mimetype);
error = (nsresult)
CallNPP_NewProc(fCallbacks->newp,
(char *)mimetype,
&fNPP,
(PRUint16)mode,
count,
(char**)names,
(char**)values,
NULL); // saved data
NS_RELEASE(taginfo);
} }
if (fCallbacks->newp == NULL)
return NS_ERROR_FAILURE; // XXX right error?
// XXX Note that the NPPluginType_* enums were crafted to be
// backward compatible...
nsPluginMode mode;
nsMIMEType mimetype;
fPeer->GetMode(&mode);
fPeer->GetMIMEType(&mimetype);
error = (nsresult)
CallNPP_NewProc(fCallbacks->newp,
(char *)mimetype,
&fNPP,
(PRUint16)mode,
count,
(char**)names,
(char**)values,
NULL); // saved data
return error; return error;
} }