Index: mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp =================================================================== RCS file: /cvsroot/mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp,v retrieving revision 1.554 diff -pu -r1.554 mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp --- mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp +++ mozilla/modules/plugin/base/src/nsPluginHostImpl.cpp @@ -3339,12 +3339,14 @@ NS_IMETHODIMP nsPluginHostImpl::Instanti 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(); @@ -3380,8 +3382,7 @@ NS_IMETHODIMP nsPluginHostImpl::Instanti return rv; // Better fail if we can't do security checks nsCOMPtr doc; - if (aOwner) - aOwner->GetDocument(getter_AddRefs(doc)); + aOwner->GetDocument(getter_AddRefs(doc)); if (!doc) return NS_ERROR_NULL_POINTER; @@ -3439,7 +3440,7 @@ NS_IMETHODIMP nsPluginHostImpl::Instanti 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) @@ -3552,7 +3553,7 @@ NS_IMETHODIMP nsPluginHostImpl::Instanti 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(); @@ -3573,13 +3574,13 @@ NS_IMETHODIMP nsPluginHostImpl::Instanti 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); @@ -3619,7 +3620,7 @@ NS_IMETHODIMP nsPluginHostImpl::Instanti } 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; Index: mozilla/xpcom/sample/xpconnect-sample.html =================================================================== RCS file: /cvsroot/mozilla/xpcom/sample/xpconnect-sample.html,v retrieving revision 1.11 diff -pu -r1.11 mozilla/xpcom/sample/xpconnect-sample.html --- mozilla/xpcom/sample/xpconnect-sample.html +++ mozilla/xpcom/sample/xpconnect-sample.html @@ -68,7 +68,7 @@ href="http://bugzilla.mozilla.org/show_b

nsSampleFactory.cpp

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 generic