Bug 1092121 - Get plugin quirks modes and nsPluginInstanceOwner::GetNetscapeWindow working with remote content. r=billm

This commit is contained in:
Jim Mathies
2015-01-23 04:10:52 -06:00
parent 0d79f46581
commit 3580fbc187
4 changed files with 22 additions and 12 deletions

View File

@@ -65,6 +65,7 @@ const wchar_t * kMozillaWindowClass = L"MozillaWindowClass";
#endif
namespace {
// see PluginModuleChild::GetChrome()
PluginModuleChild* gChromeInstance = nullptr;
nsTArray<PluginModuleChild*>* gAllInstances;
}
@@ -191,6 +192,9 @@ PluginModuleChild::~PluginModuleChild()
PluginModuleChild*
PluginModuleChild::GetChrome()
{
// A special PluginModuleChild instance that talks to the chrome process
// during startup and shutdown. Synchronous messages to or from this actor
// should be avoided because they may lead to hangs.
MOZ_ASSERT(gChromeInstance);
return gChromeInstance;
}
@@ -230,7 +234,6 @@ PluginModuleChild::InitForContent(base::ProcessHandle aParentProcessHandle,
mTransport = aChannel;
mLibrary = GetChrome()->mLibrary;
mQuirks = GetChrome()->mQuirks;
mFunctions = GetChrome()->mFunctions;
return true;
@@ -2062,7 +2065,13 @@ PluginModuleChild::AllocPPluginInstanceChild(const nsCString& aMimeType,
PLUGIN_LOG_DEBUG_METHOD;
AssertPluginThread();
InitQuirksModes(aMimeType);
// In e10s, gChromeInstance hands out quirks to instances, but never
// allocates an instance on its own. Make sure it gets the latest copy
// of quirks once we have them. Also note, with process-per-tab, we may
// have multiple PluginModuleChilds in the same plugin process, so only
// initialize this once in gChromeInstance, which is a singleton.
GetChrome()->InitQuirksModes(aMimeType);
mQuirks = GetChrome()->mQuirks;
#ifdef XP_WIN
if ((mQuirks & QUIRK_FLASH_HOOK_GETWINDOWINFO) &&