Title: [202072] trunk
Revision
202072
Author
commit-qu...@webkit.org
Date
2016-06-14 17:42:51 -0700 (Tue, 14 Jun 2016)

Log Message

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

Patch by Joseph Pecoraro <pecor...@apple.com> on 2016-06-14
Reviewed by Timothy Hatcher.

Source/_javascript_Core:

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.

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (202071 => 202072)


--- trunk/LayoutTests/ChangeLog	2016-06-14 23:38:32 UTC (rev 202071)
+++ trunk/LayoutTests/ChangeLog	2016-06-15 00:42:51 UTC (rev 202072)
@@ -1,3 +1,13 @@
+2016-06-14  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Rename Timeline.setAutoCaptureInstruments to Timeline.setInstruments
+        https://bugs.webkit.org/show_bug.cgi?id=158762
+
+        Reviewed by Timothy Hatcher.
+
+        * 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.
+
 2016-06-14  Dean Jackson  <d...@apple.com>
 
         decompose4 return value is unchecked, leading to potentially uninitialized data.

Deleted: trunk/LayoutTests/inspector/timeline/setAutoCaptureInstruments-errors-expected.txt (202071 => 202072)


--- trunk/LayoutTests/inspector/timeline/setAutoCaptureInstruments-errors-expected.txt	2016-06-14 23:38:32 UTC (rev 202071)
+++ trunk/LayoutTests/inspector/timeline/setAutoCaptureInstruments-errors-expected.txt	2016-06-15 00:42:51 UTC (rev 202072)
@@ -1,16 +0,0 @@
-Tests for error cases with Timeline.setAutoCaptureInstruments.
-
-
-== Running test suite: Timeline.setAutoCaptureInstruments.errors
--- Running test case: MissingRequiredArgument
-PASS: Should be an error: Some arguments of method 'Timeline.setAutoCaptureInstruments' can't be processed
-
--- Running test case: InvalidTypeInInstrumentsList
-PASS: Should be an error: Unexpected type in instruments list, should be string
-
--- Running test case: InvalidInstrumentInInstrumentsList
-PASS: Should be an error: Unexpected enum value: NoSuchInstrument
-
--- Running test case: ValidInstrumentInInstrumentsList
-PASS: Should not be an error setting valid instruments.
-

Deleted: trunk/LayoutTests/inspector/timeline/setAutoCaptureInstruments-errors.html (202071 => 202072)


--- trunk/LayoutTests/inspector/timeline/setAutoCaptureInstruments-errors.html	2016-06-14 23:38:32 UTC (rev 202071)
+++ trunk/LayoutTests/inspector/timeline/setAutoCaptureInstruments-errors.html	2016-06-15 00:42:51 UTC (rev 202072)
@@ -1,60 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script>
-function test()
-{
-    let suite = ProtocolTest.createAsyncSuite("Timeline.setAutoCaptureInstruments.errors");
-
-    ProtocolTest.dumpActivityToSystemConsole = true;
-    ProtocolTest.dumpInspectorProtocolMessages = true;
-
-    suite.addTestCase({
-        name: "MissingRequiredArgument",
-        test: (resolve, reject) => {
-            InspectorProtocol.sendCommand("Timeline.setAutoCaptureInstruments", {}, (messageObject) => {
-                ProtocolTest.expectThat(messageObject.error, `Should be an error: ${messageObject.error ? messageObject.error.message : ""}`);
-                resolve();
-            });
-        }
-    });
-
-    suite.addTestCase({
-        name: "InvalidTypeInInstrumentsList",
-        test: (resolve, reject) => {
-            InspectorProtocol.sendCommand("Timeline.setAutoCaptureInstruments", {"instruments": [123]}, (messageObject) => {
-                ProtocolTest.expectThat(messageObject.error, `Should be an error: ${messageObject.error ? messageObject.error.message : ""}`);
-                resolve();
-            });
-        }
-    });
-
-    suite.addTestCase({
-        name: "InvalidInstrumentInInstrumentsList",
-        test: (resolve, reject) => {
-            InspectorProtocol.sendCommand("Timeline.setAutoCaptureInstruments", {"instruments": ["NoSuchInstrument"]}, (messageObject) => {
-                ProtocolTest.expectThat(messageObject.error, `Should be an error: ${messageObject.error ? messageObject.error.message : ""}`);
-                resolve();
-            });
-        }
-    });
-
-    suite.addTestCase({
-        name: "ValidInstrumentInInstrumentsList",
-        test: (resolve, reject) => {
-            InspectorProtocol.sendCommand("Timeline.setAutoCaptureInstruments", {"instruments": ["ScriptProfiler", "Heap", "Timeline", "Memory"]}, (messageObject) => {
-                ProtocolTest.expectThat(!messageObject.error, "Should not be an error setting valid instruments.");
-                resolve();
-            });
-        }
-    });
-
-    suite.runTestCasesAndFinish();
-}
-</script>
-</head>
-<body _onload_="runTest()">
-<p>Tests for error cases with Timeline.setAutoCaptureInstruments.</p>
-</body>
-</html>

Copied: trunk/LayoutTests/inspector/timeline/setInstruments-errors-expected.txt (from rev 202071, trunk/LayoutTests/inspector/timeline/setAutoCaptureInstruments-errors-expected.txt) (0 => 202072)


--- trunk/LayoutTests/inspector/timeline/setInstruments-errors-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/inspector/timeline/setInstruments-errors-expected.txt	2016-06-15 00:42:51 UTC (rev 202072)
@@ -0,0 +1,16 @@
+Tests for error cases with Timeline.setInstruments.
+
+
+== Running test suite: Timeline.setInstruments.errors
+-- Running test case: MissingRequiredArgument
+PASS: Should be an error: Some arguments of method 'Timeline.setInstruments' can't be processed
+
+-- Running test case: InvalidTypeInInstrumentsList
+PASS: Should be an error: Unexpected type in instruments list, should be string
+
+-- Running test case: InvalidInstrumentInInstrumentsList
+PASS: Should be an error: Unexpected enum value: NoSuchInstrument
+
+-- Running test case: ValidInstrumentInInstrumentsList
+PASS: Should not be an error setting valid instruments.
+

Copied: trunk/LayoutTests/inspector/timeline/setInstruments-errors.html (from rev 202071, trunk/LayoutTests/inspector/timeline/setAutoCaptureInstruments-errors.html) (0 => 202072)


--- trunk/LayoutTests/inspector/timeline/setInstruments-errors.html	                        (rev 0)
+++ trunk/LayoutTests/inspector/timeline/setInstruments-errors.html	2016-06-15 00:42:51 UTC (rev 202072)
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+function test()
+{
+    let suite = ProtocolTest.createAsyncSuite("Timeline.setInstruments.errors");
+
+    suite.addTestCase({
+        name: "MissingRequiredArgument",
+        test: (resolve, reject) => {
+            InspectorProtocol.sendCommand("Timeline.setInstruments", {}, (messageObject) => {
+                ProtocolTest.expectThat(messageObject.error, `Should be an error: ${messageObject.error ? messageObject.error.message : ""}`);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: "InvalidTypeInInstrumentsList",
+        test: (resolve, reject) => {
+            InspectorProtocol.sendCommand("Timeline.setInstruments", {"instruments": [123]}, (messageObject) => {
+                ProtocolTest.expectThat(messageObject.error, `Should be an error: ${messageObject.error ? messageObject.error.message : ""}`);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: "InvalidInstrumentInInstrumentsList",
+        test: (resolve, reject) => {
+            InspectorProtocol.sendCommand("Timeline.setInstruments", {"instruments": ["NoSuchInstrument"]}, (messageObject) => {
+                ProtocolTest.expectThat(messageObject.error, `Should be an error: ${messageObject.error ? messageObject.error.message : ""}`);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: "ValidInstrumentInInstrumentsList",
+        test: (resolve, reject) => {
+            InspectorProtocol.sendCommand("Timeline.setInstruments", {"instruments": ["ScriptProfiler", "Heap", "Timeline", "Memory"]}, (messageObject) => {
+                ProtocolTest.expectThat(!messageObject.error, "Should not be an error setting valid instruments.");
+                resolve();
+            });
+        }
+    });
+
+    suite.runTestCasesAndFinish();
+}
+</script>
+</head>
+<body _onload_="runTest()">
+<p>Tests for error cases with Timeline.setInstruments.</p>
+</body>
+</html>

Modified: trunk/Source/_javascript_Core/ChangeLog (202071 => 202072)


--- trunk/Source/_javascript_Core/ChangeLog	2016-06-14 23:38:32 UTC (rev 202071)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-06-15 00:42:51 UTC (rev 202072)
@@ -1,3 +1,16 @@
+2016-06-14  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Rename Timeline.setAutoCaptureInstruments to Timeline.setInstruments
+        https://bugs.webkit.org/show_bug.cgi?id=158762
+
+        Reviewed by Timothy Hatcher.
+
+        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:
+
 2016-06-14  David Kilzer  <ddkil...@apple.com>
 
         Document the native format of JSChar type

Modified: trunk/Source/_javascript_Core/inspector/protocol/Timeline.json (202071 => 202072)


--- trunk/Source/_javascript_Core/inspector/protocol/Timeline.json	2016-06-14 23:38:32 UTC (rev 202071)
+++ trunk/Source/_javascript_Core/inspector/protocol/Timeline.json	2016-06-15 00:42:51 UTC (rev 202072)
@@ -73,8 +73,8 @@
             ]
         },
         {
-            "name": "setAutoCaptureInstruments",
-            "description": "Instruments to enable when an auto capture starts.",
+            "name": "setInstruments",
+            "description": "Instruments to enable when capture starts on the backend (e.g. auto capture or programmatic capture).",
             "parameters": [
                 { "name": "instruments", "type": "array", "items": { "$ref": "Instrument" }, "description": "Instruments to enable." }
             ]

Modified: trunk/Source/WebCore/ChangeLog (202071 => 202072)


--- trunk/Source/WebCore/ChangeLog	2016-06-14 23:38:32 UTC (rev 202071)
+++ trunk/Source/WebCore/ChangeLog	2016-06-15 00:42:51 UTC (rev 202072)
@@ -1,3 +1,19 @@
+2016-06-14  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Rename Timeline.setAutoCaptureInstruments to Timeline.setInstruments
+        https://bugs.webkit.org/show_bug.cgi?id=158762
+
+        Reviewed by Timothy Hatcher.
+
+        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:
+
 2016-06-14  Dean Jackson  <d...@apple.com>
 
         decompose4 return value is unchecked, leading to potentially uninitialized data.

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (202071 => 202072)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2016-06-14 23:38:32 UTC (rev 202071)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2016-06-15 00:42:51 UTC (rev 202072)
@@ -107,7 +107,7 @@
     stop(unused);
 
     m_autoCaptureEnabled = false;
-    m_autoCaptureInstruments.clear();
+    m_instruments.clear();
 }
 
 void InspectorTimelineAgent::start(ErrorString&, const int* maxCallStackDepth)
@@ -129,7 +129,7 @@
     m_autoCaptureEnabled = enabled;
 }
 
-void InspectorTimelineAgent::setAutoCaptureInstruments(ErrorString& errorString, const InspectorArray& instruments)
+void InspectorTimelineAgent::setInstruments(ErrorString& errorString, const InspectorArray& instruments)
 {
     Vector<Protocol::Timeline::Instrument> newInstruments;
     newInstruments.reserveCapacity(instruments.length());
@@ -150,7 +150,7 @@
         newInstruments.uncheckedAppend(*instrumentType);
     }
 
-    m_autoCaptureInstruments.swap(newInstruments);
+    m_instruments.swap(newInstruments);
 }
 
 void InspectorTimelineAgent::internalStart(const int* maxCallStackDepth)
@@ -393,7 +393,7 @@
     if (!m_autoCaptureEnabled)
         return;
 
-    if (m_autoCaptureInstruments.isEmpty())
+    if (m_instruments.isEmpty())
         return;
 
     // Pre-emptively disable breakpoints. The frontend must re-enable them.
@@ -406,7 +406,7 @@
     m_frontendDispatcher->autoCaptureStarted();
 
     // Enable instruments.
-    for (auto instrumentType : m_autoCaptureInstruments) {
+    for (auto instrumentType : m_instruments) {
         switch (instrumentType) {
         case Inspector::Protocol::Timeline::Instrument::ScriptProfiler: {
             if (m_scriptProfilerAgent) {

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (202071 => 202072)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2016-06-14 23:38:32 UTC (rev 202071)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2016-06-15 00:42:51 UTC (rev 202072)
@@ -102,7 +102,7 @@
     void start(ErrorString&, const int* maxCallStackDepth = nullptr) final;
     void stop(ErrorString&) final;
     void setAutoCaptureEnabled(ErrorString&, bool) final;
-    void setAutoCaptureInstruments(ErrorString&, const Inspector::InspectorArray&) final;
+    void setInstruments(ErrorString&, const Inspector::InspectorArray&) final;
 
     int id() const { return m_id; }
 
@@ -208,7 +208,7 @@
     bool m_enabledFromFrontend { false };
 
     bool m_autoCaptureEnabled { false };
-    Vector<Inspector::Protocol::Timeline::Instrument> m_autoCaptureInstruments;
+    Vector<Inspector::Protocol::Timeline::Instrument> m_instruments;
 
 #if PLATFORM(COCOA)
     std::unique_ptr<WebCore::RunLoopObserver> m_frameStartObserver;

Modified: trunk/Source/WebInspectorUI/ChangeLog (202071 => 202072)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-06-14 23:38:32 UTC (rev 202071)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-06-15 00:42:51 UTC (rev 202072)
@@ -1,3 +1,14 @@
+2016-06-14  Joseph Pecoraro  <pecor...@apple.com>
+
+        Web Inspector: Rename Timeline.setAutoCaptureInstruments to Timeline.setInstruments
+        https://bugs.webkit.org/show_bug.cgi?id=158762
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Controllers/TimelineManager.js:
+        (WebInspector.TimelineManager.prototype._updateAutoCaptureInstruments):
+        (WebInspector.TimelineManager):
+
 2016-06-14  Benjamin Poulain  <bpoul...@apple.com>
 
         Add the unprefixed version of the pseudo element ::placeholder

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (202071 => 202072)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js	2016-06-14 23:38:32 UTC (rev 202071)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js	2016-06-15 00:42:51 UTC (rev 202072)
@@ -990,7 +990,7 @@
         if (!window.TimelineAgent)
             return;
 
-        if (!TimelineAgent.setAutoCaptureInstruments)
+        if (!TimelineAgent.setInstruments)
             return;
 
         let instrumentSet = new Set;
@@ -1015,7 +1015,7 @@
             }
         }
 
-        TimelineAgent.setAutoCaptureInstruments([...instrumentSet]);
+        TimelineAgent.setInstruments([...instrumentSet]);
     }
 };
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to