Bug 1118615 - Flash hangs displaying a camera/microphone access dialog in HiDPI mode, workaround. r=mstange

This commit is contained in:
Steven Michaud
2015-01-16 12:16:44 -06:00
parent b1608c4471
commit d0aeab7de5
4 changed files with 26 additions and 1 deletions

View File

@@ -2171,6 +2171,20 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
nsNPAPIPluginInstance *inst =
(nsNPAPIPluginInstance *) (npp ? npp->ndata : nullptr);
double scaleFactor = inst ? inst->GetContentsScaleFactor() : 1.0;
// Work around a Flash bug that causes long hangs when Flash tries to
// display its camera and microphone access dialog while it thinks HiDPI
// support is available. This is Adobe bug ADBE 3921114, which should get
// fixed in a future release. When this happens we'll no longer need this
// workaround. See QUIRK_FLASH_HIDE_HIDPI_SUPPORT in PluginModuleChild.h,
// and also bug 1118615.
if (inst) {
const char *mimeType;
inst->GetMIMEType(&mimeType);
NS_NAMED_LITERAL_CSTRING(flash, "application/x-shockwave-flash");
if (!PL_strncasecmp(mimeType, flash.get(), flash.Length())) {
scaleFactor = 1.0;
}
}
*(double*)result = scaleFactor;
return NPERR_NO_ERROR;
}