Title: [134829] branches/safari-536.28-branch/Source/WebCore

Diff

Modified: branches/safari-536.28-branch/Source/WebCore/ChangeLog (134828 => 134829)


--- branches/safari-536.28-branch/Source/WebCore/ChangeLog	2012-11-15 21:41:07 UTC (rev 134828)
+++ branches/safari-536.28-branch/Source/WebCore/ChangeLog	2012-11-15 21:44:22 UTC (rev 134829)
@@ -1,5 +1,27 @@
 2012-11-15  Lucas Forschler  <[email protected]>
 
+        Merge r134083
+
+    2012-11-09  Jer Noble  <[email protected]>
+
+            Plugin diagnostic logging should send plugin file basename instead of MIME type.
+            https://bugs.webkit.org/show_bug.cgi?id=101679
+
+            Reviewed by Eric Carlson.
+
+            Log the basename of the plugin file rather than the mime type so as to more
+            accurately log which plugin was used to handle the request.
+
+            * loader/SubframeLoader.cpp:
+            (WebCore::logPluginRequest): Log the plugin 'file' field, if present.
+            * plugins/PluginData.cpp:
+            (WebCore::PluginData::pluginInfoForMimeType): Factored out from pluginNameForMimeType.
+            (WebCore::PluginData::pluginNameForMimeType): Use pluginInfoForMimeType to retrieve name field.
+            (WebCore::PluginData::pluginFileForMimeType): Use pluginInfoForMimeType to retrieve file field.
+            * plugins/PluginData.h:
+
+2012-11-15  Lucas Forschler  <[email protected]>
+
         Merge r130449
 
     2012-10-04  Nate Chapin  <[email protected]>

Modified: branches/safari-536.28-branch/Source/WebCore/loader/SubframeLoader.cpp (134828 => 134829)


--- branches/safari-536.28-branch/Source/WebCore/loader/SubframeLoader.cpp	2012-11-15 21:41:07 UTC (rev 134828)
+++ branches/safari-536.28-branch/Source/WebCore/loader/SubframeLoader.cpp	2012-11-15 21:44:22 UTC (rev 134829)
@@ -173,16 +173,19 @@
             return;
     }
 
+    String pluginFile = page->pluginData()->pluginFileForMimeType(newMIMEType);
+    String description = !pluginFile ? newMIMEType : pluginFile;
+
     ChromeClient* client = page->chrome()->client();
-    client->logDiagnosticMessage(success ? DiagnosticLoggingKeys::pluginLoadedKey() : DiagnosticLoggingKeys::pluginLoadingFailedKey(), newMIMEType, DiagnosticLoggingKeys::noopKey());
-    
+    client->logDiagnosticMessage(success ? DiagnosticLoggingKeys::pluginLoadedKey() : DiagnosticLoggingKeys::pluginLoadingFailedKey(), description, DiagnosticLoggingKeys::noopKey());
+
     if (!page->hasSeenAnyPlugin())
         client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey(), emptyString(), DiagnosticLoggingKeys::noopKey());
     
-    if (!page->hasSeenPlugin(newMIMEType))
-        client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsPluginKey(), newMIMEType, DiagnosticLoggingKeys::noopKey());
+    if (!page->hasSeenPlugin(description))
+        client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsPluginKey(), description, DiagnosticLoggingKeys::noopKey());
 
-    page->sawPlugin(newMIMEType);
+    page->sawPlugin(description);
 }
 
 bool SubframeLoader::requestObject(HTMLPlugInImageElement* ownerElement, const String& url, const AtomicString& frameName, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues)

Modified: branches/safari-536.28-branch/Source/WebCore/plugins/PluginData.cpp (134828 => 134829)


--- branches/safari-536.28-branch/Source/WebCore/plugins/PluginData.cpp	2012-11-15 21:41:07 UTC (rev 134828)
+++ branches/safari-536.28-branch/Source/WebCore/plugins/PluginData.cpp	2012-11-15 21:44:22 UTC (rev 134829)
@@ -52,18 +52,32 @@
     return false;
 }
 
-String PluginData::pluginNameForMimeType(const String& mimeType) const
+const PluginInfo* PluginData::pluginInfoForMimeType(const String& mimeType) const
 {
     for (unsigned i = 0; i < m_mimes.size(); ++i) {
         const MimeClassInfo& info = m_mimes[i];
     
         if (info.type == mimeType)
-            return m_plugins[m_mimePluginIndices[i]].name;
+            return &m_plugins[m_mimePluginIndices[i]];
     }
 
+    return 0;
+}
+
+String PluginData::pluginNameForMimeType(const String& mimeType) const
+{
+    if (const PluginInfo* info = pluginInfoForMimeType(mimeType))
+        return info->name;
     return String();
 }
 
+String PluginData::pluginFileForMimeType(const String& mimeType) const
+{
+    if (const PluginInfo* info = pluginInfoForMimeType(mimeType))
+        return info->file;
+    return String();
+}
+
 #if USE(PLATFORM_STRATEGIES)
 void PluginData::refresh()
 {

Modified: branches/safari-536.28-branch/Source/WebCore/plugins/PluginData.h (134828 => 134829)


--- branches/safari-536.28-branch/Source/WebCore/plugins/PluginData.h	2012-11-15 21:41:07 UTC (rev 134828)
+++ branches/safari-536.28-branch/Source/WebCore/plugins/PluginData.h	2012-11-15 21:44:22 UTC (rev 134829)
@@ -79,12 +79,14 @@
     
     bool supportsMimeType(const String& mimeType) const;
     String pluginNameForMimeType(const String& mimeType) const;
+    String pluginFileForMimeType(const String& mimeType) const;
 
     static void refresh();
 
 private:
     PluginData(const Page*);
     void initPlugins(const Page*);
+    const PluginInfo* pluginInfoForMimeType(const String& mimeType) const;
 
     Vector<PluginInfo> m_plugins;
     Vector<MimeClassInfo> m_mimes;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to