Bug 189296 - Plugin code takes address of nsCOMPtr's. r=adamlock, sr=jst

This commit is contained in:
dbradley%netscape.com 2003-01-20 13:03:06 +00:00
Родитель ef43edbd50
Коммит f6bc25bfaa
5 изменённых файлов: 16 добавлений и 9 удалений

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

@ -710,7 +710,8 @@ NewControl(const char *pluginType,
if (argv[i])
{
nsCOMPtr<nsIDOMElement> element;
NPN_GetValue(pData->pPluginInstance, NPNVDOMElement, (void *) &element);
NPN_GetValue(pData->pPluginInstance, NPNVDOMElement,
NS_STATIC_CAST(nsIDOMElement **, getter_AddRefs(element)));
if (element)
{
nsCOMPtr<nsIDOMNode> tagAsNode (do_QueryInterface(element));

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

@ -64,7 +64,8 @@ HRESULT IEBrowser::Init(PluginInstanceData *pData)
{
mData = pData;
// Get the location URL
NPN_GetValue(mData->pPluginInstance, NPNVDOMWindow, (void *) &mDOMWindow);
NPN_GetValue(mData->pPluginInstance, NPNVDOMWindow,
NS_STATIC_CAST(nsIDOMWindow **,getter_AddRefs(mDOMWindow)));
if (mDOMWindow)
{
mWebNavigation = do_GetInterface(mDOMWindow);

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

@ -743,14 +743,16 @@ public:
nsCOMPtr<nsIDOMElement> element;
// Get the DOM document
NPN_GetValue(mData->pPluginInstance, NPNVDOMElement, (void *) &element);
NPN_GetValue(mData->pPluginInstance, NPNVDOMElement,
NS_STATIC_CAST(nsIDOMElement **, getter_AddRefs(element)));
if (element)
{
element->GetOwnerDocument(getter_AddRefs(mDOMDocument));
}
// Get the DOM window
NPN_GetValue(mData->pPluginInstance, NPNVDOMWindow, (void *) &mDOMWindow);
NPN_GetValue(mData->pPluginInstance, NPNVDOMWindow,
NS_STATIC_CAST(nsIDOMWindow **, getter_AddRefs(mDOMWindow)));
if (mDOMWindow)
{
nsCOMPtr<nsIDOMWindowInternal> windowInternal = do_QueryInterface(mDOMWindow);

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

@ -376,7 +376,8 @@ nsScriptablePeer::ConvertVariants(VARIANT *aIn, nsIVariant **aOut)
if (pManager)
{
rv = pManager->CreateInstanceByContractID("@mozilla.org/variant;1",
nsnull, NS_GET_IID(nsIWritableVariant), (void **) &v);
nsnull, NS_GET_IID(nsIWritableVariant),
getter_AddRefs(v));
pManager->Release();
}
}
@ -740,10 +741,11 @@ nsEventSink::InternalInvoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wF
pFuncDesc = NULL;
nsCOMPtr<nsIDOMElement> element;
NPN_GetValue(mPlugin->pPluginInstance, NPNVDOMElement, (void *) &element);
NPN_GetValue(mPlugin->pPluginInstance, NPNVDOMElement,
NS_STATIC_CAST(nsIDOMElement **, getter_AddRefs(element)));
if (!element)
{
NS_ASSERTION(element, "can't get the object element");
NS_ERROR("can't get the object element");
return S_OK;
}
nsAutoString id;
@ -758,7 +760,8 @@ nsEventSink::InternalInvoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wF
// Fire the script event handler...
nsCOMPtr<nsIDOMWindow> window;
NPN_GetValue(mPlugin->pPluginInstance, NPNVDOMWindow, (void *)&window);
NPN_GetValue(mPlugin->pPluginInstance, NPNVDOMWindow,
NS_STATIC_CAST(nsIDOMWindow **, getter_AddRefs(window)));
nsCOMPtr<nsIScriptEventManager> eventManager(do_GetInterface(window));
if (!eventManager) return S_OK;

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

@ -6590,7 +6590,7 @@ nsPluginByteRangeStreamListener::OnStartRequest(nsIRequest *request, nsISupports
//get nsPluginStreamListenerPeer* ptr from finalStreamListener
nsPluginStreamListenerPeer *pslp = NS_REINTERPRET_CAST(nsPluginStreamListenerPeer*,
*(NS_REINTERPRET_CAST(void**, &finalStreamListener)));
finalStreamListener.get());
rv = pslp->ServeStreamAsFile(request, ctxt);
return rv;
}