From 7d7cc3c41cb4dfa7dfe3a4f22682019657be199f Mon Sep 17 00:00:00 2001 From: John Schoenick Date: Thu, 31 Oct 2013 14:05:00 -0700 Subject: [PATCH] Bug 923745 - Force flash to use a windowless mode in e10s until windowed mode plugins are fixed. r=bsmedberg --- dom/plugins/base/nsPluginInstanceOwner.cpp | 31 +++++++++++++++------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index 46e7cdc4c27c..841e93a62f08 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -1045,13 +1045,13 @@ nsresult nsPluginInstanceOwner::EnsureCachedAttrParamArrays() "re-cache of attrs/params not implemented! use the DOM " "node directy instead"); - // Convert to a 16-bit count. Subtract 2 in case we add an extra - // "src" or "wmode" entry below. + // Convert to a 16-bit count. Subtract 3 in case we add an extra + // "src", "wmode", or "codebase" entry below. uint32_t cattrs = mContent->GetAttrCount(); - if (cattrs < 0x0000FFFD) { + if (cattrs < 0x0000FFFC) { mNumCachedAttrs = static_cast(cattrs); } else { - mNumCachedAttrs = 0xFFFD; + mNumCachedAttrs = 0xFFFC; } // Check if we are java for special codebase handling @@ -1081,7 +1081,7 @@ nsresult nsPluginInstanceOwner::EnsureCachedAttrParamArrays() mydomElement->GetElementsByTagNameNS(xhtml_ns, NS_LITERAL_STRING("param"), getter_AddRefs(allParams)); if (allParams) { - uint32_t numAllParams; + uint32_t numAllParams; allParams->GetLength(&numAllParams); for (uint32_t i = 0; i < numAllParams; i++) { nsCOMPtr pnode; @@ -1144,12 +1144,25 @@ nsresult nsPluginInstanceOwner::EnsureCachedAttrParamArrays() mNumCachedAttrs++; } - // "plugins.force.wmode" preference is forcing wmode type for plugins - // possible values - "opaque", "transparent", "windowed" - nsAdoptingCString wmodeType = Preferences::GetCString("plugins.force.wmode"); - if (!wmodeType.IsEmpty()) { + // "plugins.force.wmode" forces us to send a specific "wmode" parameter, + // used by flash to select a rendering mode. Common values include + // "opaque", "transparent", "windowed", "direct" + nsCString wmodeType; + nsAdoptingCString wmodePref = Preferences::GetCString("plugins.force.wmode"); + if (!wmodePref.IsEmpty()) { mNumCachedAttrs++; + wmodeType = wmodePref; } +#if defined(XP_WIN) || defined(XP_LINUX) + // Bug 923745 - Until we support windowed mode plugins in content processes, + // force flash to use a windowless rendering mode. This hack should go away + // when bug 923746 lands. (OS X plugins always use some native widgets, so + // unfortunately this does not help there) + else if (XRE_GetProcessType() == GeckoProcessType_Content) { + mNumCachedAttrs++; + wmodeType.AssignLiteral("transparent"); + } +#endif // (Bug 738396) java has quirks in its codebase parsing, pass the // absolute codebase URI as content sees it.