Bug 281295 plugin/ should not use deprecated nsIPref

Patch by Vidar Braut Haarr <bugmail@q1n.org>, r=timeless sr=alecf
This commit is contained in:
cst%andrew.cmu.edu 2005-02-07 01:56:03 +00:00
Родитель 3ff2296f52
Коммит 2894c047f6
3 изменённых файлов: 11 добавлений и 10 удалений

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

@ -48,7 +48,8 @@
#include "nsIPluginStreamListener.h"
#include "nsPluginsDir.h"
#include "nsPluginSafety.h"
#include "nsIPref.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
#include "nsPluginLogging.h"
#include "nsIPluginInstancePeer2.h"
@ -91,7 +92,6 @@ enum eNPPStreamTypeInternal {
////////////////////////////////////////////////////////////////////////
// CID's && IID's
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
static NS_DEFINE_IID(kPluginManagerCID, NS_PLUGINMANAGER_CID);
static NS_DEFINE_IID(kMemoryCID, NS_MEMORY_CID);
@ -1796,8 +1796,8 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
#endif
case NPNVjavascriptEnabledBool: {
*(NPBool*)result = PR_FALSE;
nsCOMPtr<nsIPref> prefs(do_GetService(kPrefServiceCID));
*(NPBool*)result = PR_FALSE;
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID));
if(prefs) {
PRBool js = PR_FALSE;;
res = prefs->GetBoolPref("javascript.enabled", &js);

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

@ -40,7 +40,8 @@
#include "nsCRT.h"
#include "nsILocalFile.h"
#include "nsIPref.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "nsDependentString.h"
#include "nsXPIDLString.h"
#include "prmem.h"
@ -214,7 +215,7 @@ nsPluginDirServiceProvider::GetFile(const char *prop, PRBool *persistant, nsIFil
*persistant = PR_TRUE;
#if defined(XP_WIN)
nsCOMPtr<nsIPref> prefs = do_GetService(NS_PREF_CONTRACTID);
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID))
if (!prefs) return rv;
if (nsCRT::strcmp(prop, NS_WIN_4DOTX_SCAN_KEY) == 0) {

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

@ -58,8 +58,8 @@
#include <sys/stat.h>
#include "nsString.h"
#include "nsILocalFile.h"
#include "nsIPref.h"
static NS_DEFINE_CID(kPrefServiceCID, NS_PREF_CID);
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#define LOCAL_PLUGIN_DLL_SUFFIX ".so"
#if defined(__hpux)
@ -156,12 +156,12 @@ static void LoadExtraSharedLibs()
{
// check out if user's prefs.js has libs name
nsresult res;
nsCOMPtr<nsIPref> prefs = do_GetService(kPrefServiceCID, &res);
nsCOMPtr<nsIPrefBranch> prefs(do_GetService(NS_PREFSERVICE_CONTRACTID, &res));
if (NS_SUCCEEDED(res) && (prefs != nsnull)) {
char *sonamesListFromPref = PREF_PLUGINS_SONAME;
char *sonameList = NULL;
PRBool prefSonameListIsSet = PR_TRUE;
res = prefs->CopyCharPref(sonamesListFromPref, &sonameList);
res = prefs->GetCharPref(sonamesListFromPref, &sonameList);
if (!sonameList) {
// pref is not set, lets use hardcoded list
prefSonameListIsSet = PR_FALSE;