Changeset 202196 in webkit


Ignore:
Timestamp:
Jun 17, 2016 8:33:19 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r202152.
https://bugs.webkit.org/show_bug.cgi?id=158897

The new test is very unstable, timing out frequently
(Requested by ap on #webkit).

Reverted changeset:

"Web Inspector: console.profile should use the new Sampling
Profiler"
https://bugs.webkit.org/show_bug.cgi?id=153499
http://trac.webkit.org/changeset/202152

Location:
trunk
Files:
2 deleted
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r202195 r202196  
     12016-06-17  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r202152.
     4        https://bugs.webkit.org/show_bug.cgi?id=158897
     5
     6        The new test is very unstable, timing out frequently
     7        (Requested by ap on #webkit).
     8
     9        Reverted changeset:
     10
     11        "Web Inspector: console.profile should use the new Sampling
     12        Profiler"
     13        https://bugs.webkit.org/show_bug.cgi?id=153499
     14        http://trac.webkit.org/changeset/202152
     15
    1162016-06-17  Commit Queue  <commit-queue@webkit.org>
    217
  • trunk/Source/JavaScriptCore/ChangeLog

    r202157 r202196  
     12016-06-17  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r202152.
     4        https://bugs.webkit.org/show_bug.cgi?id=158897
     5
     6        The new test is very unstable, timing out frequently
     7        (Requested by ap on #webkit).
     8
     9        Reverted changeset:
     10
     11        "Web Inspector: console.profile should use the new Sampling
     12        Profiler"
     13        https://bugs.webkit.org/show_bug.cgi?id=153499
     14        http://trac.webkit.org/changeset/202152
     15
    1162016-06-14  Filip Pizlo  <fpizlo@apple.com>
    217
  • trunk/Source/JavaScriptCore/debugger/Debugger.h

    r202152 r202196  
    7979    void activateBreakpoints() { setBreakpointsActivated(true); }
    8080    void deactivateBreakpoints() { setBreakpointsActivated(false); }
    81     bool breakpointsActive() const { return m_breakpointsActivated; }
    8281
    8382    enum PauseOnExceptionsState {
  • trunk/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.cpp

    r202152 r202196  
    2929#include "ConsoleMessage.h"
    3030#include "InspectorConsoleAgent.h"
    31 #include "InspectorDebuggerAgent.h"
    32 #include "InspectorScriptProfilerAgent.h"
    3331#include "ScriptArguments.h"
    3432#include "ScriptCallStack.h"
     
    5553}
    5654
    57 JSGlobalObjectConsoleClient::JSGlobalObjectConsoleClient(InspectorConsoleAgent* consoleAgent, InspectorDebuggerAgent* debuggerAgent, InspectorScriptProfilerAgent* scriptProfilerAgent)
     55JSGlobalObjectConsoleClient::JSGlobalObjectConsoleClient(InspectorConsoleAgent* consoleAgent)
    5856    : ConsoleClient()
    5957    , m_consoleAgent(consoleAgent)
    60     , m_debuggerAgent(debuggerAgent)
    61     , m_scriptProfilerAgent(scriptProfilerAgent)
    6258{
    6359}
     
    7874}
    7975
    80 void JSGlobalObjectConsoleClient::profile(JSC::ExecState*, const String& title)
     76void JSGlobalObjectConsoleClient::profile(JSC::ExecState*, const String&)
    8177{
    82     if (!m_consoleAgent->enabled())
    83         return;
    84 
    85     // Allow duplicate unnamed profiles. Disallow duplicate named profiles.
    86     if (!title.isEmpty()) {
    87         for (auto& existingTitle : m_profiles) {
    88             if (existingTitle == title) {
    89                 // FIXME: Send an enum to the frontend for localization?
    90                 String warning = title.isEmpty() ? ASCIILiteral("Unnamed Profile already exists") : makeString("Profile \"", title, "\" already exists");
    91                 m_consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Profile, MessageLevel::Warning, warning));
    92                 return;
    93             }
    94         }
    95     }
    96 
    97     m_profiles.append(title);
    98     startConsoleProfile();
     78    // FIXME: support |console.profile| for JSContexts. <https://webkit.org/b/136466>
    9979}
    10080
    101 void JSGlobalObjectConsoleClient::profileEnd(JSC::ExecState*, const String& title)
     81void JSGlobalObjectConsoleClient::profileEnd(JSC::ExecState*, const String&)
    10282{
    103     if (!m_consoleAgent->enabled())
    104         return;
    105 
    106     // Stop profiles in reverse order. If the title is empty, then stop the last profile.
    107     // Otherwise, match the title of the profile to stop.
    108     for (ptrdiff_t i = m_profiles.size() - 1; i >= 0; --i) {
    109         if (title.isEmpty() || m_profiles[i] == title) {
    110             m_profiles.remove(i);
    111             if (m_profiles.isEmpty())
    112                 stopConsoleProfile();
    113             return;
    114         }
    115     }
    116 
    117     // FIXME: Send an enum to the frontend for localization?
    118     String warning = title.isEmpty() ? ASCIILiteral("No profiles exist") : makeString("Profile \"", title, "\" does not exist");
    119     m_consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::ProfileEnd, MessageLevel::Warning, warning));   
    120 }
    121 
    122 void JSGlobalObjectConsoleClient::startConsoleProfile()
    123 {
    124     // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection
    125     m_scriptProfilerAgent->programmaticCaptureStarted();
    126 
    127     m_profileRestoreBreakpointActiveValue = m_debuggerAgent->breakpointsActive();
    128 
    129     ErrorString unused;
    130     m_debuggerAgent->setBreakpointsActive(unused, false);
    131 
    132     const bool includeSamples = true;
    133     m_scriptProfilerAgent->startTracking(unused, &includeSamples);
    134 }
    135 
    136 void JSGlobalObjectConsoleClient::stopConsoleProfile()
    137 {
    138     ErrorString unused;
    139     m_scriptProfilerAgent->stopTracking(unused);
    140 
    141     m_debuggerAgent->setBreakpointsActive(unused, m_profileRestoreBreakpointActiveValue);
    142 
    143     // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection
    144     m_scriptProfilerAgent->programmaticCaptureStopped();
     83    // FIXME: support |console.profile| for JSContexts. <https://webkit.org/b/136466>
    14584}
    14685
  • trunk/Source/JavaScriptCore/inspector/JSGlobalObjectConsoleClient.h

    r202152 r202196  
    2424 */
    2525
    26 #pragma once
     26#ifndef JSGlobalObjectConsoleClient_h
     27#define JSGlobalObjectConsoleClient_h
    2728
    2829#include "ConsoleClient.h"
    29 #include <wtf/Vector.h>
    30 #include <wtf/text/WTFString.h>
    3130
    3231namespace Inspector {
    3332
    3433class InspectorConsoleAgent;
    35 class InspectorDebuggerAgent;
    36 class InspectorScriptProfilerAgent;
    3734
    3835class JSGlobalObjectConsoleClient final : public JSC::ConsoleClient {
    3936    WTF_MAKE_FAST_ALLOCATED;
    4037public:
    41     explicit JSGlobalObjectConsoleClient(InspectorConsoleAgent*, InspectorDebuggerAgent*, InspectorScriptProfilerAgent*);
     38    explicit JSGlobalObjectConsoleClient(InspectorConsoleAgent*);
    4239    virtual ~JSGlobalObjectConsoleClient() { }
    4340
     
    5956    void internalAddMessage(MessageType, MessageLevel, JSC::ExecState*, RefPtr<ScriptArguments>&&);
    6057
    61     void startConsoleProfile();
    62     void stopConsoleProfile();
    63 
    6458    InspectorConsoleAgent* m_consoleAgent;
    65     InspectorDebuggerAgent* m_debuggerAgent;
    66     InspectorScriptProfilerAgent* m_scriptProfilerAgent;
    67     Vector<String> m_profiles;
    68     bool m_profileRestoreBreakpointActiveValue { false };
    6959};
    7060
    7161}
     62
     63#endif // !defined(JSGlobalObjectConsoleClient_h)
  • trunk/Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp

    r202152 r202196  
    8989    auto consoleAgent = std::make_unique<JSGlobalObjectConsoleAgent>(context, heapAgent.get());
    9090    auto debuggerAgent = std::make_unique<JSGlobalObjectDebuggerAgent>(context, consoleAgent.get());
    91     auto scriptProfilerAgent = std::make_unique<InspectorScriptProfilerAgent>(context);
    9291
    9392    m_inspectorAgent = inspectorAgent.get();
    9493    m_debuggerAgent = debuggerAgent.get();
    9594    m_consoleAgent = consoleAgent.get();
    96     m_consoleClient = std::make_unique<JSGlobalObjectConsoleClient>(m_consoleAgent, m_debuggerAgent, scriptProfilerAgent.get());
     95    m_consoleClient = std::make_unique<JSGlobalObjectConsoleClient>(m_consoleAgent);
    9796
    9897    m_agents.append(WTFMove(inspectorAgent));
     
    101100    m_agents.append(WTFMove(debuggerAgent));
    102101    m_agents.append(WTFMove(heapAgent));
    103     m_agents.append(WTFMove(scriptProfilerAgent));
     102    m_agents.append(std::make_unique<InspectorScriptProfilerAgent>(context));
    104103
    105104    m_executionStopwatch->start();
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp

    r202152 r202196  
    126126}
    127127
    128 bool InspectorDebuggerAgent::breakpointsActive() const
    129 {
    130     return m_scriptDebugServer.breakpointsActive();
    131 }
    132 
    133128void InspectorDebuggerAgent::setBreakpointsActive(ErrorString&, bool active)
    134129{
     
    139134}
    140135
    141 bool InspectorDebuggerAgent::isPaused() const
     136bool InspectorDebuggerAgent::isPaused()
    142137{
    143138    return m_scriptDebugServer.isPaused();
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h

    r202152 r202196  
    8484    void setOverlayMessage(ErrorString&, const String*) override;
    8585
    86     bool isPaused() const;
    87     bool breakpointsActive() const;
     86    bool isPaused();
    8887
    8988    void setSuppressAllPauses(bool);
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorScriptProfilerAgent.cpp

    r202152 r202196  
    217217}
    218218
    219 void InspectorScriptProfilerAgent::programmaticCaptureStarted()
    220 {
    221     m_frontendDispatcher->programmaticCaptureStarted();
    222 }
    223 
    224 void InspectorScriptProfilerAgent::programmaticCaptureStopped()
    225 {
    226     m_frontendDispatcher->programmaticCaptureStopped();
    227 }
    228 
    229219} // namespace Inspector
  • trunk/Source/JavaScriptCore/inspector/agents/InspectorScriptProfilerAgent.h

    r202152 r202196  
    5454    void stopTracking(ErrorString&) override;
    5555
    56     void programmaticCaptureStarted();
    57     void programmaticCaptureStopped();
    58 
    5956    // Debugger::ProfilingClient
    6057    bool isAlreadyProfiling() const override;
  • trunk/Source/JavaScriptCore/inspector/protocol/ScriptProfiler.json

    r202152 r202196  
    8787                { "name": "samples", "$ref": "Samples", "optional": true, "description": "Stack traces." }
    8888            ]
    89         },
    90         {
    91             "name": "programmaticCaptureStarted",
    92             "description": "Fired when programmatic capture starts (console.profile). JSContext inspection only."
    93         },
    94         {
    95             "name": "programmaticCaptureStopped",
    96             "description": "Fired when programmatic capture stops (console.profileEnd). JSContext inspection only."
    9789        }
    9890    ]
  • trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json

    r202152 r202196  
    106106            "name": "autoCaptureStarted",
    107107            "description": "Fired when auto capture started."
    108         },
    109         {
    110             "name": "programmaticCaptureStarted",
    111             "description": "Fired when programmatic capture starts (console.profile)."
    112         },
    113         {
    114             "name": "programmaticCaptureStopped",
    115             "description": "Fired when programmatic capture stops (console.profileEnd)."
    116108        }
    117109    ]
  • trunk/Source/WebCore/ChangeLog

    r202195 r202196  
     12016-06-17  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r202152.
     4        https://bugs.webkit.org/show_bug.cgi?id=158897
     5
     6        The new test is very unstable, timing out frequently
     7        (Requested by ap on #webkit).
     8
     9        Reverted changeset:
     10
     11        "Web Inspector: console.profile should use the new Sampling
     12        Profiler"
     13        https://bugs.webkit.org/show_bug.cgi?id=153499
     14        http://trac.webkit.org/changeset/202152
     15
    1162016-06-17  Commit Queue  <commit-queue@webkit.org>
    217
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp

    r202152 r202196  
    4444#include "ScriptState.h"
    4545#include "TimelineRecordFactory.h"
    46 #include "WebConsoleAgent.h"
    47 #include <inspector/ConsoleMessage.h>
    4846#include <inspector/ScriptBreakpoint.h>
    4947#include <inspector/agents/InspectorDebuggerAgent.h>
     
    244242}
    245243
    246 void InspectorTimelineAgent::startFromConsole(JSC::ExecState* exec, const String& title)
    247 {
    248     // Allow duplicate unnamed profiles. Disallow duplicate named profiles.
    249     if (!title.isEmpty()) {
    250         for (const TimelineRecordEntry& record : m_pendingConsoleProfileRecords) {
    251             String recordTitle;
    252             record.data->getString(ASCIILiteral("title"), recordTitle);
    253             if (recordTitle == title) {
    254                 if (WebConsoleAgent* consoleAgent = m_instrumentingAgents.webConsoleAgent()) {
    255                     // FIXME: Send an enum to the frontend for localization?
    256                     String warning = title.isEmpty() ? ASCIILiteral("Unnamed Profile already exists") : makeString("Profile \"", title, "\" already exists");
    257                     consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Profile, MessageLevel::Warning, warning));
    258                 }
    259                 return;
    260             }
    261         }
    262     }
    263 
    264     if (!m_enabled && m_pendingConsoleProfileRecords.isEmpty())
    265         startProgrammaticCapture();
    266 
    267     m_pendingConsoleProfileRecords.append(createRecordEntry(TimelineRecordFactory::createConsoleProfileData(title), TimelineRecordType::ConsoleProfile, true, frameFromExecState(exec)));
    268 }
    269 
    270 void InspectorTimelineAgent::stopFromConsole(JSC::ExecState*, const String& title)
    271 {
    272     // Stop profiles in reverse order. If the title is empty, then stop the last profile.
    273     // Otherwise, match the title of the profile to stop.
    274     for (int i = m_pendingConsoleProfileRecords.size() - 1; i >= 0; --i) {
    275         const TimelineRecordEntry& record = m_pendingConsoleProfileRecords[i];
    276 
    277         String recordTitle;
    278         record.data->getString(ASCIILiteral("title"), recordTitle);
    279         if (title.isEmpty() || recordTitle == title) {
    280             didCompleteRecordEntry(record);
    281             m_pendingConsoleProfileRecords.remove(i);
    282 
    283             if (!m_enabledFromFrontend && m_pendingConsoleProfileRecords.isEmpty())
    284                 stopProgrammaticCapture();
    285 
    286             return;
    287         }
    288     }
    289 
    290     if (WebConsoleAgent* consoleAgent = m_instrumentingAgents.webConsoleAgent()) {
    291         // FIXME: Send an enum to the frontend for localization?
    292         String warning = title.isEmpty() ? ASCIILiteral("No profiles exist") : makeString("Profile \"", title, "\" does not exist");
    293         consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::ProfileEnd, MessageLevel::Warning, warning));   
    294     }
     244void InspectorTimelineAgent::startFromConsole(JSC::ExecState*, const String&)
     245{
     246    // FIXME: <https://webkit.org/b/153499> Web Inspector: console.profile should use the new Sampling Profiler
     247}
     248
     249void InspectorTimelineAgent::stopFromConsole(JSC::ExecState*, const String&)
     250{
     251    // FIXME: <https://webkit.org/b/153499> Web Inspector: console.profile should use the new Sampling Profiler
    295252}
    296253
     
    449406    m_frontendDispatcher->autoCaptureStarted();
    450407
    451     toggleInstruments(InstrumentState::Start);
    452 }
    453 
    454 void InspectorTimelineAgent::startProgrammaticCapture()
    455 {
    456     ASSERT(!m_enabled);
    457 
    458     // Disable breakpoints during programmatic capture.
    459     if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents.inspectorDebuggerAgent()) {
    460         m_programmaticCaptureRestoreBreakpointActiveValue = debuggerAgent->breakpointsActive();
    461         if (m_programmaticCaptureRestoreBreakpointActiveValue) {
    462             ErrorString unused;
    463             debuggerAgent->setBreakpointsActive(unused, false);
    464         }
    465     } else
    466         m_programmaticCaptureRestoreBreakpointActiveValue = false;
    467 
    468     m_frontendDispatcher->programmaticCaptureStarted();
    469 
    470     toggleScriptProfilerInstrument(InstrumentState::Start); // Ensure JavaScript samping data.
    471     toggleTimelineInstrument(InstrumentState::Start); // Ensure Console Profile event records.
    472     toggleInstruments(InstrumentState::Start); // Any other instruments the frontend wants us to record.
    473 }
    474 
    475 void InspectorTimelineAgent::stopProgrammaticCapture()
    476 {
    477     ASSERT(m_enabled);
    478     ASSERT(!m_enabledFromFrontend);
    479 
    480     toggleInstruments(InstrumentState::Stop);
    481     toggleTimelineInstrument(InstrumentState::Stop);
    482     toggleScriptProfilerInstrument(InstrumentState::Stop);
    483 
    484     // Re-enable breakpoints if they were enabled.
    485     if (m_programmaticCaptureRestoreBreakpointActiveValue) {
    486         if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents.inspectorDebuggerAgent()) {
    487             ErrorString unused;
    488             debuggerAgent->setBreakpointsActive(unused, true);
    489         }
    490     }
    491 
    492     m_frontendDispatcher->programmaticCaptureStopped();
    493 }
    494 
    495 void InspectorTimelineAgent::toggleInstruments(InstrumentState state)
    496 {
     408    // Enable instruments.
    497409    for (auto instrumentType : m_instruments) {
    498410        switch (instrumentType) {
    499411        case Inspector::Protocol::Timeline::Instrument::ScriptProfiler: {
    500             toggleScriptProfilerInstrument(state);
     412            if (m_scriptProfilerAgent) {
     413                ErrorString unused;
     414                const bool includeSamples = true;
     415                m_scriptProfilerAgent->startTracking(unused, &includeSamples);
     416            }
    501417            break;
    502418        }
    503419        case Inspector::Protocol::Timeline::Instrument::Heap: {
    504             toggleHeapInstrument(state);
     420            if (m_heapAgent) {
     421                ErrorString unused;
     422                m_heapAgent->startTracking(unused);
     423            }
    505424            break;
    506425        }
    507426        case Inspector::Protocol::Timeline::Instrument::Memory: {
    508             toggleMemoryInstrument(state);
     427#if ENABLE(RESOURCE_USAGE)
     428            if (InspectorMemoryAgent* memoryAgent = m_instrumentingAgents.inspectorMemoryAgent()) {
     429                ErrorString unused;
     430                memoryAgent->startTracking(unused);
     431            }
     432#endif
    509433            break;
    510434        }
    511435        case Inspector::Protocol::Timeline::Instrument::Timeline:
    512             toggleTimelineInstrument(state);
     436            internalStart();
    513437            break;
    514438        }
    515439    }
    516 }
    517 
    518 void InspectorTimelineAgent::toggleScriptProfilerInstrument(InstrumentState state)
    519 {
    520     if (m_scriptProfilerAgent) {
    521         ErrorString unused;
    522         if (state == InstrumentState::Start) {
    523             const bool includeSamples = true;
    524             m_scriptProfilerAgent->startTracking(unused, &includeSamples);
    525         } else
    526             m_scriptProfilerAgent->stopTracking(unused);
    527     }
    528 }
    529 
    530 void InspectorTimelineAgent::toggleHeapInstrument(InstrumentState state)
    531 {
    532     if (m_heapAgent) {
    533         ErrorString unused;
    534         if (state == InstrumentState::Start)
    535             m_heapAgent->startTracking(unused);
    536         else
    537             m_heapAgent->stopTracking(unused);
    538     }
    539 }
    540 
    541 void InspectorTimelineAgent::toggleMemoryInstrument(InstrumentState state)
    542 {
    543 #if ENABLE(RESOURCE_USAGE)
    544     if (InspectorMemoryAgent* memoryAgent = m_instrumentingAgents.inspectorMemoryAgent()) {
    545         ErrorString unused;
    546         if (state == InstrumentState::Start)
    547             memoryAgent->startTracking(unused);
    548         else
    549             memoryAgent->stopTracking(unused);
    550     }
    551 #else
    552     UNUSED_PARAM(state);
    553 #endif
    554 }
    555 
    556 void InspectorTimelineAgent::toggleTimelineInstrument(InstrumentState state)
    557 {
    558     if (state == InstrumentState::Start)
    559         internalStart();
    560     else
    561         internalStop();
    562440}
    563441
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.h

    r202152 r202196  
    154154    void breakpointActionProbe(JSC::ExecState&, const Inspector::ScriptBreakpointAction&, unsigned batchId, unsigned sampleId, JSC::JSValue result) final;
    155155
    156     void startProgrammaticCapture();
    157     void stopProgrammaticCapture();
    158 
    159     enum class InstrumentState { Start, Stop };
    160     void toggleInstruments(InstrumentState);
    161     void toggleScriptProfilerInstrument(InstrumentState);
    162     void toggleHeapInstrument(InstrumentState);
    163     void toggleMemoryInstrument(InstrumentState);
    164     void toggleTimelineInstrument(InstrumentState);
    165     void disableBreakpoints();
    166     void enableBreakpoints();
    167 
    168156    friend class TimelineRecordStack;
    169157
     
    213201
    214202    Vector<TimelineRecordEntry> m_recordStack;
    215     Vector<TimelineRecordEntry> m_pendingConsoleProfileRecords;
    216203
    217204    int m_id { 1 };
     
    220207    bool m_enabled { false };
    221208    bool m_enabledFromFrontend { false };
    222     bool m_programmaticCaptureRestoreBreakpointActiveValue { false };
    223209
    224210    bool m_autoCaptureEnabled { false };
  • trunk/Source/WebInspectorUI/ChangeLog

    r202152 r202196  
     12016-06-17  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r202152.
     4        https://bugs.webkit.org/show_bug.cgi?id=158897
     5
     6        The new test is very unstable, timing out frequently
     7        (Requested by ap on #webkit).
     8
     9        Reverted changeset:
     10
     11        "Web Inspector: console.profile should use the new Sampling
     12        Profiler"
     13        https://bugs.webkit.org/show_bug.cgi?id=153499
     14        http://trac.webkit.org/changeset/202152
     15
    1162016-06-16  Joseph Pecoraro  <pecoraro@apple.com>
    217
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js

    r202152 r202196  
    263263    }
    264264
    265     autoCaptureStarted()
     265    autoCaptureStarted(startTime)
    266266    {
    267267        // Called from WebInspector.TimelineObserver.
     
    273273        // between sending the Timeline.start command and receiving Timeline.capturingStarted event.
    274274        // In that case, there is no need to call startCapturing again. Reuse the fresh recording.
    275         if (!this._waitingForCapturingStartedEvent) {
    276             const createNewRecording = true;
    277             this.startCapturing(createNewRecording);
    278         }
     275        if (!this._waitingForCapturingStartedEvent)
     276            this.startCapturing(true);
    279277
    280278        this._shouldSetAutoCapturingMainResource = true;
    281     }
    282 
    283     programmaticCaptureStarted()
    284     {
    285         // Called from WebInspector.TimelineObserver.
    286 
    287         this._activeRecording.addScriptInstrumentForProgrammaticCapture();
    288 
    289         const createNewRecording = false;
    290         this.startCapturing(createNewRecording);
    291     }
    292 
    293     programmaticCaptureStopped()
    294     {
    295         // Called from WebInspector.TimelineObserver.
    296 
    297         // FIXME: This is purely to avoid a noisy assert. Previously
    298         // it was impossible to stop without stopping from the UI.
    299         console.assert(!this._isCapturing);
    300         this._isCapturing = true;
    301 
    302         this.stopCapturing();
    303279    }
    304280
     
    510486        case TimelineAgent.EventType.ConsoleProfile:
    511487            var profileData = recordPayload.data.profile;
    512             // COMPATIBILITY (iOS 9): With the Sampling Profiler, profiles no longer include legacy profile data.
    513             console.assert(profileData || TimelineAgent.setInstruments);
     488            console.assert(profileData);
    514489            return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.ConsoleProfileRecorded, startTime, endTime, callFrames, sourceCodeLocation, recordPayload.data.title, profileData);
    515490
     
    858833            return WebInspector.ScriptTimelineRecord.EventType.ScriptEvaluated;
    859834        }
    860     }
    861 
    862     scriptProfilerProgrammaticCaptureStarted()
    863     {
    864         // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection
    865         console.assert(WebInspector.debuggableType === WebInspector.DebuggableType.JavaScript);
    866         console.assert(!this._isCapturing);
    867 
    868         this.programmaticCaptureStarted();
    869     }
    870 
    871     scriptProfilerProgrammaticCaptureStopped()
    872     {
    873         // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection
    874         console.assert(WebInspector.debuggableType === WebInspector.DebuggableType.JavaScript);
    875         console.assert(this._isCapturing);
    876 
    877         this.programmaticCaptureStopped();
    878835    }
    879836
  • trunk/Source/WebInspectorUI/UserInterface/Models/ScriptInstrument.js

    r202152 r202196  
    5757        ScriptProfilerAgent.stopTracking();
    5858    }
     59
    5960};
  • trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js

    r202152 r202196  
    128128    }
    129129
    130     stop(programmatic)
     130    stop()
    131131    {
    132132        console.assert(this._capturing, "Attempted to stop an already stopped session.");
     
    135135        this._capturing = false;
    136136
    137         if (!programmatic) {
    138             for (let instrument of this._instruments)
    139                 instrument.stopInstrumentation();
    140         }
     137        for (let instrument of this._instruments)
     138            instrument.stopInstrumentation();
    141139    }
    142140
     
    308306    {
    309307        return this._discontinuities.filter((item) => item.startTime < endTime && item.endTime > startTime);
    310     }
    311 
    312     addScriptInstrumentForProgrammaticCapture()
    313     {
    314         for (let instrument of this._instruments) {
    315             if (instrument instanceof WebInspector.ScriptInstrument)
    316                 return;
    317         }
    318 
    319         this.addInstrument(new WebInspector.ScriptInstrument);
    320 
    321         let instrumentTypes = this._instruments.map((instrument) => instrument.timelineRecordType);
    322         WebInspector.timelineManager.enabledTimelineTypes = instrumentTypes;
    323308    }
    324309
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/ScriptProfilerObserver.js

    r202152 r202196  
    4242        WebInspector.timelineManager.scriptProfilerTrackingCompleted(samples);
    4343    }
    44    
    45     programmaticCaptureStarted()
    46     {
    47         WebInspector.timelineManager.scriptProfilerProgrammaticCaptureStarted();
    48     }
    49 
    50     programmaticCaptureStopped()
    51     {
    52         WebInspector.timelineManager.scriptProfilerProgrammaticCaptureStopped();
    53     }
    5444};
  • trunk/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js

    r202152 r202196  
    4747        WebInspector.timelineManager.autoCaptureStarted();
    4848    }
    49 
    50     programmaticCaptureStarted()
    51     {
    52         WebInspector.timelineManager.programmaticCaptureStarted();
    53     }
    54 
    55     programmaticCaptureStopped()
    56     {
    57         WebInspector.timelineManager.programmaticCaptureStopped();
    58     }
    5949};
Note: See TracChangeset for help on using the changeset viewer.