Changeset 141388 in webkit


Ignore:
Timestamp:
Jan 31, 2013 12:45:50 AM (11 years ago)
Author:
yurys@chromium.org
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:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r141387 r141388  
     12013-01-31  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Layout Test inspector-protocol/take-heap-snapshot.html crashes in the Debug mode
     4        https://bugs.webkit.org/show_bug.cgi?id=104800
     5
     6        Reviewed by Jochen Eisinger.
     7
     8        Marked the test as not crashing in the debug mode.
     9
     10        * inspector-protocol/heap-profiler/take-heap-snapshot.html:
     11        * platform/chromium/TestExpectations:
     12
    1132013-01-31  Sheriff Bot  <webkit.review.bot@gmail.com>
    214
  • trunk/LayoutTests/inspector-protocol/heap-profiler/take-heap-snapshot.html

    r141251 r141388  
    2929    }
    3030
    31     InspectorTest.sendCommand("Profiler.takeHeapSnapshot", {}, didTakeHeapSnapshot);
     31    InspectorTest.sendCommand("Profiler.takeHeapSnapshot", { "reportProgress": false }, didTakeHeapSnapshot);
    3232}
    3333</script>
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r141380 r141388  
    10701070webkit.org/b/75647 http/tests/inspector/network/download.html [ Pass Timeout Failure ]
    10711071
    1072 webkit.org/b/104800 [ Debug ] inspector-protocol/heap-profiler [ Crash ]
    1073 
    10741072# Timing out after http://trac.webkit.org/changeset/141245
    10751073webkit.org/b/107944 inspector/editor/text-editor-ctrl-movements.html [ Pass Timeout ]
  • trunk/Source/WebCore/ChangeLog

    r141387 r141388  
     12013-01-31  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Layout Test inspector-protocol/take-heap-snapshot.html crashes in the Debug mode
     4        https://bugs.webkit.org/show_bug.cgi?id=104800
     5
     6        Reviewed by Jochen Eisinger.
     7
     8        The test crashed because during snapshot generation Profiler.reportHeapSnapshotProgress
     9        events were sent to the inspector front-end, then parsed and dispatched there.
     10        Since in case of layout tests the front-end resides in the same process
     11        as the inspected page parsing the event broke an assumption that there are
     12        no JS heap allocations while heap snapshot is being taken.
     13
     14        I added optional boolean parameter 'reportProgress' to Profiler.takeHeapSnapshot
     15        command so that the protocol client can control whether progress events should
     16        be sent during snapshot generation. The protocol test is not interested in the
     17        progress events and sets reportProgress to false.
     18
     19        Test: inspector-protocol/heap-profiler/take-heap-snapshot.html
     20
     21        * inspector/Inspector.json:
     22        * inspector/InspectorProfilerAgent.cpp:
     23        (WebCore::InspectorProfilerAgent::takeHeapSnapshot):
     24        * inspector/InspectorProfilerAgent.h:
     25        (InspectorProfilerAgent):
     26        * inspector/front-end/ProfilesPanel.js:
     27        (WebInspector.ProfilesPanel.prototype.takeHeapSnapshot):
     28
    1292013-01-31  Sheriff Bot  <webkit.review.bot@gmail.com>
    230
  • trunk/Source/WebCore/inspector/Inspector.json

    r141273 r141388  
    31283128            },
    31293129            {
    3130                 "name": "takeHeapSnapshot"
     3130                "name": "takeHeapSnapshot",
     3131                "parameters": [
     3132                    { "name": "reportProgress", "type": "boolean", "optional": true, "description": "If true 'reportHeapSnapshotProgress' events will be generated while snapshot is being taken." }
     3133                ]
    31313134            },
    31323135            {
  • trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp

    r140830 r141388  
    433433};
    434434
    435 void InspectorProfilerAgent::takeHeapSnapshot(ErrorString*)
     435void InspectorProfilerAgent::takeHeapSnapshot(ErrorString*, const bool* reportProgress)
    436436{
    437437    String title = makeString(UserInitiatedProfileName, '.', String::number(m_nextUserInitiatedHeapSnapshotNumber));
    438438    ++m_nextUserInitiatedHeapSnapshotNumber;
    439439
    440     HeapSnapshotProgress progress(m_frontend);
     440    HeapSnapshotProgress progress(reportProgress && *reportProgress ? m_frontend : 0);
    441441    RefPtr<ScriptHeapSnapshot> snapshot = ScriptProfiler::takeHeapSnapshot(title, &progress);
    442442    if (snapshot) {
  • trunk/Source/WebCore/inspector/InspectorProfilerAgent.h

    r139998 r141388  
    9696    virtual void restore();
    9797
    98     virtual void takeHeapSnapshot(ErrorString*);
     98    virtual void takeHeapSnapshot(ErrorString*, const bool* reportProgress);
    9999    void toggleRecordButton(bool isProfiling);
    100100
  • trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js

    r141272 r141388  
    11461146            this._launcherView.profileFinished();
    11471147        }
    1148         ProfilerAgent.takeHeapSnapshot(done.bind(this));
     1148        ProfilerAgent.takeHeapSnapshot(true, done.bind(this));
    11491149        WebInspector.userMetrics.ProfilesHeapProfileTaken.record();
    11501150    },
Note: See TracChangeset for help on using the changeset viewer.