mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1237402 - Allow certain plugins to be loaded in parent process (r=jimm)
This commit is contained in:
parent
7eccfdbfa9
commit
e73c8838c9
@ -3276,12 +3276,17 @@ nsObjectLoadingContent::ShouldPlay(FallbackType &aReason, bool aIgnoreCurrentTyp
|
||||
sPrefsInitialized = true;
|
||||
}
|
||||
|
||||
if (XRE_IsParentProcess() &&
|
||||
BrowserTabsRemoteAutostart()) {
|
||||
// Plugins running OOP from the chrome process along with plugins running
|
||||
// OOP from the content process will hang. Let's prevent that situation.
|
||||
aReason = eFallbackDisabled;
|
||||
return false;
|
||||
if (BrowserTabsRemoteAutostart()) {
|
||||
bool shouldLoadInParent = nsPluginHost::ShouldLoadTypeInParent(mContentType);
|
||||
bool inParent = XRE_IsParentProcess();
|
||||
|
||||
if (shouldLoadInParent != inParent) {
|
||||
// Plugins need to be locked to either the parent process or the content
|
||||
// process. If a plugin is locked to one process type, it can't be used in
|
||||
// the other. Otherwise we'll get hangs.
|
||||
aReason = eFallbackDisabled;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
|
||||
|
@ -137,6 +137,7 @@ using mozilla::dom::FakePluginTagInit;
|
||||
#define kPluginTmpDirName NS_LITERAL_CSTRING("plugtmp")
|
||||
|
||||
static const char *kPrefWhitelist = "plugin.allowed_types";
|
||||
static const char *kPrefLoadInParentPrefix = "plugin.load_in_parent_process.";
|
||||
static const char *kPrefDisableFullPage = "plugin.disable_full_page_plugin_for_types";
|
||||
static const char *kPrefJavaMIME = "plugin.java.mime";
|
||||
|
||||
@ -2762,6 +2763,14 @@ nsPluginHost::IsTypeWhitelisted(const char *aMimeType)
|
||||
return IsTypeInList(wrap, whitelist);
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
nsPluginHost::ShouldLoadTypeInParent(const nsACString& aMimeType)
|
||||
{
|
||||
nsCString prefName(kPrefLoadInParentPrefix);
|
||||
prefName += aMimeType;
|
||||
return Preferences::GetBool(prefName.get(), false);
|
||||
}
|
||||
|
||||
void
|
||||
nsPluginHost::RegisterWithCategoryManager(const nsCString& aMimeType,
|
||||
nsRegisterType aType)
|
||||
|
@ -189,6 +189,11 @@ public:
|
||||
// Always returns true if plugin.allowed_types is not set
|
||||
static bool IsTypeWhitelisted(const char *aType);
|
||||
|
||||
// Helper that checks if a plugin of a given MIME type can be loaded by the
|
||||
// parent process. It checks the plugin.load_in_parent_process.<mime> pref.
|
||||
// Always returns false if plugin.load_in_parent_process.<mime> is not set.
|
||||
static bool ShouldLoadTypeInParent(const nsACString& aMimeType);
|
||||
|
||||
// checks whether aType is a type we recognize for potential special handling
|
||||
enum SpecialType { eSpecialType_None,
|
||||
// Needed to whitelist for async init support
|
||||
|
Loading…
Reference in New Issue
Block a user