2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1998-07-28 02:07:25 +00:00
|
|
|
|
2009-07-02 05:48:08 +00:00
|
|
|
#ifndef nsPluginHost_h_
|
|
|
|
#define nsPluginHost_h_
|
1998-07-28 02:07:25 +00:00
|
|
|
|
|
|
|
#include "nsIPluginHost.h"
|
2001-03-12 02:07:15 +00:00
|
|
|
#include "nsIObserver.h"
|
|
|
|
#include "nsCOMPtr.h"
|
1998-07-28 02:07:25 +00:00
|
|
|
#include "prlink.h"
|
2008-02-29 02:06:00 +00:00
|
|
|
#include "prclist.h"
|
|
|
|
#include "npapi.h"
|
2008-09-15 12:45:01 +00:00
|
|
|
#include "nsNPAPIPluginInstance.h"
|
2007-07-03 21:42:35 +00:00
|
|
|
#include "nsIPluginTag.h"
|
2000-03-23 00:45:49 +00:00
|
|
|
#include "nsPluginsDir.h"
|
2003-05-27 21:14:55 +00:00
|
|
|
#include "nsPluginDirServiceProvider.h"
|
|
|
|
#include "nsAutoPtr.h"
|
2002-05-16 20:47:29 +00:00
|
|
|
#include "nsWeakPtr.h"
|
2002-06-01 00:56:38 +00:00
|
|
|
#include "nsIPrompt.h"
|
2002-08-29 22:00:20 +00:00
|
|
|
#include "nsISupportsArray.h"
|
2005-11-06 18:34:03 +00:00
|
|
|
#include "nsWeakReference.h"
|
2008-02-29 02:06:00 +00:00
|
|
|
#include "nsThreadUtils.h"
|
2008-03-10 07:07:15 +00:00
|
|
|
#include "nsTArray.h"
|
2009-12-15 20:44:52 +00:00
|
|
|
#include "nsTObserverArray.h"
|
|
|
|
#include "nsITimer.h"
|
2009-12-15 22:47:22 +00:00
|
|
|
#include "nsPluginTags.h"
|
2011-02-08 22:16:07 +00:00
|
|
|
#include "nsIEffectiveTLDService.h"
|
|
|
|
#include "nsIIDNService.h"
|
2011-05-21 13:28:54 +00:00
|
|
|
#include "nsCRT.h"
|
2007-02-17 18:44:42 +00:00
|
|
|
|
2008-09-15 12:45:01 +00:00
|
|
|
class nsNPAPIPlugin;
|
2000-07-22 01:34:13 +00:00
|
|
|
class nsIComponentManager;
|
|
|
|
class nsIFile;
|
2001-02-21 20:38:08 +00:00
|
|
|
class nsIChannel;
|
2011-05-21 13:28:54 +00:00
|
|
|
class nsPluginNativeWindow;
|
2012-01-31 21:55:54 +00:00
|
|
|
class nsObjectLoadingContent;
|
|
|
|
class nsPluginInstanceOwner;
|
2005-11-06 18:34:03 +00:00
|
|
|
|
2009-12-15 20:44:52 +00:00
|
|
|
#if defined(XP_MACOSX) && !defined(NP_NO_CARBON)
|
|
|
|
#define MAC_CARBON_PLUGINS
|
|
|
|
#endif
|
|
|
|
|
2010-12-09 22:28:15 +00:00
|
|
|
class nsInvalidPluginTag : public nsISupports
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsInvalidPluginTag(const char* aFullPath, PRInt64 aLastModifiedTime = 0);
|
|
|
|
virtual ~nsInvalidPluginTag();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
|
|
|
nsCString mFullPath;
|
|
|
|
PRInt64 mLastModifiedTime;
|
|
|
|
bool mSeen;
|
|
|
|
|
|
|
|
nsRefPtr<nsInvalidPluginTag> mPrev;
|
|
|
|
nsRefPtr<nsInvalidPluginTag> mNext;
|
|
|
|
};
|
|
|
|
|
2009-07-02 05:48:08 +00:00
|
|
|
class nsPluginHost : public nsIPluginHost,
|
|
|
|
public nsIObserver,
|
2009-12-15 20:44:52 +00:00
|
|
|
public nsITimerCallback,
|
2009-07-02 05:48:08 +00:00
|
|
|
public nsSupportsWeakReference
|
1998-07-28 02:07:25 +00:00
|
|
|
{
|
|
|
|
public:
|
2009-07-02 05:48:08 +00:00
|
|
|
nsPluginHost();
|
|
|
|
virtual ~nsPluginHost();
|
1998-07-28 02:07:25 +00:00
|
|
|
|
2009-07-02 05:48:08 +00:00
|
|
|
static nsPluginHost* GetInst();
|
2000-07-22 01:34:13 +00:00
|
|
|
|
1999-03-05 04:36:00 +00:00
|
|
|
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
|
1998-07-28 02:07:25 +00:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS
|
2009-06-25 21:06:54 +00:00
|
|
|
NS_DECL_NSIPLUGINHOST
|
|
|
|
NS_DECL_NSIOBSERVER
|
2009-12-15 20:44:52 +00:00
|
|
|
NS_DECL_NSITIMERCALLBACK
|
1998-07-28 02:07:25 +00:00
|
|
|
|
2011-05-21 13:28:54 +00:00
|
|
|
nsresult Init();
|
|
|
|
nsresult LoadPlugins();
|
2012-01-06 00:02:51 +00:00
|
|
|
nsresult UnloadPlugins();
|
2012-04-24 20:25:21 +00:00
|
|
|
|
2011-05-21 13:28:54 +00:00
|
|
|
nsresult SetUpPluginInstance(const char *aMimeType,
|
|
|
|
nsIURI *aURL,
|
|
|
|
nsIPluginInstanceOwner *aOwner);
|
2011-12-09 22:56:20 +00:00
|
|
|
nsresult IsPluginEnabledForType(const char* aMimeType);
|
|
|
|
nsresult IsPluginEnabledForExtension(const char* aExtension, const char* &aMimeType);
|
2012-07-11 15:56:34 +00:00
|
|
|
bool IsPluginClickToPlayForType(const char *aMimeType);
|
|
|
|
nsresult GetBlocklistStateForType(const char *aMimeType, PRUint32 *state);
|
2012-02-10 13:39:40 +00:00
|
|
|
|
2011-05-21 13:28:54 +00:00
|
|
|
nsresult GetPluginCount(PRUint32* aPluginCount);
|
|
|
|
nsresult GetPlugins(PRUint32 aPluginCount, nsIDOMPlugin** aPluginArray);
|
|
|
|
|
|
|
|
nsresult GetURL(nsISupports* pluginInst,
|
|
|
|
const char* url,
|
|
|
|
const char* target,
|
2012-05-17 23:54:26 +00:00
|
|
|
nsNPAPIPluginStreamListener* streamListener,
|
2011-05-21 13:28:54 +00:00
|
|
|
const char* altHost,
|
|
|
|
const char* referrer,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool forceJSEnabled);
|
2011-05-21 13:28:54 +00:00
|
|
|
nsresult PostURL(nsISupports* pluginInst,
|
|
|
|
const char* url,
|
|
|
|
PRUint32 postDataLen,
|
|
|
|
const char* postData,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool isFile,
|
2011-05-21 13:28:54 +00:00
|
|
|
const char* target,
|
2012-05-17 23:54:26 +00:00
|
|
|
nsNPAPIPluginStreamListener* streamListener,
|
2011-05-21 13:28:54 +00:00
|
|
|
const char* altHost,
|
|
|
|
const char* referrer,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool forceJSEnabled,
|
2011-05-21 13:28:54 +00:00
|
|
|
PRUint32 postHeadersLength,
|
|
|
|
const char* postHeaders);
|
|
|
|
|
|
|
|
nsresult FindProxyForURL(const char* url, char* *result);
|
|
|
|
nsresult UserAgent(const char **retstring);
|
|
|
|
nsresult ParsePostBufferToFixHeaders(const char *inPostData, PRUint32 inPostDataLen,
|
|
|
|
char **outPostData, PRUint32 *outPostDataLen);
|
|
|
|
nsresult CreateTempFileToPost(const char *aPostDataURL, nsIFile **aTmpFile);
|
|
|
|
nsresult NewPluginNativeWindow(nsPluginNativeWindow ** aPluginNativeWindow);
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
void AddIdleTimeTarget(nsIPluginInstanceOwner* objectFrame, bool isVisible);
|
2011-05-21 13:28:54 +00:00
|
|
|
void RemoveIdleTimeTarget(nsIPluginInstanceOwner* objectFrame);
|
|
|
|
|
2011-05-18 01:48:34 +00:00
|
|
|
nsresult GetPluginName(nsNPAPIPluginInstance *aPluginInstance, const char** aPluginName);
|
|
|
|
nsresult StopPluginInstance(nsNPAPIPluginInstance* aInstance);
|
|
|
|
nsresult HandleBadPlugin(PRLibrary* aLibrary, nsNPAPIPluginInstance *aInstance);
|
|
|
|
nsresult GetPluginTagForInstance(nsNPAPIPluginInstance *aPluginInstance, nsIPluginTag **aPluginTag);
|
|
|
|
|
2009-06-25 21:06:54 +00:00
|
|
|
nsresult
|
2001-04-17 23:30:25 +00:00
|
|
|
NewPluginURLStream(const nsString& aURL,
|
2010-07-16 19:55:54 +00:00
|
|
|
nsNPAPIPluginInstance *aInstance,
|
2012-05-17 23:54:26 +00:00
|
|
|
nsNPAPIPluginStreamListener *aListener,
|
2009-12-27 20:26:00 +00:00
|
|
|
nsIInputStream *aPostStream = nsnull,
|
r=av
a=waterson
bug=51919
This fix makes it so nsIPluginManager::PostURL() works correctly in the
case of a null target and non-null streamListener.
The fix was to add parameters to NewPluginURLStream() for headers and
post data:
NS_IMETHOD
- NewPluginURLStream(const nsString& aURL, nsIPluginInstance *aInstance, nsIPluginStreamListener *aListener);
+ NewPluginURLStream(const nsString& aURL, nsIPluginInstance *aInstance,
+ nsIPluginStreamListener *aListener,
+ void *aPostData = nsnull, PRUint32 aPostDataLen = 0,
+ const char *aHeadersData = nsnull,
+ PRUint32 aHeadersDataLen = 0);
And to add a new method to correctly send the headers to the channel:
+ NS_IMETHOD
+ AddHeadersToChannel(const char *aHeadersData, PRUint32 aHeadersDataLen,
+ nsIChannel *aGenericChannel);
Files in this fix:
M modules/plugin/nglsrc/nsPluginHostImpl.cpp
M modules/plugin/nglsrc/nsPluginHostImpl.h
2000-09-08 23:58:36 +00:00
|
|
|
const char *aHeadersData = nsnull,
|
|
|
|
PRUint32 aHeadersDataLen = 0);
|
1999-01-25 08:05:00 +00:00
|
|
|
|
2009-06-25 21:06:54 +00:00
|
|
|
nsresult
|
2010-07-16 19:55:54 +00:00
|
|
|
GetURLWithHeaders(nsNPAPIPluginInstance *pluginInst,
|
2009-06-25 21:06:54 +00:00
|
|
|
const char* url,
|
|
|
|
const char* target = NULL,
|
2012-05-17 23:54:26 +00:00
|
|
|
nsNPAPIPluginStreamListener* streamListener = NULL,
|
2009-06-25 21:06:54 +00:00
|
|
|
const char* altHost = NULL,
|
|
|
|
const char* referrer = NULL,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool forceJSEnabled = false,
|
2009-06-25 21:06:54 +00:00
|
|
|
PRUint32 getHeadersLength = 0,
|
|
|
|
const char* getHeaders = NULL);
|
|
|
|
|
2003-04-03 19:11:41 +00:00
|
|
|
nsresult
|
2010-07-16 19:55:54 +00:00
|
|
|
DoURLLoadSecurityCheck(nsNPAPIPluginInstance *aInstance,
|
2003-04-03 19:11:41 +00:00
|
|
|
const char* aURL);
|
|
|
|
|
2009-06-25 21:06:54 +00:00
|
|
|
nsresult
|
r=av
a=waterson
bug=51919
This fix makes it so nsIPluginManager::PostURL() works correctly in the
case of a null target and non-null streamListener.
The fix was to add parameters to NewPluginURLStream() for headers and
post data:
NS_IMETHOD
- NewPluginURLStream(const nsString& aURL, nsIPluginInstance *aInstance, nsIPluginStreamListener *aListener);
+ NewPluginURLStream(const nsString& aURL, nsIPluginInstance *aInstance,
+ nsIPluginStreamListener *aListener,
+ void *aPostData = nsnull, PRUint32 aPostDataLen = 0,
+ const char *aHeadersData = nsnull,
+ PRUint32 aHeadersDataLen = 0);
And to add a new method to correctly send the headers to the channel:
+ NS_IMETHOD
+ AddHeadersToChannel(const char *aHeadersData, PRUint32 aHeadersDataLen,
+ nsIChannel *aGenericChannel);
Files in this fix:
M modules/plugin/nglsrc/nsPluginHostImpl.cpp
M modules/plugin/nglsrc/nsPluginHostImpl.h
2000-09-08 23:58:36 +00:00
|
|
|
AddHeadersToChannel(const char *aHeadersData, PRUint32 aHeadersDataLen,
|
|
|
|
nsIChannel *aGenericChannel);
|
1999-06-04 22:32:27 +00:00
|
|
|
|
2005-02-11 23:37:51 +00:00
|
|
|
static nsresult GetPluginTempDir(nsIFile **aDir);
|
|
|
|
|
2007-07-14 00:28:05 +00:00
|
|
|
// Writes updated plugins settings to disk and unloads the plugin
|
|
|
|
// if it is now disabled
|
|
|
|
nsresult UpdatePluginInfo(nsPluginTag* aPluginTag);
|
2012-07-02 20:44:39 +00:00
|
|
|
|
|
|
|
// Helper that checks if a type is whitelisted in plugin.allowed_types.
|
|
|
|
// Always returns true if plugin.allowed_types is not set
|
|
|
|
static bool IsTypeWhitelisted(const char *aType);
|
2007-07-03 21:42:35 +00:00
|
|
|
|
2007-09-04 18:19:31 +00:00
|
|
|
// checks whether aTag is a "java" plugin tag (a tag for a plugin
|
|
|
|
// that does Java)
|
2011-09-29 06:19:26 +00:00
|
|
|
static bool IsJavaMIMEType(const char *aType);
|
2007-09-04 18:19:31 +00:00
|
|
|
|
2009-06-13 20:16:40 +00:00
|
|
|
static nsresult GetPrompt(nsIPluginInstanceOwner *aOwner, nsIPrompt **aPrompt);
|
|
|
|
|
2009-12-15 22:47:22 +00:00
|
|
|
static nsresult PostPluginUnloadEvent(PRLibrary* aLibrary);
|
|
|
|
|
2010-03-24 21:22:04 +00:00
|
|
|
void PluginCrashed(nsNPAPIPlugin* plugin,
|
|
|
|
const nsAString& pluginDumpID,
|
|
|
|
const nsAString& browserDumpID);
|
2009-12-16 20:08:45 +00:00
|
|
|
|
2010-07-20 02:11:26 +00:00
|
|
|
nsNPAPIPluginInstance *FindInstance(const char *mimetype);
|
2011-11-12 01:10:31 +00:00
|
|
|
nsNPAPIPluginInstance *FindOldestStoppedInstance();
|
|
|
|
PRUint32 StoppedInstanceCount();
|
2010-01-27 01:30:58 +00:00
|
|
|
|
2010-07-20 02:11:26 +00:00
|
|
|
nsTArray< nsRefPtr<nsNPAPIPluginInstance> > *InstanceArray();
|
2010-01-27 01:30:58 +00:00
|
|
|
|
2010-07-20 02:11:26 +00:00
|
|
|
void DestroyRunningInstances(nsISupportsArray* aReloadDocs, nsPluginTag* aPluginTag);
|
2010-01-27 01:30:58 +00:00
|
|
|
|
2010-04-05 15:25:59 +00:00
|
|
|
// Return the tag for |aLibrary| if found, nsnull if not.
|
2010-07-20 02:11:26 +00:00
|
|
|
nsPluginTag* FindTagForLibrary(PRLibrary* aLibrary);
|
2010-04-05 15:25:59 +00:00
|
|
|
|
2011-04-28 20:08:33 +00:00
|
|
|
// The last argument should be false if we already have an in-flight stream
|
|
|
|
// and don't need to set up a new stream.
|
2012-04-15 21:34:01 +00:00
|
|
|
nsresult InstantiateEmbeddedPluginInstance(const char *aMimeType, nsIURI* aURL,
|
|
|
|
nsObjectLoadingContent *aContent,
|
|
|
|
nsPluginInstanceOwner** aOwner);
|
2011-04-28 20:08:33 +00:00
|
|
|
|
2012-04-15 21:34:01 +00:00
|
|
|
nsresult InstantiateFullPagePluginInstance(const char *aMimeType,
|
|
|
|
nsIURI* aURI,
|
|
|
|
nsObjectLoadingContent *aContent,
|
|
|
|
nsPluginInstanceOwner **aOwner,
|
|
|
|
nsIStreamListener **aStreamListener);
|
2010-10-23 01:16:29 +00:00
|
|
|
|
2010-11-19 20:58:59 +00:00
|
|
|
// Does not accept NULL and should never fail.
|
|
|
|
nsPluginTag* TagForPlugin(nsNPAPIPlugin* aPlugin);
|
|
|
|
|
2011-05-11 20:23:25 +00:00
|
|
|
nsresult GetPlugin(const char *aMimeType, nsNPAPIPlugin** aPlugin);
|
|
|
|
|
2012-04-24 20:25:21 +00:00
|
|
|
nsresult NewEmbeddedPluginStreamListener(nsIURI* aURL, nsObjectLoadingContent *aContent,
|
|
|
|
nsNPAPIPluginInstance* aInstance,
|
|
|
|
nsIStreamListener **aStreamListener);
|
|
|
|
|
|
|
|
nsresult NewFullPagePluginStreamListener(nsIURI* aURI,
|
|
|
|
nsNPAPIPluginInstance *aInstance,
|
|
|
|
nsIStreamListener **aStreamListener);
|
|
|
|
|
1998-07-28 02:07:25 +00:00
|
|
|
private:
|
2009-06-25 21:06:54 +00:00
|
|
|
nsresult
|
2002-05-16 20:47:29 +00:00
|
|
|
TrySetUpPluginInstance(const char *aMimeType, nsIURI *aURL, nsIPluginInstanceOwner *aOwner);
|
|
|
|
|
1999-01-25 08:05:00 +00:00
|
|
|
nsresult
|
2012-01-31 21:55:54 +00:00
|
|
|
NewEmbeddedPluginStream(nsIURI* aURL, nsObjectLoadingContent *aContent, nsNPAPIPluginInstance* aInstance);
|
1999-01-25 08:05:00 +00:00
|
|
|
|
2012-06-14 02:51:21 +00:00
|
|
|
nsPluginTag*
|
|
|
|
FindPreferredPlugin(const InfallibleTArray<nsPluginTag*>& matches);
|
|
|
|
|
2005-11-06 18:34:03 +00:00
|
|
|
// Return an nsPluginTag for this type, if any. If aCheckEnabled is
|
|
|
|
// true, only enabled plugins will be returned.
|
|
|
|
nsPluginTag*
|
2011-09-29 06:19:26 +00:00
|
|
|
FindPluginForType(const char* aMimeType, bool aCheckEnabled);
|
2005-11-06 18:34:03 +00:00
|
|
|
|
|
|
|
nsPluginTag*
|
|
|
|
FindPluginEnabledForExtension(const char* aExtension, const char* &aMimeType);
|
1999-03-29 22:18:05 +00:00
|
|
|
|
2011-11-12 01:10:31 +00:00
|
|
|
nsresult
|
|
|
|
FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstanceOwner *aOwner);
|
|
|
|
|
2002-02-11 23:09:38 +00:00
|
|
|
nsresult
|
2011-09-29 06:19:26 +00:00
|
|
|
FindPlugins(bool aCreatePluginList, bool * aPluginsChanged);
|
2002-02-11 23:09:38 +00:00
|
|
|
|
2012-06-29 22:28:45 +00:00
|
|
|
// Registers or unregisters the given mime type with the category manager
|
|
|
|
// (performs no checks - see UpdateCategoryManager)
|
|
|
|
enum nsRegisterType { ePluginRegister, ePluginUnregister };
|
|
|
|
void RegisterWithCategoryManager(nsCString &aMimeType, nsRegisterType aType);
|
|
|
|
|
2000-09-22 00:58:46 +00:00
|
|
|
nsresult
|
2011-03-31 18:26:57 +00:00
|
|
|
ScanPluginsDirectory(nsIFile *pluginsDir,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aCreatePluginList,
|
|
|
|
bool *aPluginsChanged);
|
2011-03-31 18:26:57 +00:00
|
|
|
|
2001-11-17 15:26:02 +00:00
|
|
|
nsresult
|
2011-03-31 18:26:57 +00:00
|
|
|
ScanPluginsDirectoryList(nsISimpleEnumerator *dirEnum,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aCreatePluginList,
|
|
|
|
bool *aPluginsChanged);
|
2001-02-02 23:48:17 +00:00
|
|
|
|
2012-04-03 22:08:07 +00:00
|
|
|
nsresult EnsurePluginLoaded(nsPluginTag* aPluginTag);
|
2011-02-19 01:05:23 +00:00
|
|
|
|
2012-04-03 22:08:07 +00:00
|
|
|
bool IsRunningPlugin(nsPluginTag * aPluginTag);
|
2000-09-22 00:58:46 +00:00
|
|
|
|
2001-10-18 12:26:23 +00:00
|
|
|
// Stores all plugins info into the registry
|
2002-08-14 22:31:59 +00:00
|
|
|
nsresult WritePluginInfo();
|
|
|
|
|
|
|
|
// Loads all cached plugins info into mCachedPlugins
|
|
|
|
nsresult ReadPluginInfo();
|
2002-02-13 02:18:57 +00:00
|
|
|
|
2009-06-10 20:47:49 +00:00
|
|
|
// Given a file path, returns the plugins info from our cache
|
2002-02-13 02:18:57 +00:00
|
|
|
// and removes it from the cache.
|
2009-06-10 20:47:49 +00:00
|
|
|
void RemoveCachedPluginsInfo(const char *filePath,
|
2007-07-03 21:42:35 +00:00
|
|
|
nsPluginTag **result);
|
2002-02-11 23:09:38 +00:00
|
|
|
|
2011-02-19 01:05:23 +00:00
|
|
|
// Checks to see if a tag object is in our list of live tags.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool IsLiveTag(nsIPluginTag* tag);
|
2011-02-19 01:05:23 +00:00
|
|
|
|
2001-11-17 15:26:02 +00:00
|
|
|
nsresult EnsurePrivateDirServiceProvider();
|
2001-10-18 12:26:23 +00:00
|
|
|
|
2010-01-27 01:30:58 +00:00
|
|
|
void OnPluginInstanceDestroyed(nsPluginTag* aPluginTag);
|
|
|
|
|
2007-07-03 21:42:35 +00:00
|
|
|
nsRefPtr<nsPluginTag> mPlugins;
|
|
|
|
nsRefPtr<nsPluginTag> mCachedPlugins;
|
2010-12-09 22:28:15 +00:00
|
|
|
nsRefPtr<nsInvalidPluginTag> mInvalidPlugins;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mPluginsLoaded;
|
|
|
|
bool mDontShowBadPluginMessage;
|
2005-01-05 00:21:06 +00:00
|
|
|
|
|
|
|
// set by pref plugin.override_internal_types
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mOverrideInternalTypes;
|
2005-01-05 00:21:06 +00:00
|
|
|
|
2009-10-05 09:00:57 +00:00
|
|
|
// set by pref plugin.disable
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mPluginsDisabled;
|
2012-07-11 15:56:34 +00:00
|
|
|
// set by pref plugins.click_to_play
|
|
|
|
bool mPluginsClickToPlay;
|
2009-10-05 09:00:57 +00:00
|
|
|
|
2010-07-20 02:11:26 +00:00
|
|
|
// Any instances in this array will have valid plugin objects via GetPlugin().
|
|
|
|
// When removing an instance it might not die - be sure to null out it's plugin.
|
|
|
|
nsTArray< nsRefPtr<nsNPAPIPluginInstance> > mInstances;
|
2010-01-27 01:30:58 +00:00
|
|
|
|
2009-02-09 18:48:06 +00:00
|
|
|
nsCOMPtr<nsIFile> mPluginRegFile;
|
2007-07-20 20:34:51 +00:00
|
|
|
#ifdef XP_WIN
|
2003-05-27 21:14:55 +00:00
|
|
|
nsRefPtr<nsPluginDirServiceProvider> mPrivateDirServiceProvider;
|
2009-02-09 18:48:06 +00:00
|
|
|
#endif
|
2005-02-11 23:37:51 +00:00
|
|
|
|
2011-02-08 22:16:07 +00:00
|
|
|
nsCOMPtr<nsIEffectiveTLDService> mTLDService;
|
|
|
|
nsCOMPtr<nsIIDNService> mIDNService;
|
|
|
|
|
|
|
|
// Helpers for ClearSiteData and SiteHasData.
|
|
|
|
nsresult NormalizeHostname(nsCString& host);
|
|
|
|
nsresult EnumerateSiteData(const nsACString& domain,
|
|
|
|
const nsTArray<nsCString>& sites,
|
|
|
|
InfallibleTArray<nsCString>& result,
|
|
|
|
bool firstMatchOnly);
|
|
|
|
|
2002-05-16 20:47:29 +00:00
|
|
|
nsWeakPtr mCurrentDocument; // weak reference, we use it to id document only
|
2005-02-11 23:37:51 +00:00
|
|
|
|
|
|
|
static nsIFile *sPluginTempDir;
|
2005-11-06 18:34:03 +00:00
|
|
|
|
|
|
|
// We need to hold a global ptr to ourselves because we register for
|
|
|
|
// two different CIDs for some reason...
|
2009-07-02 05:48:08 +00:00
|
|
|
static nsPluginHost* sInst;
|
2009-12-15 20:44:52 +00:00
|
|
|
|
|
|
|
#ifdef MAC_CARBON_PLUGINS
|
|
|
|
nsCOMPtr<nsITimer> mVisiblePluginTimer;
|
|
|
|
nsTObserverArray<nsIPluginInstanceOwner*> mVisibleTimerTargets;
|
|
|
|
nsCOMPtr<nsITimer> mHiddenPluginTimer;
|
|
|
|
nsTObserverArray<nsIPluginInstanceOwner*> mHiddenTimerTargets;
|
|
|
|
#endif
|
1998-07-28 02:07:25 +00:00
|
|
|
};
|
|
|
|
|
2008-07-01 01:03:50 +00:00
|
|
|
class NS_STACK_CLASS PluginDestructionGuard : protected PRCList
|
2008-02-29 02:06:00 +00:00
|
|
|
{
|
|
|
|
public:
|
2011-05-18 01:48:34 +00:00
|
|
|
PluginDestructionGuard(nsNPAPIPluginInstance *aInstance)
|
2008-02-29 02:06:00 +00:00
|
|
|
: mInstance(aInstance)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
}
|
|
|
|
|
|
|
|
PluginDestructionGuard(NPP npp)
|
2008-09-15 12:45:01 +00:00
|
|
|
: mInstance(npp ? static_cast<nsNPAPIPluginInstance*>(npp->ndata) : nsnull)
|
2008-02-29 02:06:00 +00:00
|
|
|
{
|
|
|
|
Init();
|
|
|
|
}
|
|
|
|
|
|
|
|
~PluginDestructionGuard();
|
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
static bool DelayDestroy(nsNPAPIPluginInstance *aInstance);
|
2008-02-29 02:06:00 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void Init()
|
|
|
|
{
|
|
|
|
NS_ASSERTION(NS_IsMainThread(), "Should be on the main thread");
|
|
|
|
|
2011-09-30 06:02:59 +00:00
|
|
|
mDelayedDestroy = false;
|
2008-02-29 02:06:00 +00:00
|
|
|
|
|
|
|
PR_INIT_CLIST(this);
|
|
|
|
PR_INSERT_BEFORE(this, &sListHead);
|
|
|
|
}
|
|
|
|
|
2011-05-18 01:48:34 +00:00
|
|
|
nsRefPtr<nsNPAPIPluginInstance> mInstance;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mDelayedDestroy;
|
2008-02-29 02:06:00 +00:00
|
|
|
|
|
|
|
static PRCList sListHead;
|
|
|
|
};
|
|
|
|
|
2009-07-06 06:10:10 +00:00
|
|
|
#endif // nsPluginHost_h_
|