Changeset 100222 in webkit


Ignore:
Timestamp:
Nov 14, 2011 5:23:35 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[MutationObservers] Add histogram collection for usage of DOM Mutation Events
https://bugs.webkit.org/show_bug.cgi?id=72316

Patch by Rafael Weinstein <rafaelw@chromium.org> on 2011-11-14
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r100214 r100222  
     12011-11-14  Rafael Weinstein  <rafaelw@chromium.org>
     2
     3        [MutationObservers] Add histogram collection for usage of DOM Mutation Events
     4        https://bugs.webkit.org/show_bug.cgi?id=72316
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        This patch adds six calls in ~Document() which simply pipe-out to the embedder
     9        the (already-collected) bits of whether varous DOM Mutation Events were registered
     10        on the document.
     11
     12        No tests needed. No functional changes.
     13
     14        * dom/Document.cpp:
     15        (WebCore::histogramMutationEventUsage):
     16        (WebCore::Document::~Document):
     17
    1182011-11-14  Simon Fraser  <simon.fraser@apple.com>
    219
  • trunk/Source/WebCore/dom/Document.cpp

    r100170 r100222  
    158158#include <wtf/text/StringBuffer.h>
    159159
     160#if PLATFORM(CHROMIUM)
     161#include "PlatformSupport.h"
     162#endif
     163
    160164#if ENABLE(SHARED_WORKERS)
    161165#include "SharedWorkerRepository.h"
     
    494498}
    495499
     500#if PLATFORM(CHROMIUM)
     501static void histogramMutationEventUsage(const unsigned short& listenerTypes)
     502{
     503    PlatformSupport::histogramEnumeration("DOMAPI.PerDocumentMutationEventUsage.DOMSubtreeModified", static_cast<bool>(listenerTypes & Document::DOMSUBTREEMODIFIED_LISTENER), 2);
     504    PlatformSupport::histogramEnumeration("DOMAPI.PerDocumentMutationEventUsage.DOMNodeInserted", static_cast<bool>(listenerTypes & Document::DOMNODEINSERTED_LISTENER), 2);
     505    PlatformSupport::histogramEnumeration("DOMAPI.PerDocumentMutationEventUsage.DOMNodeRemoved", static_cast<bool>(listenerTypes & Document::DOMNODEREMOVED_LISTENER), 2);
     506    PlatformSupport::histogramEnumeration("DOMAPI.PerDocumentMutationEventUsage.DOMNodeRemovedFromDocument", static_cast<bool>(listenerTypes & Document::DOMNODEREMOVEDFROMDOCUMENT_LISTENER), 2);
     507    PlatformSupport::histogramEnumeration("DOMAPI.PerDocumentMutationEventUsage.DOMNodeInsertedIntoDocument", static_cast<bool>(listenerTypes & Document::DOMNODEINSERTEDINTODOCUMENT_LISTENER), 2);
     508    PlatformSupport::histogramEnumeration("DOMAPI.PerDocumentMutationEventUsage.DOMCharacterDataModified", static_cast<bool>(listenerTypes & Document::DOMCHARACTERDATAMODIFIED_LISTENER), 2);
     509}
     510#endif
     511
    496512Document::~Document()
    497513{
     
    505521
    506522    m_scriptRunner.clear();
     523
     524#if PLATFORM(CHROMIUM)
     525    histogramMutationEventUsage(m_listenerTypes);
     526#endif
    507527
    508528    removeAllEventListeners();
Note: See TracChangeset for help on using the changeset viewer.