Changeset 172404 in webkit


Ignore:
Timestamp:
Aug 11, 2014, 12:50:52 PM (11 years ago)
Author:
timothy@apple.com
Message:

Web Inspector: console.profile shouldn't stop auto-recorded profiles
https://bugs.webkit.org/show_bug.cgi?id=135810

Reviewed by Joseph Pecoraro.

  • inspector/InspectorTimelineAgent.cpp:

(WebCore::InspectorTimelineAgent::start): Added. Call internalStart. Set m_enabledFromFrontend.
(WebCore::InspectorTimelineAgent::stop): Added. Calls internalStop. Clear m_enabledFromFrontend.
(WebCore::InspectorTimelineAgent::internalStart): Renamed from start.
(WebCore::InspectorTimelineAgent::internalStop): Renamed from stop.
(WebCore::InspectorTimelineAgent::startFromConsole): Use internalStart.
(WebCore::InspectorTimelineAgent::stopFromConsole): Use internalStop. Only stop if !m_enabledFromFrontend.
(WebCore::InspectorTimelineAgent::InspectorTimelineAgent): Initialize m_enabledFromFrontend.

  • inspector/InspectorTimelineAgent.h: Added m_enabledFromFrontend.
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r172397 r172404  
     12014-08-11  Timothy Hatcher  <timothy@apple.com>
     2
     3        Web Inspector: console.profile shouldn't stop auto-recorded profiles
     4        https://bugs.webkit.org/show_bug.cgi?id=135810
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * inspector/InspectorTimelineAgent.cpp:
     9        (WebCore::InspectorTimelineAgent::start): Added. Call internalStart. Set m_enabledFromFrontend.
     10        (WebCore::InspectorTimelineAgent::stop): Added. Calls internalStop. Clear m_enabledFromFrontend.
     11        (WebCore::InspectorTimelineAgent::internalStart): Renamed from start.
     12        (WebCore::InspectorTimelineAgent::internalStop): Renamed from stop.
     13        (WebCore::InspectorTimelineAgent::startFromConsole): Use internalStart.
     14        (WebCore::InspectorTimelineAgent::stopFromConsole): Use internalStop. Only stop if !m_enabledFromFrontend.
     15        (WebCore::InspectorTimelineAgent::InspectorTimelineAgent): Initialize m_enabledFromFrontend.
     16        * inspector/InspectorTimelineAgent.h: Added m_enabledFromFrontend.
     17
    1182014-08-11  Brent Fulgham  <bfulgham@apple.com>
    219
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp

    r171866 r172404  
    100100void InspectorTimelineAgent::start(ErrorString*, const int* maxCallStackDepth)
    101101{
     102    m_enabledFromFrontend = true;
     103
     104    internalStart(maxCallStackDepth);
     105}
     106
     107void InspectorTimelineAgent::stop(ErrorString*)
     108{
     109    internalStop();
     110
     111    m_enabledFromFrontend = false;
     112}
     113
     114void InspectorTimelineAgent::internalStart(const int* maxCallStackDepth)
     115{
    102116    if (maxCallStackDepth && *maxCallStackDepth > 0)
    103117        m_maxCallStackDepth = *maxCallStackDepth;
     
    118132}
    119133
    120 void InspectorTimelineAgent::stop(ErrorString*)
     134void InspectorTimelineAgent::internalStop()
    121135{
    122136    if (!m_enabled)
     
    177191    }
    178192
    179     if (m_pendingConsoleProfileRecords.isEmpty())
    180         start();
     193    if (!m_enabled && m_pendingConsoleProfileRecords.isEmpty())
     194        internalStart();
    181195
    182196    startProfiling(exec, title);
     
    204218            m_pendingConsoleProfileRecords.remove(i);
    205219
    206             if (m_pendingConsoleProfileRecords.isEmpty())
    207                 stop();
     220            if (!m_enabledFromFrontend && m_pendingConsoleProfileRecords.isEmpty())
     221                internalStop();
    208222
    209223            return profile.release();
     
    683697    , m_recordingProfileDepth(0)
    684698    , m_enabled(false)
     699    , m_enabledFromFrontend(false)
    685700{
    686701}
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.h

    r171866 r172404  
    246246    };
    247247
     248    void internalStart(const int* maxCallStackDepth = nullptr);
     249    void internalStop();
     250
    248251    void sendEvent(PassRefPtr<Inspector::InspectorObject>);
    249252    void appendRecord(PassRefPtr<Inspector::InspectorObject> data, TimelineRecordType, bool captureCallStack, Frame*);
     
    285288    int m_recordingProfileDepth;
    286289    bool m_enabled;
     290    bool m_enabledFromFrontend;
    287291};
    288292
Note: See TracChangeset for help on using the changeset viewer.