Bug 810494 - Don't show plugin errors for types we recognize but are not loading for another reason. r=josh, a=akeybl
authorJohn Schoenick <jschoenick@mozilla.com>
Fri, 09 Nov 2012 15:02:43 -0800
changeset 117051 fc9677f8a2f653326147dc52fde22b81d41a2699
parent 117050 03f06a061206c6a5e28cbe7493ac02d983bc3fa0
child 117052 ce4d9f008712cd8c3be9131469e36258d6e8934c
push id1730
push userryanvm@gmail.com
push dateWed, 21 Nov 2012 23:19:47 +0000
treeherdermozilla-beta@9b66328a0d4e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjosh, akeybl
bugs810494
milestone18.0
Bug 810494 - Don't show plugin errors for types we recognize but are not loading for another reason. r=josh, a=akeybl
content/base/src/nsObjectLoadingContent.cpp
--- a/content/base/src/nsObjectLoadingContent.cpp
+++ b/content/base/src/nsObjectLoadingContent.cpp
@@ -1545,23 +1545,28 @@ nsObjectLoadingContent::LoadObject(bool 
   LOG(("OBJLC [%p]: LoadObject - plugin state changed (%u)",
        this, stateChange));
 
   // Setup fallback info. We may also change type to fallback below in case of
   // sanity/OOM/etc. errors. We default to showing alternate content
   // NOTE LoadFallback can override this in some cases
   FallbackType fallbackType = eFallbackAlternate;
 
-  if (mType == eType_Null) {
+  // mType can differ with GetTypeOfContent(mContentType) if we support this
+  // type, but the parameters are invalid e.g. a embed tag with type "image/png"
+  // but no URI -- don't show a plugin error or unknown type error in that case.
+  if (mType == eType_Null && GetTypeOfContent(mContentType) == eType_Null) {
+    // See if a disabled or blocked plugin could've handled this
     nsresult pluginsupport = IsPluginEnabledForType(mContentType);
     if (pluginsupport == NS_ERROR_PLUGIN_DISABLED) {
       fallbackType = eFallbackDisabled;
     } else if (pluginsupport == NS_ERROR_PLUGIN_BLOCKLISTED) {
       fallbackType = eFallbackBlocklisted;
     } else {
+      // Completely unknown type
       fallbackType = eFallbackUnsupported;
     }
   }
 
   // We synchronously start/stop plugin instances below, which may spin the
   // event loop. Re-entering into the load is fine, but at that point the
   // original load call needs to abort when unwinding
   // NOTE this is located *after* the state change check, a subseqent load