Diff
Modified: branches/safari-536.26-branch/Source/WebCore/ChangeLog (124818 => 124819)
--- branches/safari-536.26-branch/Source/WebCore/ChangeLog 2012-08-06 23:51:06 UTC (rev 124818)
+++ branches/safari-536.26-branch/Source/WebCore/ChangeLog 2012-08-06 23:58:36 UTC (rev 124819)
@@ -1,5 +1,28 @@
2012-08-06 Lucas Forschler <[email protected]>
+ Merge 123780
+
+ 2012-07-25 Jer Noble <[email protected]>
+
+ Add diagnostic messages when media and plugins load or fail to load.
+ https://bugs.webkit.org/show_bug.cgi?id=92341
+
+ Reviewed by Anders Carlsson.
+
+ Send diagnostic messages when a media or plugin element loads or fails to load. Include in
+ the trace the media engine description, error code, or plugin mime type.
+
+ * html/HTMLEmbedElement.cpp:
+ (WebCore::HTMLEmbedElement::updateWidget): Send a diagnostic message.
+ * html/HTMLMediaElement.cpp:
+ (WebCore::stringForNetworkState): Added convenience function to stringify network states.
+ (WebCore::HTMLMediaElement::mediaLoadingFailed): Send a diagnostic message.
+ (WebCore::HTMLMediaElement::setReadyState): Send a diagnostic message.
+ * html/HTMLObjectElement.cpp:
+ (WebCore::HTMLObjectElement::updateWidget): Send a diagnostic message.
+
+2012-08-06 Lucas Forschler <[email protected]>
+
Merge 123778
2012-07-26 Jer Noble <[email protected]>
Modified: branches/safari-536.26-branch/Source/WebCore/html/HTMLEmbedElement.cpp (124818 => 124819)
--- branches/safari-536.26-branch/Source/WebCore/html/HTMLEmbedElement.cpp 2012-08-06 23:51:06 UTC (rev 124818)
+++ branches/safari-536.26-branch/Source/WebCore/html/HTMLEmbedElement.cpp 2012-08-06 23:58:36 UTC (rev 124819)
@@ -26,6 +26,9 @@
#include "Attribute.h"
#include "CSSPropertyNames.h"
+#include "Chrome.h"
+#include "ChromeClient.h"
+#include "DiagnosticLoggingKeys.h"
#include "DocumentLoader.h"
#include "Frame.h"
#include "HTMLDocument.h"
@@ -34,6 +37,7 @@
#include "HTMLObjectElement.h"
#include "HTMLParserIdioms.h"
#include "MainResourceLoader.h"
+#include "Page.h"
#include "PluginDocument.h"
#include "RenderEmbeddedObject.h"
#include "RenderImage.h"
@@ -174,7 +178,10 @@
SubframeLoader* loader = document()->frame()->loader()->subframeLoader();
// FIXME: beforeLoad could have detached the renderer! Just like in the <object> case above.
- loader->requestObject(this, m_url, getNameAttribute(), m_serviceType, paramNames, paramValues);
+ bool success = loader->requestObject(this, m_url, getNameAttribute(), m_serviceType, paramNames, paramValues);
+
+ if (document()->page() && document()->page()->settings()->diagnosticLoggingEnabled())
+ document()->page()->chrome()->client()->logDiagnosticMessage(success ? DiagnosticLoggingKeys::pluginLoadedKey() : DiagnosticLoggingKeys::pluginLoadingFailedKey(), m_serviceType, DiagnosticLoggingKeys::noopKey());
}
bool HTMLEmbedElement::rendererIsNeeded(const NodeRenderingContext& context)
Modified: branches/safari-536.26-branch/Source/WebCore/html/HTMLMediaElement.cpp (124818 => 124819)
--- branches/safari-536.26-branch/Source/WebCore/html/HTMLMediaElement.cpp 2012-08-06 23:51:06 UTC (rev 124818)
+++ branches/safari-536.26-branch/Source/WebCore/html/HTMLMediaElement.cpp 2012-08-06 23:58:36 UTC (rev 124819)
@@ -39,6 +39,7 @@
#include "ContentType.h"
#include "CSSPropertyNames.h"
#include "CSSValueKeywords.h"
+#include "DiagnosticLoggingKeys.h"
#include "DocumentLoader.h"
#include "Event.h"
#include "EventNames.h"
@@ -1472,6 +1473,20 @@
endProcessingMediaPlayerCallback();
}
+static String stringForNetworkState(MediaPlayer::NetworkState state)
+{
+ switch (state) {
+ case MediaPlayer::Empty: return "Empty";
+ case MediaPlayer::Idle: return "Idle";
+ case MediaPlayer::Loading: return "Loading";
+ case MediaPlayer::Loaded: return "Loaded";
+ case MediaPlayer::FormatError: return "FormatError";
+ case MediaPlayer::NetworkError: return "NetworkError";
+ case MediaPlayer::DecodeError: return "DecodeError";
+ default: return emptyString();
+ }
+}
+
void HTMLMediaElement::mediaLoadingFailed(MediaPlayer::NetworkState error)
{
stopPeriodicTimers();
@@ -1508,6 +1523,9 @@
mediaControls()->reset();
mediaControls()->reportedError();
}
+
+ if (document()->page() && document()->page()->settings()->diagnosticLoggingEnabled())
+ document()->page()->chrome()->client()->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadingFailedKey(), stringForNetworkState(error), DiagnosticLoggingKeys::failKey());
}
void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
@@ -1636,6 +1654,9 @@
mediaControls()->loadedMetadata();
if (renderer())
renderer()->updateFromElement();
+
+ if (document()->page() && document()->page()->settings()->diagnosticLoggingEnabled())
+ document()->page()->chrome()->client()->logDiagnosticMessage(DiagnosticLoggingKeys::mediaLoadedKey(), m_player->engineDescription(), DiagnosticLoggingKeys::noopKey());
}
bool shouldUpdateDisplayState = false;
Modified: branches/safari-536.26-branch/Source/WebCore/html/HTMLObjectElement.cpp (124818 => 124819)
--- branches/safari-536.26-branch/Source/WebCore/html/HTMLObjectElement.cpp 2012-08-06 23:51:06 UTC (rev 124818)
+++ branches/safari-536.26-branch/Source/WebCore/html/HTMLObjectElement.cpp 2012-08-06 23:58:36 UTC (rev 124819)
@@ -26,6 +26,9 @@
#include "Attribute.h"
#include "CSSValueKeywords.h"
+#include "Chrome.h"
+#include "ChromeClient.h"
+#include "DiagnosticLoggingKeys.h"
#include "EventNames.h"
#include "ExceptionCode.h"
#include "FormDataList.h"
@@ -316,6 +319,9 @@
bool success = beforeLoadAllowedLoad && hasValidClassId() && loader->requestObject(this, url, getNameAttribute(), serviceType, paramNames, paramValues);
if (!success && fallbackContent)
renderFallbackContent();
+
+ if (document()->page() && document()->page()->settings()->diagnosticLoggingEnabled())
+ document()->page()->chrome()->client()->logDiagnosticMessage(success ? DiagnosticLoggingKeys::pluginLoadedKey() : DiagnosticLoggingKeys::pluginLoadingFailedKey(), serviceType, DiagnosticLoggingKeys::noopKey());
}
bool HTMLObjectElement::rendererIsNeeded(const NodeRenderingContext& context)