Title: [202196] trunk
Revision
202196
Author
[email protected]
Date
2016-06-17 20:33:19 -0700 (Fri, 17 Jun 2016)

Log 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

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (202195 => 202196)


--- trunk/LayoutTests/ChangeLog	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/LayoutTests/ChangeLog	2016-06-18 03:33:19 UTC (rev 202196)
@@ -1,5 +1,20 @@
 2016-06-17  Commit Queue  <[email protected]>
 
+        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
+
+2016-06-17  Commit Queue  <[email protected]>
+
         Unreviewed, rolling out r202068, r202115, and r202128.
         https://bugs.webkit.org/show_bug.cgi?id=158896
 

Deleted: trunk/LayoutTests/inspector/timeline/setInstruments-programmatic-capture-expected.txt (202195 => 202196)


--- trunk/LayoutTests/inspector/timeline/setInstruments-programmatic-capture-expected.txt	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/LayoutTests/inspector/timeline/setInstruments-programmatic-capture-expected.txt	2016-06-18 03:33:19 UTC (rev 202196)
@@ -1,26 +0,0 @@
-CONSOLE MESSAGE: line 8: Inside NoInstrumentsProgrammaticCapture profile
-CONSOLE MESSAGE: line 8: Inside MultipleInstrumentsProgrammaticCapture profile
-CONSOLE MESSAGE: line 8: Inside NoInstrumentsProgrammaticCaptureAgain profile
-Tests programmatic capture (console.profile/profileEnd) automatically starts instruments set via Timeline.setInstruments.
-
-
-== Running test suite: Timeline.setInstruments.programmatic-capture
--- Running test case: NoInstrumentsProgrammaticCapture
-PASS: Should not be an error setting valid instruments.
-PASS: Timeline.programmaticCaptureStarted
-PASS: ScriptProfiler.startTracking
-PASS: Timeline.programmaticCaptureStopped
-
--- Running test case: MultipleInstrumentsProgrammaticCapture
-PASS: Should not be an error setting valid instruments.
-PASS: Timeline.programmaticCaptureStarted
-PASS: ScriptProfiler.startTracking
-PASS: Heap.trackingStart
-PASS: Timeline.programmaticCaptureStopped
-
--- Running test case: NoInstrumentsProgrammaticCaptureAgain
-PASS: Should not be an error setting valid instruments.
-PASS: Timeline.programmaticCaptureStarted
-PASS: ScriptProfiler.startTracking
-PASS: Timeline.programmaticCaptureStopped
-

Deleted: trunk/LayoutTests/inspector/timeline/setInstruments-programmatic-capture.html (202195 => 202196)


--- trunk/LayoutTests/inspector/timeline/setInstruments-programmatic-capture.html	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/LayoutTests/inspector/timeline/setInstruments-programmatic-capture.html	2016-06-18 03:33:19 UTC (rev 202196)
@@ -1,84 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script src=""
-<script>
-function triggerProgrammaticCapture(message) {
-    console.profile();
-    console.log(`Inside ${message} profile`);
-    console.profileEnd();
-}
-
-function test()
-{
-    let suite = ProtocolTest.createAsyncSuite("Timeline.setInstruments.programmatic-capture");
-
-    let heapExpected = false;
-    let programmaticCaptureStopped = null;
-
-    InspectorProtocol.eventHandler["Timeline.programmaticCaptureStarted"] = () => {
-        ProtocolTest.pass("Timeline.programmaticCaptureStarted");
-    };
-    InspectorProtocol.eventHandler["Timeline.programmaticCaptureStopped"] = () => {
-        ProtocolTest.pass("Timeline.programmaticCaptureStopped");
-        programmaticCaptureStopped();
-    };
-
-    InspectorProtocol.eventHandler["ScriptProfiler.trackingStart"] = () => {
-        ProtocolTest.pass("ScriptProfiler.startTracking");
-    };
-
-    InspectorProtocol.eventHandler["Heap.trackingStart"] = () => {
-        if (heapExpected)
-            ProtocolTest.pass("Heap.trackingStart");
-        else
-            ProtocolTest.fail("Unexpected Heap.trackingStart");
-    };
-
-    suite.addTestCase({
-        name: "NoInstrumentsProgrammaticCapture",
-        test: (resolve, reject) => {
-            heapExpected = false;
-            programmaticCaptureStopped = resolve;
-
-            InspectorProtocol.sendCommand("Timeline.setInstruments", {instruments: []}, (messageObject) => {
-                ProtocolTest.expectThat(!messageObject.error, "Should not be an error setting valid instruments.");
-            });
-            ProtocolTest.evaluateInPage("triggerProgrammaticCapture('NoInstrumentsProgrammaticCapture')");
-        }
-    });
-
-    suite.addTestCase({
-        name: "MultipleInstrumentsProgrammaticCapture",
-        test: (resolve, reject) => {
-            heapExpected = true;
-            programmaticCaptureStopped = resolve;
-
-            InspectorProtocol.sendCommand("Timeline.setInstruments", {instruments: ["ScriptProfiler", "Heap"]}, (messageObject) => {
-                ProtocolTest.expectThat(!messageObject.error, "Should not be an error setting valid instruments.");
-            });
-            ProtocolTest.evaluateInPage("triggerProgrammaticCapture('MultipleInstrumentsProgrammaticCapture')");
-        }
-    });
-
-    suite.addTestCase({
-        name: "NoInstrumentsProgrammaticCaptureAgain",
-        test: (resolve, reject) => {
-            heapExpected = true;
-            programmaticCaptureStopped = resolve;
-
-            InspectorProtocol.sendCommand("Timeline.setInstruments", {instruments: []}, (messageObject) => {
-                ProtocolTest.expectThat(!messageObject.error, "Should not be an error setting valid instruments.");
-            });
-            ProtocolTest.evaluateInPage("triggerProgrammaticCapture('NoInstrumentsProgrammaticCaptureAgain')");
-        }
-    });
-
-    suite.runTestCasesAndFinish();
-}
-</script>
-</head>
-<body _onload_="runTest()">
-<p>Tests programmatic capture (console.profile/profileEnd) automatically starts instruments set via Timeline.setInstruments.</p>
-</body>
-</html>

Modified: trunk/Source/_javascript_Core/ChangeLog (202195 => 202196)


--- trunk/Source/_javascript_Core/ChangeLog	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-06-18 03:33:19 UTC (rev 202196)
@@ -1,3 +1,18 @@
+2016-06-17  Commit Queue  <[email protected]>
+
+        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
+
 2016-06-14  Filip Pizlo  <[email protected]>
 
         Baseline JIT should be concurrent

Modified: trunk/Source/_javascript_Core/debugger/Debugger.h (202195 => 202196)


--- trunk/Source/_javascript_Core/debugger/Debugger.h	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/_javascript_Core/debugger/Debugger.h	2016-06-18 03:33:19 UTC (rev 202196)
@@ -78,7 +78,6 @@
     void clearBreakpoints();
     void activateBreakpoints() { setBreakpointsActivated(true); }
     void deactivateBreakpoints() { setBreakpointsActivated(false); }
-    bool breakpointsActive() const { return m_breakpointsActivated; }
 
     enum PauseOnExceptionsState {
         DontPauseOnExceptions,

Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.cpp (202195 => 202196)


--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.cpp	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.cpp	2016-06-18 03:33:19 UTC (rev 202196)
@@ -28,8 +28,6 @@
 
 #include "ConsoleMessage.h"
 #include "InspectorConsoleAgent.h"
-#include "InspectorDebuggerAgent.h"
-#include "InspectorScriptProfilerAgent.h"
 #include "ScriptArguments.h"
 #include "ScriptCallStack.h"
 #include "ScriptCallStackFactory.h"
@@ -54,11 +52,9 @@
     sLogToSystemConsole = shouldLog;
 }
 
-JSGlobalObjectConsoleClient::JSGlobalObjectConsoleClient(InspectorConsoleAgent* consoleAgent, InspectorDebuggerAgent* debuggerAgent, InspectorScriptProfilerAgent* scriptProfilerAgent)
+JSGlobalObjectConsoleClient::JSGlobalObjectConsoleClient(InspectorConsoleAgent* consoleAgent)
     : ConsoleClient()
     , m_consoleAgent(consoleAgent)
-    , m_debuggerAgent(debuggerAgent)
-    , m_scriptProfilerAgent(scriptProfilerAgent)
 {
 }
 
@@ -77,73 +73,16 @@
     m_consoleAgent->count(exec, arguments);
 }
 
-void JSGlobalObjectConsoleClient::profile(JSC::ExecState*, const String& title)
+void JSGlobalObjectConsoleClient::profile(JSC::ExecState*, const String&)
 {
-    if (!m_consoleAgent->enabled())
-        return;
-
-    // Allow duplicate unnamed profiles. Disallow duplicate named profiles.
-    if (!title.isEmpty()) {
-        for (auto& existingTitle : m_profiles) {
-            if (existingTitle == title) {
-                // FIXME: Send an enum to the frontend for localization?
-                String warning = title.isEmpty() ? ASCIILiteral("Unnamed Profile already exists") : makeString("Profile \"", title, "\" already exists");
-                m_consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Profile, MessageLevel::Warning, warning));
-                return;
-            }
-        }
-    }
-
-    m_profiles.append(title);
-    startConsoleProfile();
+    // FIXME: support |console.profile| for JSContexts. <https://webkit.org/b/136466>
 }
 
-void JSGlobalObjectConsoleClient::profileEnd(JSC::ExecState*, const String& title)
+void JSGlobalObjectConsoleClient::profileEnd(JSC::ExecState*, const String&)
 {
-    if (!m_consoleAgent->enabled())
-        return;
-
-    // Stop profiles in reverse order. If the title is empty, then stop the last profile.
-    // Otherwise, match the title of the profile to stop.
-    for (ptrdiff_t i = m_profiles.size() - 1; i >= 0; --i) {
-        if (title.isEmpty() || m_profiles[i] == title) {
-            m_profiles.remove(i);
-            if (m_profiles.isEmpty())
-                stopConsoleProfile();
-            return;
-        }
-    }
-
-    // FIXME: Send an enum to the frontend for localization?
-    String warning = title.isEmpty() ? ASCIILiteral("No profiles exist") : makeString("Profile \"", title, "\" does not exist");
-    m_consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::ProfileEnd, MessageLevel::Warning, warning));    
+    // FIXME: support |console.profile| for JSContexts. <https://webkit.org/b/136466>
 }
 
-void JSGlobalObjectConsoleClient::startConsoleProfile()
-{
-    // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection
-    m_scriptProfilerAgent->programmaticCaptureStarted();
-
-    m_profileRestoreBreakpointActiveValue = m_debuggerAgent->breakpointsActive();
-
-    ErrorString unused;
-    m_debuggerAgent->setBreakpointsActive(unused, false);
-
-    const bool includeSamples = true;
-    m_scriptProfilerAgent->startTracking(unused, &includeSamples);
-}
-
-void JSGlobalObjectConsoleClient::stopConsoleProfile()
-{
-    ErrorString unused;
-    m_scriptProfilerAgent->stopTracking(unused);
-
-    m_debuggerAgent->setBreakpointsActive(unused, m_profileRestoreBreakpointActiveValue);
-
-    // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection
-    m_scriptProfilerAgent->programmaticCaptureStopped();
-}
-
 void JSGlobalObjectConsoleClient::takeHeapSnapshot(JSC::ExecState*, const String& title)
 {
     m_consoleAgent->takeHeapSnapshot(title);

Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.h (202195 => 202196)


--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.h	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectConsoleClient.h	2016-06-18 03:33:19 UTC (rev 202196)
@@ -23,22 +23,19 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#pragma once
+#ifndef JSGlobalObjectConsoleClient_h
+#define JSGlobalObjectConsoleClient_h
 
 #include "ConsoleClient.h"
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
 
 namespace Inspector {
 
 class InspectorConsoleAgent;
-class InspectorDebuggerAgent;
-class InspectorScriptProfilerAgent;
 
 class JSGlobalObjectConsoleClient final : public JSC::ConsoleClient {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    explicit JSGlobalObjectConsoleClient(InspectorConsoleAgent*, InspectorDebuggerAgent*, InspectorScriptProfilerAgent*);
+    explicit JSGlobalObjectConsoleClient(InspectorConsoleAgent*);
     virtual ~JSGlobalObjectConsoleClient() { }
 
     static bool logToSystemConsole();
@@ -58,14 +55,9 @@
     void warnUnimplemented(const String& method);
     void internalAddMessage(MessageType, MessageLevel, JSC::ExecState*, RefPtr<ScriptArguments>&&);
 
-    void startConsoleProfile();
-    void stopConsoleProfile();
-
     InspectorConsoleAgent* m_consoleAgent;
-    InspectorDebuggerAgent* m_debuggerAgent;
-    InspectorScriptProfilerAgent* m_scriptProfilerAgent;
-    Vector<String> m_profiles;
-    bool m_profileRestoreBreakpointActiveValue { false };
 };
 
 }
+
+#endif // !defined(JSGlobalObjectConsoleClient_h)

Modified: trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp (202195 => 202196)


--- trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/_javascript_Core/inspector/JSGlobalObjectInspectorController.cpp	2016-06-18 03:33:19 UTC (rev 202196)
@@ -88,19 +88,18 @@
     auto heapAgent = std::make_unique<InspectorHeapAgent>(context);
     auto consoleAgent = std::make_unique<JSGlobalObjectConsoleAgent>(context, heapAgent.get());
     auto debuggerAgent = std::make_unique<JSGlobalObjectDebuggerAgent>(context, consoleAgent.get());
-    auto scriptProfilerAgent = std::make_unique<InspectorScriptProfilerAgent>(context);
 
     m_inspectorAgent = inspectorAgent.get();
     m_debuggerAgent = debuggerAgent.get();
     m_consoleAgent = consoleAgent.get();
-    m_consoleClient = std::make_unique<JSGlobalObjectConsoleClient>(m_consoleAgent, m_debuggerAgent, scriptProfilerAgent.get());
+    m_consoleClient = std::make_unique<JSGlobalObjectConsoleClient>(m_consoleAgent);
 
     m_agents.append(WTFMove(inspectorAgent));
     m_agents.append(WTFMove(runtimeAgent));
     m_agents.append(WTFMove(consoleAgent));
     m_agents.append(WTFMove(debuggerAgent));
     m_agents.append(WTFMove(heapAgent));
-    m_agents.append(WTFMove(scriptProfilerAgent));
+    m_agents.append(std::make_unique<InspectorScriptProfilerAgent>(context));
 
     m_executionStopwatch->start();
 }

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp (202195 => 202196)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.cpp	2016-06-18 03:33:19 UTC (rev 202196)
@@ -125,11 +125,6 @@
     disable(false);
 }
 
-bool InspectorDebuggerAgent::breakpointsActive() const
-{
-    return m_scriptDebugServer.breakpointsActive();
-}
-
 void InspectorDebuggerAgent::setBreakpointsActive(ErrorString&, bool active)
 {
     if (active)
@@ -138,7 +133,7 @@
         m_scriptDebugServer.deactivateBreakpoints();
 }
 
-bool InspectorDebuggerAgent::isPaused() const
+bool InspectorDebuggerAgent::isPaused()
 {
     return m_scriptDebugServer.isPaused();
 }

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h (202195 => 202196)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorDebuggerAgent.h	2016-06-18 03:33:19 UTC (rev 202196)
@@ -83,8 +83,7 @@
     void evaluateOnCallFrame(ErrorString&, const String& callFrameId, const String& _expression_, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, const bool* saveResult, RefPtr<Inspector::Protocol::Runtime::RemoteObject>& result, Inspector::Protocol::OptOutput<bool>* wasThrown, Inspector::Protocol::OptOutput<int>* savedResultIndex) final;
     void setOverlayMessage(ErrorString&, const String*) override;
 
-    bool isPaused() const;
-    bool breakpointsActive() const;
+    bool isPaused();
 
     void setSuppressAllPauses(bool);
 

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.cpp (202195 => 202196)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.cpp	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.cpp	2016-06-18 03:33:19 UTC (rev 202196)
@@ -216,14 +216,4 @@
 #endif // ENABLE(SAMPLING_PROFILER)
 }
 
-void InspectorScriptProfilerAgent::programmaticCaptureStarted()
-{
-    m_frontendDispatcher->programmaticCaptureStarted();
-}
-
-void InspectorScriptProfilerAgent::programmaticCaptureStopped()
-{
-    m_frontendDispatcher->programmaticCaptureStopped();
-}
-
 } // namespace Inspector

Modified: trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.h (202195 => 202196)


--- trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.h	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/_javascript_Core/inspector/agents/InspectorScriptProfilerAgent.h	2016-06-18 03:33:19 UTC (rev 202196)
@@ -53,9 +53,6 @@
     void startTracking(ErrorString&, const bool* includeSamples) override;
     void stopTracking(ErrorString&) override;
 
-    void programmaticCaptureStarted();
-    void programmaticCaptureStopped();
-
     // Debugger::ProfilingClient
     bool isAlreadyProfiling() const override;
     double willEvaluateScript() override;

Modified: trunk/Source/_javascript_Core/inspector/protocol/ScriptProfiler.json (202195 => 202196)


--- trunk/Source/_javascript_Core/inspector/protocol/ScriptProfiler.json	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/_javascript_Core/inspector/protocol/ScriptProfiler.json	2016-06-18 03:33:19 UTC (rev 202196)
@@ -86,14 +86,6 @@
             "parameters": [
                 { "name": "samples", "$ref": "Samples", "optional": true, "description": "Stack traces." }
             ]
-        },
-        {
-            "name": "programmaticCaptureStarted",
-            "description": "Fired when programmatic capture starts (console.profile). JSContext inspection only."
-        },
-        {
-            "name": "programmaticCaptureStopped",
-            "description": "Fired when programmatic capture stops (console.profileEnd). JSContext inspection only."
         }
     ]
 }

Modified: trunk/Source/_javascript_Core/inspector/protocol/Timeline.json (202195 => 202196)


--- trunk/Source/_javascript_Core/inspector/protocol/Timeline.json	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/_javascript_Core/inspector/protocol/Timeline.json	2016-06-18 03:33:19 UTC (rev 202196)
@@ -105,14 +105,6 @@
         {
             "name": "autoCaptureStarted",
             "description": "Fired when auto capture started."
-        },
-        {
-            "name": "programmaticCaptureStarted",
-            "description": "Fired when programmatic capture starts (console.profile)."
-        },
-        {
-            "name": "programmaticCaptureStopped",
-            "description": "Fired when programmatic capture stops (console.profileEnd)."
         }
     ]
 }

Modified: trunk/Source/WebCore/ChangeLog (202195 => 202196)


--- trunk/Source/WebCore/ChangeLog	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/WebCore/ChangeLog	2016-06-18 03:33:19 UTC (rev 202196)
@@ -1,5 +1,20 @@
 2016-06-17  Commit Queue  <[email protected]>
 
+        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
+
+2016-06-17  Commit Queue  <[email protected]>
+
         Unreviewed, rolling out r202068, r202115, and r202128.
         https://bugs.webkit.org/show_bug.cgi?id=158896
 

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (202195 => 202196)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2016-06-18 03:33:19 UTC (rev 202196)
@@ -43,8 +43,6 @@
 #include "RenderView.h"
 #include "ScriptState.h"
 #include "TimelineRecordFactory.h"
-#include "WebConsoleAgent.h"
-#include <inspector/ConsoleMessage.h>
 #include <inspector/ScriptBreakpoint.h>
 #include <inspector/agents/InspectorDebuggerAgent.h>
 #include <inspector/agents/InspectorHeapAgent.h>
@@ -243,55 +241,14 @@
     return m_environment.executionStopwatch()->elapsedTime();
 }
 
-void InspectorTimelineAgent::startFromConsole(JSC::ExecState* exec, const String& title)
+void InspectorTimelineAgent::startFromConsole(JSC::ExecState*, const String&)
 {
-    // Allow duplicate unnamed profiles. Disallow duplicate named profiles.
-    if (!title.isEmpty()) {
-        for (const TimelineRecordEntry& record : m_pendingConsoleProfileRecords) {
-            String recordTitle;
-            record.data->getString(ASCIILiteral("title"), recordTitle);
-            if (recordTitle == title) {
-                if (WebConsoleAgent* consoleAgent = m_instrumentingAgents.webConsoleAgent()) {
-                    // FIXME: Send an enum to the frontend for localization?
-                    String warning = title.isEmpty() ? ASCIILiteral("Unnamed Profile already exists") : makeString("Profile \"", title, "\" already exists");
-                    consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::Profile, MessageLevel::Warning, warning));
-                }
-                return;
-            }
-        }
-    }
-
-    if (!m_enabled && m_pendingConsoleProfileRecords.isEmpty())
-        startProgrammaticCapture();
-
-    m_pendingConsoleProfileRecords.append(createRecordEntry(TimelineRecordFactory::createConsoleProfileData(title), TimelineRecordType::ConsoleProfile, true, frameFromExecState(exec)));
+    // FIXME: <https://webkit.org/b/153499> Web Inspector: console.profile should use the new Sampling Profiler
 }
 
-void InspectorTimelineAgent::stopFromConsole(JSC::ExecState*, const String& title)
+void InspectorTimelineAgent::stopFromConsole(JSC::ExecState*, const String&)
 {
-    // Stop profiles in reverse order. If the title is empty, then stop the last profile.
-    // Otherwise, match the title of the profile to stop.
-    for (int i = m_pendingConsoleProfileRecords.size() - 1; i >= 0; --i) {
-        const TimelineRecordEntry& record = m_pendingConsoleProfileRecords[i];
-
-        String recordTitle;
-        record.data->getString(ASCIILiteral("title"), recordTitle);
-        if (title.isEmpty() || recordTitle == title) {
-            didCompleteRecordEntry(record);
-            m_pendingConsoleProfileRecords.remove(i);
-
-            if (!m_enabledFromFrontend && m_pendingConsoleProfileRecords.isEmpty())
-                stopProgrammaticCapture();
-
-            return;
-        }
-    }
-
-    if (WebConsoleAgent* consoleAgent = m_instrumentingAgents.webConsoleAgent()) {
-        // FIXME: Send an enum to the frontend for localization?
-        String warning = title.isEmpty() ? ASCIILiteral("No profiles exist") : makeString("Profile \"", title, "\" does not exist");
-        consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::ConsoleAPI, MessageType::ProfileEnd, MessageLevel::Warning, warning));    
-    }
+    // FIXME: <https://webkit.org/b/153499> Web Inspector: console.profile should use the new Sampling Profiler
 }
 
 void InspectorTimelineAgent::willCallFunction(const String& scriptName, int scriptLine, Frame* frame)
@@ -448,119 +405,40 @@
     // Inform the frontend we started an auto capture. The frontend must stop capture.
     m_frontendDispatcher->autoCaptureStarted();
 
-    toggleInstruments(InstrumentState::Start);
-}
-
-void InspectorTimelineAgent::startProgrammaticCapture()
-{
-    ASSERT(!m_enabled);
-
-    // Disable breakpoints during programmatic capture.
-    if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents.inspectorDebuggerAgent()) {
-        m_programmaticCaptureRestoreBreakpointActiveValue = debuggerAgent->breakpointsActive();
-        if (m_programmaticCaptureRestoreBreakpointActiveValue) {
-            ErrorString unused;
-            debuggerAgent->setBreakpointsActive(unused, false);
-        }
-    } else
-        m_programmaticCaptureRestoreBreakpointActiveValue = false;
-
-    m_frontendDispatcher->programmaticCaptureStarted();
-
-    toggleScriptProfilerInstrument(InstrumentState::Start); // Ensure _javascript_ samping data.
-    toggleTimelineInstrument(InstrumentState::Start); // Ensure Console Profile event records.
-    toggleInstruments(InstrumentState::Start); // Any other instruments the frontend wants us to record.
-}
-
-void InspectorTimelineAgent::stopProgrammaticCapture()
-{
-    ASSERT(m_enabled);
-    ASSERT(!m_enabledFromFrontend);
-
-    toggleInstruments(InstrumentState::Stop);
-    toggleTimelineInstrument(InstrumentState::Stop);
-    toggleScriptProfilerInstrument(InstrumentState::Stop);
-
-    // Re-enable breakpoints if they were enabled.
-    if (m_programmaticCaptureRestoreBreakpointActiveValue) {
-        if (InspectorDebuggerAgent* debuggerAgent = m_instrumentingAgents.inspectorDebuggerAgent()) {
-            ErrorString unused;
-            debuggerAgent->setBreakpointsActive(unused, true);
-        }
-    }
-
-    m_frontendDispatcher->programmaticCaptureStopped();
-}
-
-void InspectorTimelineAgent::toggleInstruments(InstrumentState state)
-{
+    // Enable instruments.
     for (auto instrumentType : m_instruments) {
         switch (instrumentType) {
         case Inspector::Protocol::Timeline::Instrument::ScriptProfiler: {
-            toggleScriptProfilerInstrument(state);
+            if (m_scriptProfilerAgent) {
+                ErrorString unused;
+                const bool includeSamples = true;
+                m_scriptProfilerAgent->startTracking(unused, &includeSamples);
+            }
             break;
         }
         case Inspector::Protocol::Timeline::Instrument::Heap: {
-            toggleHeapInstrument(state);
+            if (m_heapAgent) {
+                ErrorString unused;
+                m_heapAgent->startTracking(unused);
+            }
             break;
         }
         case Inspector::Protocol::Timeline::Instrument::Memory: {
-            toggleMemoryInstrument(state);
+#if ENABLE(RESOURCE_USAGE)
+            if (InspectorMemoryAgent* memoryAgent = m_instrumentingAgents.inspectorMemoryAgent()) {
+                ErrorString unused;
+                memoryAgent->startTracking(unused);
+            }
+#endif
             break;
         }
         case Inspector::Protocol::Timeline::Instrument::Timeline:
-            toggleTimelineInstrument(state);
+            internalStart();
             break;
         }
     }
 }
 
-void InspectorTimelineAgent::toggleScriptProfilerInstrument(InstrumentState state)
-{
-    if (m_scriptProfilerAgent) {
-        ErrorString unused;
-        if (state == InstrumentState::Start) {
-            const bool includeSamples = true;
-            m_scriptProfilerAgent->startTracking(unused, &includeSamples);
-        } else
-            m_scriptProfilerAgent->stopTracking(unused);
-    }
-}
-
-void InspectorTimelineAgent::toggleHeapInstrument(InstrumentState state)
-{
-    if (m_heapAgent) {
-        ErrorString unused;
-        if (state == InstrumentState::Start)
-            m_heapAgent->startTracking(unused);
-        else
-            m_heapAgent->stopTracking(unused);
-    }
-}
-
-void InspectorTimelineAgent::toggleMemoryInstrument(InstrumentState state)
-{
-#if ENABLE(RESOURCE_USAGE)
-    if (InspectorMemoryAgent* memoryAgent = m_instrumentingAgents.inspectorMemoryAgent()) {
-        ErrorString unused;
-        if (state == InstrumentState::Start)
-            memoryAgent->startTracking(unused);
-        else
-            memoryAgent->stopTracking(unused);
-    }
-#else
-    UNUSED_PARAM(state);
-#endif
-}
-
-void InspectorTimelineAgent::toggleTimelineInstrument(InstrumentState state)
-{
-    if (state == InstrumentState::Start)
-        internalStart();
-    else
-        internalStop();
-}
-
 void InspectorTimelineAgent::didCommitLoad()
 {
     clearRecordStack();

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (202195 => 202196)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2016-06-18 03:33:19 UTC (rev 202196)
@@ -153,18 +153,6 @@
     void breakpointActionSound(int) final { }
     void breakpointActionProbe(JSC::ExecState&, const Inspector::ScriptBreakpointAction&, unsigned batchId, unsigned sampleId, JSC::JSValue result) final;
 
-    void startProgrammaticCapture();
-    void stopProgrammaticCapture();
-
-    enum class InstrumentState { Start, Stop };
-    void toggleInstruments(InstrumentState);
-    void toggleScriptProfilerInstrument(InstrumentState);
-    void toggleHeapInstrument(InstrumentState);
-    void toggleMemoryInstrument(InstrumentState);
-    void toggleTimelineInstrument(InstrumentState);
-    void disableBreakpoints();
-    void enableBreakpoints();
-
     friend class TimelineRecordStack;
 
     struct TimelineRecordEntry {
@@ -212,14 +200,12 @@
     InspectorPageAgent* m_pageAgent;
 
     Vector<TimelineRecordEntry> m_recordStack;
-    Vector<TimelineRecordEntry> m_pendingConsoleProfileRecords;
 
     int m_id { 1 };
     int m_maxCallStackDepth { 5 };
 
     bool m_enabled { false };
     bool m_enabledFromFrontend { false };
-    bool m_programmaticCaptureRestoreBreakpointActiveValue { false };
 
     bool m_autoCaptureEnabled { false };
     Vector<Inspector::Protocol::Timeline::Instrument> m_instruments;

Modified: trunk/Source/WebInspectorUI/ChangeLog (202195 => 202196)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-06-18 03:33:19 UTC (rev 202196)
@@ -1,3 +1,18 @@
+2016-06-17  Commit Queue  <[email protected]>
+
+        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
+
 2016-06-16  Joseph Pecoraro  <[email protected]>
 
         Web Inspector: console.profile should use the new Sampling Profiler

Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (202195 => 202196)


--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js	2016-06-18 03:33:19 UTC (rev 202196)
@@ -262,7 +262,7 @@
         this.dispatchEventToListeners(WebInspector.TimelineManager.Event.CapturingStopped, {endTime});
     }
 
-    autoCaptureStarted()
+    autoCaptureStarted(startTime)
     {
         // Called from WebInspector.TimelineObserver.
 
@@ -272,36 +272,12 @@
         // We may already have an fresh TimelineRecording created if autoCaptureStarted is received
         // between sending the Timeline.start command and receiving Timeline.capturingStarted event.
         // In that case, there is no need to call startCapturing again. Reuse the fresh recording.
-        if (!this._waitingForCapturingStartedEvent) {
-            const createNewRecording = true;
-            this.startCapturing(createNewRecording);
-        }
+        if (!this._waitingForCapturingStartedEvent)
+            this.startCapturing(true);
 
         this._shouldSetAutoCapturingMainResource = true;
     }
 
-    programmaticCaptureStarted()
-    {
-        // Called from WebInspector.TimelineObserver.
-
-        this._activeRecording.addScriptInstrumentForProgrammaticCapture();
-
-        const createNewRecording = false;
-        this.startCapturing(createNewRecording);
-    }
-
-    programmaticCaptureStopped()
-    {
-        // Called from WebInspector.TimelineObserver.
-
-        // FIXME: This is purely to avoid a noisy assert. Previously
-        // it was impossible to stop without stopping from the UI.
-        console.assert(!this._isCapturing);
-        this._isCapturing = true;
-
-        this.stopCapturing();
-    }
-
     eventRecorded(recordPayload)
     {
         // Called from WebInspector.TimelineObserver.
@@ -509,8 +485,7 @@
 
         case TimelineAgent.EventType.ConsoleProfile:
             var profileData = recordPayload.data.profile;
-            // COMPATIBILITY (iOS 9): With the Sampling Profiler, profiles no longer include legacy profile data.
-            console.assert(profileData || TimelineAgent.setInstruments);
+            console.assert(profileData);
             return new WebInspector.ScriptTimelineRecord(WebInspector.ScriptTimelineRecord.EventType.ConsoleProfileRecorded, startTime, endTime, callFrames, sourceCodeLocation, recordPayload.data.title, profileData);
 
         case TimelineAgent.EventType.TimerFire:
@@ -859,24 +834,6 @@
         }
     }
 
-    scriptProfilerProgrammaticCaptureStarted()
-    {
-        // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection
-        console.assert(WebInspector.debuggableType === WebInspector.DebuggableType._javascript_);
-        console.assert(!this._isCapturing);
-
-        this.programmaticCaptureStarted();
-    }
-
-    scriptProfilerProgrammaticCaptureStopped()
-    {
-        // FIXME: <https://webkit.org/b/158753> Generalize the concept of Instruments on the backend to work equally for JSContext and Web inspection
-        console.assert(WebInspector.debuggableType === WebInspector.DebuggableType._javascript_);
-        console.assert(this._isCapturing);
-
-        this.programmaticCaptureStopped();
-    }
-
     scriptProfilerTrackingStarted(timestamp)
     {
         this._scriptProfilerRecords = [];

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ScriptInstrument.js (202195 => 202196)


--- trunk/Source/WebInspectorUI/UserInterface/Models/ScriptInstrument.js	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScriptInstrument.js	2016-06-18 03:33:19 UTC (rev 202196)
@@ -56,4 +56,5 @@
 
         ScriptProfilerAgent.stopTracking();
     }
+
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js (202195 => 202196)


--- trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/TimelineRecording.js	2016-06-18 03:33:19 UTC (rev 202196)
@@ -127,17 +127,15 @@
             instrument.startInstrumentation();
     }
 
-    stop(programmatic)
+    stop()
     {
         console.assert(this._capturing, "Attempted to stop an already stopped session.");
         console.assert(!this._readonly, "Attempted to stop a readonly session.");
 
         this._capturing = false;
 
-        if (!programmatic) {
-            for (let instrument of this._instruments)
-                instrument.stopInstrumentation();
-        }
+        for (let instrument of this._instruments)
+            instrument.stopInstrumentation();
     }
 
     saveIdentityToCookie()
@@ -309,19 +307,6 @@
         return this._discontinuities.filter((item) => item.startTime < endTime && item.endTime > startTime);
     }
 
-    addScriptInstrumentForProgrammaticCapture()
-    {
-        for (let instrument of this._instruments) {
-            if (instrument instanceof WebInspector.ScriptInstrument)
-                return;
-        }
-
-        this.addInstrument(new WebInspector.ScriptInstrument);
-
-        let instrumentTypes = this._instruments.map((instrument) => instrument.timelineRecordType);
-        WebInspector.timelineManager.enabledTimelineTypes = instrumentTypes;
-    }
-
     computeElapsedTime(timestamp)
     {
         if (!timestamp || isNaN(timestamp))

Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/ScriptProfilerObserver.js (202195 => 202196)


--- trunk/Source/WebInspectorUI/UserInterface/Protocol/ScriptProfilerObserver.js	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/ScriptProfilerObserver.js	2016-06-18 03:33:19 UTC (rev 202196)
@@ -41,14 +41,4 @@
     {
         WebInspector.timelineManager.scriptProfilerTrackingCompleted(samples);
     }
-    
-    programmaticCaptureStarted()
-    {
-        WebInspector.timelineManager.scriptProfilerProgrammaticCaptureStarted();
-    }
-
-    programmaticCaptureStopped()
-    {
-        WebInspector.timelineManager.scriptProfilerProgrammaticCaptureStopped();
-    }
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js (202195 => 202196)


--- trunk/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js	2016-06-18 03:29:49 UTC (rev 202195)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/TimelineObserver.js	2016-06-18 03:33:19 UTC (rev 202196)
@@ -46,14 +46,4 @@
     {
         WebInspector.timelineManager.autoCaptureStarted();
     }
-
-    programmaticCaptureStarted()
-    {
-        WebInspector.timelineManager.programmaticCaptureStarted();
-    }
-
-    programmaticCaptureStopped()
-    {
-        WebInspector.timelineManager.programmaticCaptureStopped();
-    }
 };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to