Changeset 202072 in webkit


Ignore:
Timestamp:
Jun 14, 2016 5:42:51 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Rename Timeline.setAutoCaptureInstruments to Timeline.setInstruments
https://bugs.webkit.org/show_bug.cgi?id=158762

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2016-06-14
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Rename the protocol methods since the backend may use the instruments
for purposes other then auto-capture, such as programmatic capture
via console.profile.

  • inspector/protocol/Timeline.json:

Source/WebCore:

Test: inspector/timeline/setInstruments-errors.html

  • inspector/InspectorTimelineAgent.cpp:

(WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorTimelineAgent::setInstruments):
(WebCore::InspectorTimelineAgent::mainFrameStartedLoading):
(WebCore::InspectorTimelineAgent::setAutoCaptureInstruments): Deleted.

  • inspector/InspectorTimelineAgent.h:

Source/WebInspectorUI:

  • UserInterface/Controllers/TimelineManager.js:

(WebInspector.TimelineManager.prototype._updateAutoCaptureInstruments):
(WebInspector.TimelineManager):

LayoutTests:

  • inspector/timeline/setInstruments-errors-expected.txt: Renamed from LayoutTests/inspector/timeline/setAutoCaptureInstruments-errors-expected.txt.
  • inspector/timeline/setInstruments-errors.html: Renamed from LayoutTests/inspector/timeline/setAutoCaptureInstruments-errors.html.
Location:
trunk
Files:
8 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r202068 r202072  
     12016-06-14  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Rename Timeline.setAutoCaptureInstruments to Timeline.setInstruments
     4        https://bugs.webkit.org/show_bug.cgi?id=158762
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * inspector/timeline/setInstruments-errors-expected.txt: Renamed from LayoutTests/inspector/timeline/setAutoCaptureInstruments-errors-expected.txt.
     9        * inspector/timeline/setInstruments-errors.html: Renamed from LayoutTests/inspector/timeline/setAutoCaptureInstruments-errors.html.
     10
    1112016-06-14  Dean Jackson  <dino@apple.com>
    212
  • trunk/LayoutTests/inspector/timeline/setInstruments-errors-expected.txt

    r202071 r202072  
    1 Tests for error cases with Timeline.setAutoCaptureInstruments.
     1Tests for error cases with Timeline.setInstruments.
    22
    33
    4 == Running test suite: Timeline.setAutoCaptureInstruments.errors
     4== Running test suite: Timeline.setInstruments.errors
    55-- Running test case: MissingRequiredArgument
    6 PASS: Should be an error: Some arguments of method 'Timeline.setAutoCaptureInstruments' can't be processed
     6PASS: Should be an error: Some arguments of method 'Timeline.setInstruments' can't be processed
    77
    88-- Running test case: InvalidTypeInInstrumentsList
  • trunk/LayoutTests/inspector/timeline/setInstruments-errors.html

    r202071 r202072  
    66function test()
    77{
    8     let suite = ProtocolTest.createAsyncSuite("Timeline.setAutoCaptureInstruments.errors");
    9 
    10     ProtocolTest.dumpActivityToSystemConsole = true;
    11     ProtocolTest.dumpInspectorProtocolMessages = true;
     8    let suite = ProtocolTest.createAsyncSuite("Timeline.setInstruments.errors");
    129
    1310    suite.addTestCase({
    1411        name: "MissingRequiredArgument",
    1512        test: (resolve, reject) => {
    16             InspectorProtocol.sendCommand("Timeline.setAutoCaptureInstruments", {}, (messageObject) => {
     13            InspectorProtocol.sendCommand("Timeline.setInstruments", {}, (messageObject) => {
    1714                ProtocolTest.expectThat(messageObject.error, `Should be an error: ${messageObject.error ? messageObject.error.message : ""}`);
    1815                resolve();
     
    2421        name: "InvalidTypeInInstrumentsList",
    2522        test: (resolve, reject) => {
    26             InspectorProtocol.sendCommand("Timeline.setAutoCaptureInstruments", {"instruments": [123]}, (messageObject) => {
     23            InspectorProtocol.sendCommand("Timeline.setInstruments", {"instruments": [123]}, (messageObject) => {
    2724                ProtocolTest.expectThat(messageObject.error, `Should be an error: ${messageObject.error ? messageObject.error.message : ""}`);
    2825                resolve();
     
    3431        name: "InvalidInstrumentInInstrumentsList",
    3532        test: (resolve, reject) => {
    36             InspectorProtocol.sendCommand("Timeline.setAutoCaptureInstruments", {"instruments": ["NoSuchInstrument"]}, (messageObject) => {
     33            InspectorProtocol.sendCommand("Timeline.setInstruments", {"instruments": ["NoSuchInstrument"]}, (messageObject) => {
    3734                ProtocolTest.expectThat(messageObject.error, `Should be an error: ${messageObject.error ? messageObject.error.message : ""}`);
    3835                resolve();
     
    4441        name: "ValidInstrumentInInstrumentsList",
    4542        test: (resolve, reject) => {
    46             InspectorProtocol.sendCommand("Timeline.setAutoCaptureInstruments", {"instruments": ["ScriptProfiler", "Heap", "Timeline", "Memory"]}, (messageObject) => {
     43            InspectorProtocol.sendCommand("Timeline.setInstruments", {"instruments": ["ScriptProfiler", "Heap", "Timeline", "Memory"]}, (messageObject) => {
    4744                ProtocolTest.expectThat(!messageObject.error, "Should not be an error setting valid instruments.");
    4845                resolve();
     
    5653</head>
    5754<body onload="runTest()">
    58 <p>Tests for error cases with Timeline.setAutoCaptureInstruments.</p>
     55<p>Tests for error cases with Timeline.setInstruments.</p>
    5956</body>
    6057</html>
  • trunk/Source/JavaScriptCore/ChangeLog

    r202069 r202072  
     12016-06-14  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Rename Timeline.setAutoCaptureInstruments to Timeline.setInstruments
     4        https://bugs.webkit.org/show_bug.cgi?id=158762
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        Rename the protocol methods since the backend may use the instruments
     9        for purposes other then auto-capture, such as programmatic capture
     10        via console.profile.
     11
     12        * inspector/protocol/Timeline.json:
     13
    1142016-06-14  David Kilzer  <ddkilzer@apple.com>
    215
  • trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json

    r201237 r202072  
    7474        },
    7575        {
    76             "name": "setAutoCaptureInstruments",
    77             "description": "Instruments to enable when an auto capture starts.",
     76            "name": "setInstruments",
     77            "description": "Instruments to enable when capture starts on the backend (e.g. auto capture or programmatic capture).",
    7878            "parameters": [
    7979                { "name": "instruments", "type": "array", "items": { "$ref": "Instrument" }, "description": "Instruments to enable." }
  • trunk/Source/WebCore/ChangeLog

    r202068 r202072  
     12016-06-14  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Rename Timeline.setAutoCaptureInstruments to Timeline.setInstruments
     4        https://bugs.webkit.org/show_bug.cgi?id=158762
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        Test: inspector/timeline/setInstruments-errors.html
     9
     10        * inspector/InspectorTimelineAgent.cpp:
     11        (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
     12        (WebCore::InspectorTimelineAgent::setInstruments):
     13        (WebCore::InspectorTimelineAgent::mainFrameStartedLoading):
     14        (WebCore::InspectorTimelineAgent::setAutoCaptureInstruments): Deleted.
     15        * inspector/InspectorTimelineAgent.h:
     16
    1172016-06-14  Dean Jackson  <dino@apple.com>
    218
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp

    r201237 r202072  
    108108
    109109    m_autoCaptureEnabled = false;
    110     m_autoCaptureInstruments.clear();
     110    m_instruments.clear();
    111111}
    112112
     
    130130}
    131131
    132 void InspectorTimelineAgent::setAutoCaptureInstruments(ErrorString& errorString, const InspectorArray& instruments)
     132void InspectorTimelineAgent::setInstruments(ErrorString& errorString, const InspectorArray& instruments)
    133133{
    134134    Vector<Protocol::Timeline::Instrument> newInstruments;
     
    151151    }
    152152
    153     m_autoCaptureInstruments.swap(newInstruments);
     153    m_instruments.swap(newInstruments);
    154154}
    155155
     
    394394        return;
    395395
    396     if (m_autoCaptureInstruments.isEmpty())
     396    if (m_instruments.isEmpty())
    397397        return;
    398398
     
    407407
    408408    // Enable instruments.
    409     for (auto instrumentType : m_autoCaptureInstruments) {
     409    for (auto instrumentType : m_instruments) {
    410410        switch (instrumentType) {
    411411        case Inspector::Protocol::Timeline::Instrument::ScriptProfiler: {
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.h

    r201237 r202072  
    103103    void stop(ErrorString&) final;
    104104    void setAutoCaptureEnabled(ErrorString&, bool) final;
    105     void setAutoCaptureInstruments(ErrorString&, const Inspector::InspectorArray&) final;
     105    void setInstruments(ErrorString&, const Inspector::InspectorArray&) final;
    106106
    107107    int id() const { return m_id; }
     
    209209
    210210    bool m_autoCaptureEnabled { false };
    211     Vector<Inspector::Protocol::Timeline::Instrument> m_autoCaptureInstruments;
     211    Vector<Inspector::Protocol::Timeline::Instrument> m_instruments;
    212212
    213213#if PLATFORM(COCOA)
  • trunk/Source/WebInspectorUI/ChangeLog

    r202066 r202072  
     12016-06-14  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: Rename Timeline.setAutoCaptureInstruments to Timeline.setInstruments
     4        https://bugs.webkit.org/show_bug.cgi?id=158762
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Controllers/TimelineManager.js:
     9        (WebInspector.TimelineManager.prototype._updateAutoCaptureInstruments):
     10        (WebInspector.TimelineManager):
     11
    1122016-06-14  Benjamin Poulain  <bpoulain@apple.com>
    213
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js

    r202010 r202072  
    991991            return;
    992992
    993         if (!TimelineAgent.setAutoCaptureInstruments)
     993        if (!TimelineAgent.setInstruments)
    994994            return;
    995995
     
    10161016        }
    10171017
    1018         TimelineAgent.setAutoCaptureInstruments([...instrumentSet]);
     1018        TimelineAgent.setInstruments([...instrumentSet]);
    10191019    }
    10201020};
Note: See TracChangeset for help on using the changeset viewer.