Title: [172404] trunk/Source/WebCore
Revision
172404
Author
[email protected]
Date
2014-08-11 12:50:52 -0700 (Mon, 11 Aug 2014)

Log Message

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

Reviewed by Joseph Pecoraro.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (172403 => 172404)


--- trunk/Source/WebCore/ChangeLog	2014-08-11 19:22:15 UTC (rev 172403)
+++ trunk/Source/WebCore/ChangeLog	2014-08-11 19:50:52 UTC (rev 172404)
@@ -1,3 +1,20 @@
+2014-08-11  Timothy Hatcher  <[email protected]>
+
+        Web Inspector: console.profile shouldn't stop auto-recorded profiles
+        https://bugs.webkit.org/show_bug.cgi?id=135810
+
+        Reviewed by Joseph Pecoraro.
+
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::start): Added. Call internalStart. Set m_enabledFromFrontend.
+        (WebCore::InspectorTimelineAgent::stop): Added. Calls internalStop. Clear m_enabledFromFrontend.
+        (WebCore::InspectorTimelineAgent::internalStart): Renamed from start.
+        (WebCore::InspectorTimelineAgent::internalStop): Renamed from stop.
+        (WebCore::InspectorTimelineAgent::startFromConsole): Use internalStart.
+        (WebCore::InspectorTimelineAgent::stopFromConsole): Use internalStop. Only stop if !m_enabledFromFrontend.
+        (WebCore::InspectorTimelineAgent::InspectorTimelineAgent): Initialize m_enabledFromFrontend.
+        * inspector/InspectorTimelineAgent.h: Added m_enabledFromFrontend.
+
 2014-08-11  Brent Fulgham  <[email protected]>
 
         [Win] Adjust build script for Windows production build.

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (172403 => 172404)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2014-08-11 19:22:15 UTC (rev 172403)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp	2014-08-11 19:50:52 UTC (rev 172404)
@@ -99,6 +99,20 @@
 
 void InspectorTimelineAgent::start(ErrorString*, const int* maxCallStackDepth)
 {
+    m_enabledFromFrontend = true;
+
+    internalStart(maxCallStackDepth);
+}
+
+void InspectorTimelineAgent::stop(ErrorString*)
+{
+    internalStop();
+
+    m_enabledFromFrontend = false;
+}
+
+void InspectorTimelineAgent::internalStart(const int* maxCallStackDepth)
+{
     if (maxCallStackDepth && *maxCallStackDepth > 0)
         m_maxCallStackDepth = *maxCallStackDepth;
     else
@@ -117,7 +131,7 @@
         m_frontendDispatcher->recordingStarted();
 }
 
-void InspectorTimelineAgent::stop(ErrorString*)
+void InspectorTimelineAgent::internalStop()
 {
     if (!m_enabled)
         return;
@@ -176,8 +190,8 @@
         }
     }
 
-    if (m_pendingConsoleProfileRecords.isEmpty())
-        start();
+    if (!m_enabled && m_pendingConsoleProfileRecords.isEmpty())
+        internalStart();
 
     startProfiling(exec, title);
 
@@ -203,8 +217,8 @@
 
             m_pendingConsoleProfileRecords.remove(i);
 
-            if (m_pendingConsoleProfileRecords.isEmpty())
-                stop();
+            if (!m_enabledFromFrontend && m_pendingConsoleProfileRecords.isEmpty())
+                internalStop();
 
             return profile.release();
         }
@@ -682,6 +696,7 @@
     , m_client(client)
     , m_recordingProfileDepth(0)
     , m_enabled(false)
+    , m_enabledFromFrontend(false)
 {
 }
 

Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (172403 => 172404)


--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2014-08-11 19:22:15 UTC (rev 172403)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h	2014-08-11 19:50:52 UTC (rev 172404)
@@ -245,6 +245,9 @@
         TimelineRecordType type;
     };
 
+    void internalStart(const int* maxCallStackDepth = nullptr);
+    void internalStop();
+
     void sendEvent(PassRefPtr<Inspector::InspectorObject>);
     void appendRecord(PassRefPtr<Inspector::InspectorObject> data, TimelineRecordType, bool captureCallStack, Frame*);
     void pushCurrentRecord(PassRefPtr<Inspector::InspectorObject>, TimelineRecordType, bool captureCallStack, Frame*);
@@ -284,6 +287,7 @@
 
     int m_recordingProfileDepth;
     bool m_enabled;
+    bool m_enabledFromFrontend;
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to