Bug 336989 Useless null check of aOwner in nsPluginHostImpl::InstantiateEmbeddedPlugin

Also fixing a spelling error which happens to appear in pluginhostimpl and xpconnect sample
r=jst sr=jst
This commit is contained in:
timeless%mozdev.org 2006-06-03 23:23:45 +00:00
Родитель eb6cd3f970
Коммит 536dae940c
2 изменённых файлов: 10 добавлений и 9 удалений

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

@ -3284,12 +3284,14 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbeddedPlugin(const char *aMimeType,
nsIURI* aURL,
nsIPluginInstanceOwner *aOwner)
{
NS_ENSURE_ARG_POINTER(aOwner);
#ifdef PLUGIN_LOGGING
nsCAutoString urlSpec;
if(aURL != nsnull) (void)aURL->GetAsciiSpec(urlSpec);
PR_LOG(nsPluginLogging::gPluginLog, PLUGIN_LOG_NORMAL,
("nsPluginHostImpl::InstatiateEmbeddedPlugin Begin mime=%s, owner=%p, url=%s\n",
("nsPluginHostImpl::InstantiateEmbeddedPlugin Begin mime=%s, owner=%p, url=%s\n",
aMimeType, aOwner, urlSpec.get()));
PR_LogFlush();
@ -3325,8 +3327,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbeddedPlugin(const char *aMimeType,
return rv; // Better fail if we can't do security checks
nsCOMPtr<nsIDocument> doc;
if (aOwner)
aOwner->GetDocument(getter_AddRefs(doc));
aOwner->GetDocument(getter_AddRefs(doc));
if (!doc)
return NS_ERROR_NULL_POINTER;
@ -3384,7 +3385,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbeddedPlugin(const char *aMimeType,
if(FindStoppedPluginForURL(aURL, aOwner) == NS_OK) {
PLUGIN_LOG(PLUGIN_LOG_NOISY,
("nsPluginHostImpl::InstatiateEmbeddedPlugin FoundStopped mime=%s\n", aMimeType));
("nsPluginHostImpl::InstantiateEmbeddedPlugin FoundStopped mime=%s\n", aMimeType));
aOwner->GetInstance(instance);
if(!isJava && bCanHandleInternally)
@ -3497,7 +3498,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateEmbeddedPlugin(const char *aMimeType,
if(aURL != nsnull) (void)aURL->GetAsciiSpec(urlSpec2);
PR_LOG(nsPluginLogging::gPluginLog, PLUGIN_LOG_NORMAL,
("nsPluginHostImpl::InstatiateEmbeddedPlugin Finished mime=%s, rv=%d, owner=%p, url=%s\n",
("nsPluginHostImpl::InstantiateEmbeddedPlugin Finished mime=%s, rv=%d, owner=%p, url=%s\n",
aMimeType, rv, aOwner, urlSpec2.get()));
PR_LogFlush();
@ -3518,13 +3519,13 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
nsCAutoString urlSpec;
aURI->GetSpec(urlSpec);
PLUGIN_LOG(PLUGIN_LOG_NORMAL,
("nsPluginHostImpl::InstatiateFullPagePlugin Begin mime=%s, owner=%p, url=%s\n",
("nsPluginHostImpl::InstantiateFullPagePlugin Begin mime=%s, owner=%p, url=%s\n",
aMimeType, aOwner, urlSpec.get()));
#endif
if(FindStoppedPluginForURL(aURI, aOwner) == NS_OK) {
PLUGIN_LOG(PLUGIN_LOG_NOISY,
("nsPluginHostImpl::InstatiateFullPagePlugin FoundStopped mime=%s\n",aMimeType));
("nsPluginHostImpl::InstantiateFullPagePlugin FoundStopped mime=%s\n",aMimeType));
nsIPluginInstance* instance;
aOwner->GetInstance(instance);
@ -3564,7 +3565,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",
("nsPluginHostImpl::InstantiateFullPagePlugin End mime=%s, rv=%d, owner=%p, url=%s\n",
aMimeType, rv, aOwner, urlSpec.get()));
return rv;

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

@ -68,7 +68,7 @@ href="http://bugzilla.mozilla.org/show_bug.cgi?id=14460">QueryInterface</a>.
<p><b><a href="http://lxr.mozilla.org/mozilla/source/xpcom/sample/nsSampleFactory.cpp">nsSampleFactory.cpp</a></b>
<p>This is the class which builds the instance of the nsSample class.
The COM framework uses factories to create instance of implementations
rather than having the implementations instatiate themselves in order to
rather than having the implementations instantiate themselves in order to
increase portability of code. This factory inherits from nsFactory,
which is also an XPCOM object. To gain more knowledge of factories
see the <a href="http://www.mozilla.org/projects/xpcom/generic-factory.html">generic