Add diagnostic logging for plugins-per-page.
Created attachment 155027 [details] Patch
Comment on attachment 155027 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=155027&action=review > Source/WebCore/html/HTMLEmbedElement.cpp:190 > + if (document()->page() && document()->page()->settings()->diagnosticLoggingEnabled()) { > + Page* page = document()->page(); > + ChromeClient* client = page->chrome()->client(); > + client->logDiagnosticMessage(success ? DiagnosticLoggingKeys::pluginLoadedKey() : DiagnosticLoggingKeys::pluginLoadingFailedKey(), m_serviceType, DiagnosticLoggingKeys::noopKey()); > + if (!page->hasSeenAnyPlugin()) > + client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey(), emptyString(), DiagnosticLoggingKeys::noopKey()); > + if (!page->hasSeenPlugin(m_serviceType)) > + client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsPluginKey(), m_serviceType, DiagnosticLoggingKeys::noopKey()); > + page->sawPlugin(m_serviceType); > + } I think this code can be moved into a function in HTMLPluginImageElement and shared between HTMLEmbedElement and HTMLObjectElement. You also need to do the same thing now for HTMLAppletElement. You also want to null check page.
(In reply to comment #2) > (From update of attachment 155027 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=155027&action=review > > > Source/WebCore/html/HTMLEmbedElement.cpp:190 > > + if (document()->page() && document()->page()->settings()->diagnosticLoggingEnabled()) { > > + Page* page = document()->page(); > > + ChromeClient* client = page->chrome()->client(); > > + client->logDiagnosticMessage(success ? DiagnosticLoggingKeys::pluginLoadedKey() : DiagnosticLoggingKeys::pluginLoadingFailedKey(), m_serviceType, DiagnosticLoggingKeys::noopKey()); > > + if (!page->hasSeenAnyPlugin()) > > + client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey(), emptyString(), DiagnosticLoggingKeys::noopKey()); > > + if (!page->hasSeenPlugin(m_serviceType)) > > + client->logDiagnosticMessage(DiagnosticLoggingKeys::pageContainsPluginKey(), m_serviceType, DiagnosticLoggingKeys::noopKey()); > > + page->sawPlugin(m_serviceType); > > + } > > I think this code can be moved into a function in HTMLPluginImageElement and shared between HTMLEmbedElement and HTMLObjectElement. You also need to do the same thing now for HTMLAppletElement. Sure thing. > You also want to null check page. Page gets null checked on the first line, but yes. :)
Created attachment 155069 [details] Patch Moved logging into SubframeLoader to catch all plugin subtypes, including HTMLAppletElement.
Created attachment 155074 [details] Patch Now with more applets!
Committed r123930: <http://trac.webkit.org/changeset/123930>
Comment on attachment 155074 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=155074&action=review > Source/WebCore/page/Page.cpp:1174 > +bool Page::hasSeenPlugin(const String& serviceType) const > +{ > + return m_seenPlugins.contains(serviceType); > +} > + > +void Page::sawPlugin(const String& serviceType) > +{ > + m_seenPlugins.add(serviceType); > +} Do we have a guarantee that serviceType won’t be the empty string or null?