Title: [141388] trunk
Revision
141388
Author
yu...@chromium.org
Date
2013-01-31 00:45:50 -0800 (Thu, 31 Jan 2013)

Log Message

Layout Test inspector-protocol/take-heap-snapshot.html crashes in the Debug mode
https://bugs.webkit.org/show_bug.cgi?id=104800

Reviewed by Jochen Eisinger.

Source/WebCore:

The test crashed because during snapshot generation Profiler.reportHeapSnapshotProgress
events were sent to the inspector front-end, then parsed and dispatched there.
Since in case of layout tests the front-end resides in the same process
as the inspected page parsing the event broke an assumption that there are
no JS heap allocations while heap snapshot is being taken.

I added optional boolean parameter 'reportProgress' to Profiler.takeHeapSnapshot
command so that the protocol client can control whether progress events should
be sent during snapshot generation. The protocol test is not interested in the
progress events and sets reportProgress to false.

Test: inspector-protocol/heap-profiler/take-heap-snapshot.html

* inspector/Inspector.json:
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::takeHeapSnapshot):
* inspector/InspectorProfilerAgent.h:
(InspectorProfilerAgent):
* inspector/front-end/ProfilesPanel.js:
(WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):

LayoutTests:

Marked the test as not crashing in the debug mode.

* inspector-protocol/heap-profiler/take-heap-snapshot.html:
* platform/chromium/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (141387 => 141388)


--- trunk/LayoutTests/ChangeLog	2013-01-31 08:38:25 UTC (rev 141387)
+++ trunk/LayoutTests/ChangeLog	2013-01-31 08:45:50 UTC (rev 141388)
@@ -1,3 +1,15 @@
+2013-01-31  Yury Semikhatsky  <yu...@chromium.org>
+
+        Layout Test inspector-protocol/take-heap-snapshot.html crashes in the Debug mode
+        https://bugs.webkit.org/show_bug.cgi?id=104800
+
+        Reviewed by Jochen Eisinger.
+
+        Marked the test as not crashing in the debug mode.
+
+        * inspector-protocol/heap-profiler/take-heap-snapshot.html:
+        * platform/chromium/TestExpectations:
+
 2013-01-31  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r141110.

Modified: trunk/LayoutTests/inspector-protocol/heap-profiler/take-heap-snapshot.html (141387 => 141388)


--- trunk/LayoutTests/inspector-protocol/heap-profiler/take-heap-snapshot.html	2013-01-31 08:38:25 UTC (rev 141387)
+++ trunk/LayoutTests/inspector-protocol/heap-profiler/take-heap-snapshot.html	2013-01-31 08:45:50 UTC (rev 141388)
@@ -28,7 +28,7 @@
         InspectorTest.completeTest();
     }
 
-    InspectorTest.sendCommand("Profiler.takeHeapSnapshot", {}, didTakeHeapSnapshot);
+    InspectorTest.sendCommand("Profiler.takeHeapSnapshot", { "reportProgress": false }, didTakeHeapSnapshot);
 }
 </script>
 </head>

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (141387 => 141388)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2013-01-31 08:38:25 UTC (rev 141387)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2013-01-31 08:45:50 UTC (rev 141388)
@@ -1069,8 +1069,6 @@
 
 webkit.org/b/75647 http/tests/inspector/network/download.html [ Pass Timeout Failure ]
 
-webkit.org/b/104800 [ Debug ] inspector-protocol/heap-profiler [ Crash ]
-
 # Timing out after http://trac.webkit.org/changeset/141245
 webkit.org/b/107944 inspector/editor/text-editor-ctrl-movements.html [ Pass Timeout ]
 

Modified: trunk/Source/WebCore/ChangeLog (141387 => 141388)


--- trunk/Source/WebCore/ChangeLog	2013-01-31 08:38:25 UTC (rev 141387)
+++ trunk/Source/WebCore/ChangeLog	2013-01-31 08:45:50 UTC (rev 141388)
@@ -1,3 +1,31 @@
+2013-01-31  Yury Semikhatsky  <yu...@chromium.org>
+
+        Layout Test inspector-protocol/take-heap-snapshot.html crashes in the Debug mode
+        https://bugs.webkit.org/show_bug.cgi?id=104800
+
+        Reviewed by Jochen Eisinger.
+
+        The test crashed because during snapshot generation Profiler.reportHeapSnapshotProgress
+        events were sent to the inspector front-end, then parsed and dispatched there.
+        Since in case of layout tests the front-end resides in the same process
+        as the inspected page parsing the event broke an assumption that there are
+        no JS heap allocations while heap snapshot is being taken.
+
+        I added optional boolean parameter 'reportProgress' to Profiler.takeHeapSnapshot
+        command so that the protocol client can control whether progress events should
+        be sent during snapshot generation. The protocol test is not interested in the
+        progress events and sets reportProgress to false.
+
+        Test: inspector-protocol/heap-profiler/take-heap-snapshot.html
+
+        * inspector/Inspector.json:
+        * inspector/InspectorProfilerAgent.cpp:
+        (WebCore::InspectorProfilerAgent::takeHeapSnapshot):
+        * inspector/InspectorProfilerAgent.h:
+        (InspectorProfilerAgent):
+        * inspector/front-end/ProfilesPanel.js:
+        (WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
+
 2013-01-31  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r141110.

Modified: trunk/Source/WebCore/inspector/Inspector.json (141387 => 141388)


--- trunk/Source/WebCore/inspector/Inspector.json	2013-01-31 08:38:25 UTC (rev 141387)
+++ trunk/Source/WebCore/inspector/Inspector.json	2013-01-31 08:45:50 UTC (rev 141388)
@@ -3127,7 +3127,10 @@
                 "name": "clearProfiles"
             },
             {
-                "name": "takeHeapSnapshot"
+                "name": "takeHeapSnapshot",
+                "parameters": [
+                    { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken." }
+                ]
             },
             {
                 "name": "collectGarbage"

Modified: trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp (141387 => 141388)


--- trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp	2013-01-31 08:38:25 UTC (rev 141387)
+++ trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp	2013-01-31 08:45:50 UTC (rev 141388)
@@ -432,12 +432,12 @@
 
 };
 
-void InspectorProfilerAgent::takeHeapSnapshot(ErrorString*)
+void InspectorProfilerAgent::takeHeapSnapshot(ErrorString*, const bool* reportProgress)
 {
     String title = makeString(UserInitiatedProfileName, '.', String::number(m_nextUserInitiatedHeapSnapshotNumber));
     ++m_nextUserInitiatedHeapSnapshotNumber;
 
-    HeapSnapshotProgress progress(m_frontend);
+    HeapSnapshotProgress progress(reportProgress && *reportProgress ? m_frontend : 0);
     RefPtr<ScriptHeapSnapshot> snapshot = ScriptProfiler::takeHeapSnapshot(title, &progress);
     if (snapshot) {
         m_snapshots.add(snapshot->uid(), snapshot);

Modified: trunk/Source/WebCore/inspector/InspectorProfilerAgent.h (141387 => 141388)


--- trunk/Source/WebCore/inspector/InspectorProfilerAgent.h	2013-01-31 08:38:25 UTC (rev 141387)
+++ trunk/Source/WebCore/inspector/InspectorProfilerAgent.h	2013-01-31 08:45:50 UTC (rev 141388)
@@ -95,7 +95,7 @@
     virtual void clearFrontend();
     virtual void restore();
 
-    virtual void takeHeapSnapshot(ErrorString*);
+    virtual void takeHeapSnapshot(ErrorString*, const bool* reportProgress);
     void toggleRecordButton(bool isProfiling);
 
     virtual void getObjectByHeapObjectId(ErrorString*, const String& heapSnapshotObjectId, const String* objectGroup, RefPtr<TypeBuilder::Runtime::RemoteObject>& result);

Modified: trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js (141387 => 141388)


--- trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js	2013-01-31 08:38:25 UTC (rev 141387)
+++ trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js	2013-01-31 08:45:50 UTC (rev 141388)
@@ -1145,7 +1145,7 @@
         function done() {
             this._launcherView.profileFinished();
         }
-        ProfilerAgent.takeHeapSnapshot(done.bind(this));
+        ProfilerAgent.takeHeapSnapshot(true, done.bind(this));
         WebInspector.userMetrics.ProfilesHeapProfileTaken.record();
     },
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to