Add diagnostic logging to track per-page media engine usage.
https://bugs.webkit.org/show_bug.cgi?id=99615
<rdar://problem/12476473>
Reviewed by Eric Carlson.
Add diagnostic logging triggered only once-per-page and once-per-page-per-engine.
* html/HTMLMediaElement.cpp:
(WebCore::logMediaLoadRequest): Encapsulate diagnostic logging into single static method.
(WebCore::HTMLMediaElement::mediaLoadingFailed): Call logMediaLoadRequest.
(WebCore::HTMLMediaElement::setReadyState): Ditto.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::dispatchDidCommitLoad): Reset the set of seen media engines.
Add new methods to Page to track per-page media engine diagnostic info, similar to plugin diagnostic info.
* page/Page.cpp:
(WebCore::Page::hasSeenAnyMediaEngine):
(WebCore::Page::hasSeenMediaEngine):
(WebCore::Page::sawMediaEngine):
(WebCore::Page::resetSeenMediaEngines):
* page/Page.h:
Add new static logging key definitions:
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::pageContainsMediaEngineKey):
(WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey):
* page/DiagnosticLoggingKeys.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131779 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp
index a84c508..befaa924 100644
--- a/Source/WebCore/loader/FrameLoader.cpp
+++ b/Source/WebCore/loader/FrameLoader.cpp
@@ -3192,8 +3192,10 @@
m_client->dispatchDidCommitLoad();
- if (isLoadingMainFrame())
+ if (isLoadingMainFrame()) {
m_frame->page()->resetSeenPlugins();
+ m_frame->page()->resetSeenMediaEngines();
+ }
InspectorInstrumentation::didCommitLoad(m_frame, m_documentLoader.get());
}