+2011-11-14 Rafael Weinstein <rafaelw@chromium.org>
+
+ [MutationObservers] Add histogram collection for usage of DOM Mutation Events
+ https://bugs.webkit.org/show_bug.cgi?id=72316
+
+ Reviewed by Ryosuke Niwa.
+
+ This patch adds six calls in ~Document() which simply pipe-out to the embedder
+ the (already-collected) bits of whether varous DOM Mutation Events were registered
+ on the document.
+
+ No tests needed. No functional changes.
+
+ * dom/Document.cpp:
+ (WebCore::histogramMutationEventUsage):
+ (WebCore::Document::~Document):
+
2011-11-14 Simon Fraser <simon.fraser@apple.com>
div with webkit-transform + webkit-box-reflect disappears when switching tabs
#include <wtf/StdLibExtras.h>
#include <wtf/text/StringBuffer.h>
+#if PLATFORM(CHROMIUM)
+#include "PlatformSupport.h"
+#endif
+
#if ENABLE(SHARED_WORKERS)
#include "SharedWorkerRepository.h"
#endif
m_docID = docID++;
}
+#if PLATFORM(CHROMIUM)
+static void histogramMutationEventUsage(const unsigned short& listenerTypes)
+{
+ PlatformSupport::histogramEnumeration("DOMAPI.PerDocumentMutationEventUsage.DOMSubtreeModified", static_cast<bool>(listenerTypes & Document::DOMSUBTREEMODIFIED_LISTENER), 2);
+ PlatformSupport::histogramEnumeration("DOMAPI.PerDocumentMutationEventUsage.DOMNodeInserted", static_cast<bool>(listenerTypes & Document::DOMNODEINSERTED_LISTENER), 2);
+ PlatformSupport::histogramEnumeration("DOMAPI.PerDocumentMutationEventUsage.DOMNodeRemoved", static_cast<bool>(listenerTypes & Document::DOMNODEREMOVED_LISTENER), 2);
+ PlatformSupport::histogramEnumeration("DOMAPI.PerDocumentMutationEventUsage.DOMNodeRemovedFromDocument", static_cast<bool>(listenerTypes & Document::DOMNODEREMOVEDFROMDOCUMENT_LISTENER), 2);
+ PlatformSupport::histogramEnumeration("DOMAPI.PerDocumentMutationEventUsage.DOMNodeInsertedIntoDocument", static_cast<bool>(listenerTypes & Document::DOMNODEINSERTEDINTODOCUMENT_LISTENER), 2);
+ PlatformSupport::histogramEnumeration("DOMAPI.PerDocumentMutationEventUsage.DOMCharacterDataModified", static_cast<bool>(listenerTypes & Document::DOMCHARACTERDATAMODIFIED_LISTENER), 2);
+}
+#endif
+
Document::~Document()
{
ASSERT(!renderer());
m_scriptRunner.clear();
+#if PLATFORM(CHROMIUM)
+ histogramMutationEventUsage(m_listenerTypes);
+#endif
+
removeAllEventListeners();
// Currently we believe that Document can never outlive the parser.