Bug 388977, Only compile nsPluginDirServiceProvider.cpp on Windows, r+sr=jst

git-svn-id: svn://10.0.0.236/trunk@230386 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
flamingice%sourmilk.net
2007-07-20 20:34:51 +00:00
parent 96d1dc1145
commit a4b1d9a5e0
4 changed files with 10 additions and 12 deletions

View File

@@ -89,7 +89,6 @@ CPPSRCS = \
nsPluginHostImpl.cpp \
nsPluginModule.cpp \
nsPluginInstancePeer.cpp \
nsPluginDirServiceProvider.cpp \
nsJSNPRuntime.cpp \
$(NULL)
@@ -100,6 +99,7 @@ else
ifneq (,$(filter WINNT WINCE,$(OS_ARCH)))
CPPSRCS += nsPluginsDirWin.cpp
CPPSRCS += nsPluginNativeWindowWin.cpp
CPPSRCS += nsPluginDirServiceProvider.cpp
else
ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
CPPSRCS += nsPluginsDirOS2.cpp

View File

@@ -48,8 +48,6 @@
#include "prmem.h"
#include "nsArrayEnumerator.h"
#if defined (XP_WIN)
typedef struct structVer
{
WORD wMajor;
@@ -193,7 +191,6 @@ CompareVersion(verBlock vbVersionOld, verBlock vbVersionNew)
/* the versions are all the same */
return 0;
}
#endif
//*****************************************************************************
// nsPluginDirServiceProvider::Constructor/Destructor
@@ -229,7 +226,6 @@ nsPluginDirServiceProvider::GetFile(const char *prop, PRBool *persistant,
*_retval = nsnull;
*persistant = PR_TRUE;
#if defined(XP_WIN)
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
if (!prefs) {
return rv;
@@ -544,7 +540,6 @@ nsPluginDirServiceProvider::GetFile(const char *prop, PRBool *persistant,
}
}
#endif
if (localFile && NS_SUCCEEDED(rv))
return CallQueryInterface(localFile, _retval);
@@ -552,7 +547,6 @@ nsPluginDirServiceProvider::GetFile(const char *prop, PRBool *persistant,
return rv;
}
#ifdef XP_WIN
nsresult
nsPluginDirServiceProvider::GetPLIDDirectories(nsISimpleEnumerator **aEnumerator)
{
@@ -635,5 +629,3 @@ nsPluginDirServiceProvider::GetPLIDDirectoriesWithHKEY(HKEY aKey, nsCOMArray<nsI
return NS_OK;
}
#endif

View File

@@ -3311,6 +3311,7 @@ NS_IMETHODIMP nsPluginHostImpl::Destroy(void)
NS_RELEASE(sPluginTempDir);
}
#ifdef XP_WIN
if (mPrivateDirServiceProvider)
{
nsCOMPtr<nsIDirectoryService> dirService =
@@ -3319,6 +3320,7 @@ NS_IMETHODIMP nsPluginHostImpl::Destroy(void)
dirService->UnregisterProvider(mPrivateDirServiceProvider);
mPrivateDirServiceProvider = nsnull;
}
#endif /* XP_WIN */
nsCOMPtr<nsIPrefBranch2> prefBranch(do_QueryInterface(mPrefService));
if (prefBranch) {
@@ -5297,9 +5299,11 @@ nsresult nsPluginHostImpl::FindPlugins(PRBool aCreatePluginList, PRBool * aPlugi
if (compManager)
LoadXPCOMPlugins(compManager);
#ifdef XP_WIN
// Failure here is not a show-stopper so just warn.
rv = EnsurePrivateDirServiceProvider();
NS_ASSERTION(NS_SUCCEEDED(rv), "Failed to register dir service provider.");
#endif /* XP_WIN */
nsCOMPtr<nsIProperties> dirService(do_GetService(kDirectoryServiceContractID, &rv));
if (NS_FAILED(rv))
@@ -5331,8 +5335,7 @@ nsresult nsPluginHostImpl::FindPlugins(PRBool aCreatePluginList, PRBool * aPlugi
mPluginsLoaded = PR_TRUE; // at this point 'some' plugins have been loaded,
// the rest is optional
#if defined (XP_WIN)
#ifdef XP_WIN
PRBool bScanPLIDs = PR_FALSE;
if (mPrefService)
@@ -5403,7 +5406,6 @@ nsresult nsPluginHostImpl::FindPlugins(PRBool aCreatePluginList, PRBool * aPlugi
}
}
}
#endif
// if get to this point and did not detect changes in plugins
@@ -5832,6 +5834,7 @@ nsPluginHostImpl::RemoveCachedPluginsInfo(const char *filename, nsPluginTag **re
}
}
#ifdef XP_WIN
nsresult
nsPluginHostImpl::EnsurePrivateDirServiceProvider()
{
@@ -5850,6 +5853,7 @@ nsPluginHostImpl::EnsurePrivateDirServiceProvider()
}
return NS_OK;
}
#endif /* XP_WIN */
////////////////////////////////////////////////////////////////////////
/* Called by GetURL and PostURL */

View File

@@ -448,7 +448,9 @@ private:
nsCOMPtr<nsIFile> mPluginRegFile;
nsCOMPtr<nsIPrefBranch> mPrefService;
#ifdef XP_WIN
nsRefPtr<nsPluginDirServiceProvider> mPrivateDirServiceProvider;
#endif /* XP_WIN */
nsWeakPtr mCurrentDocument; // weak reference, we use it to id document only