Changeset 80723 in webkit


Ignore:
Timestamp:
Mar 10, 2011 8:36:53 AM (13 years ago)
Author:
pfeldman@chromium.org
Message:

2011-03-10 Greg Simon <gregsimon@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: Need new graphic icon for garbage collect button.
https://bugs.webkit.org/show_bug.cgi?id=55794

No new tests: gc tests are flaky due to non-determinisic
behavior of collection APIs (more notes in bug)

  • English.lproj/localizedStrings.js:
  • WebCore.gypi:
  • bindings/js/ScriptProfiler.cpp: (WebCore::ScriptProfiler::collectGarbage):
  • bindings/js/ScriptProfiler.h:
  • bindings/v8/ScriptProfiler.cpp: (WebCore::ScriptProfiler::collectGarbage):
  • bindings/v8/ScriptProfiler.h:
  • inspector/Inspector.idl:
  • inspector/InspectorProfilerAgent.cpp: (WebCore::InspectorProfilerAgent::collectGarbage):
  • inspector/InspectorProfilerAgent.h:
  • inspector/front-end/Images/garbageCollectButtonGlyph.png: Added.
  • inspector/front-end/TimelinePanel.js: (WebInspector.TimelinePanel.prototype.get statusBarItems): (WebInspector.TimelinePanel.prototype._createStatusbarButtons): (WebInspector.TimelinePanel.prototype._garbageCollectButtonClicked):
  • inspector/front-end/inspector.css: (.garbage-collect-status-bar-item .glyph):
Location:
trunk/Source/WebCore
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r80721 r80723  
     12011-03-10  Greg Simon  <gregsimon@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: Need new graphic icon for garbage collect button.
     6        https://bugs.webkit.org/show_bug.cgi?id=55794
     7
     8        No new tests: gc tests are flaky due to non-determinisic
     9        behavior of collection APIs (more notes in bug)
     10
     11        * English.lproj/localizedStrings.js:
     12        * WebCore.gypi:
     13        * bindings/js/ScriptProfiler.cpp:
     14        (WebCore::ScriptProfiler::collectGarbage):
     15        * bindings/js/ScriptProfiler.h:
     16        * bindings/v8/ScriptProfiler.cpp:
     17        (WebCore::ScriptProfiler::collectGarbage):
     18        * bindings/v8/ScriptProfiler.h:
     19        * inspector/Inspector.idl:
     20        * inspector/InspectorProfilerAgent.cpp:
     21        (WebCore::InspectorProfilerAgent::collectGarbage):
     22        * inspector/InspectorProfilerAgent.h:
     23        * inspector/front-end/Images/garbageCollectButtonGlyph.png: Added.
     24        * inspector/front-end/TimelinePanel.js:
     25        (WebInspector.TimelinePanel.prototype.get statusBarItems):
     26        (WebInspector.TimelinePanel.prototype._createStatusbarButtons):
     27        (WebInspector.TimelinePanel.prototype._garbageCollectButtonClicked):
     28        * inspector/front-end/inspector.css:
     29        (.garbage-collect-status-bar-item .glyph):
     30
    1312011-03-10  Andrey Kosyakov  <caseq@chromium.org>
    232
  • trunk/Source/WebCore/WebCore.gypi

    r80611 r80723  
    53385338            'inspector/front-end/Images/helpButtonGlyph.png',
    53395339            'inspector/front-end/Images/largerResourcesButtonGlyph.png',
     5340            'inspector/front-end/Images/garbageCollectButtonGlyph.png',
    53405341            'inspector/front-end/Images/localStorage.png',
    53415342            'inspector/front-end/Images/networkIcon.png',
  • trunk/Source/WebCore/bindings/js/ScriptProfiler.cpp

    r76792 r80723  
    3131#include "ScriptProfiler.h"
    3232
     33#include "GCController.h"
    3334#include "JSDOMBinding.h"
    3435#include <profiler/Profiler.h>
    3536
    3637namespace WebCore {
     38
     39void ScriptProfiler::collectGarbage()
     40{
     41    gcController().garbageCollectNow();
     42}
    3743
    3844void ScriptProfiler::start(ScriptState* state, const String& title)
  • trunk/Source/WebCore/bindings/js/ScriptProfiler.h

    r76792 r80723  
    4848    };
    4949
     50    static void collectGarbage();
    5051    static void start(ScriptState* state, const String& title);
    5152    static PassRefPtr<ScriptProfile> stop(ScriptState* state, const String& title);
  • trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp

    r76792 r80723  
    5454}
    5555
     56void ScriptProfiler::collectGarbage()
     57{
     58    // NOTE : There is currently no direct way to collect memory from the v8 C++ API
     59    // but notifying low-memory forces a mark-compact, which is exactly what we want
     60    // in this case.
     61    v8::V8::LowMemoryNotification();
     62}
     63
    5664namespace {
    5765
  • trunk/Source/WebCore/bindings/v8/ScriptProfiler.h

    r76792 r80723  
    5454    };
    5555
     56    static void collectGarbage();
    5657    static void start(ScriptState* state, const String& title);
    5758    static PassRefPtr<ScriptProfile> stop(ScriptState* state, const String& title);
  • trunk/Source/WebCore/inspector/Inspector.idl

    r80713 r80723  
    272272        void takeHeapSnapshot(in boolean detailed);
    273273        void getExactHeapSnapshotNodeRetainedSize(in unsigned long uid, in unsigned long nodeId, out long size);
     274        void collectGarbage();
    274275        [event] void addProfileHeader(out Object header);
    275276        [event] void addHeapSnapshotChunk(out unsigned long uid, out String chunk);
  • trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp

    r80350 r80723  
    4141#include "KURL.h"
    4242#include "Page.h"
     43#include "ScriptController.h"
    4344#include "ScriptDebugServer.h"
    4445#include "ScriptHeapSnapshot.h"
     
    107108    String message = makeString("Profile \"webkit-profile://", CPUProfileType, '/', encodeWithURLEscapeSequences(title), "#0\" started.");
    108109    m_consoleAgent->addMessageToConsole(JSMessageSource, LogMessageType, LogMessageLevel, message, lineNumber, sourceURL);
     110}
     111
     112void InspectorProfilerAgent::collectGarbage(WebCore::ErrorString*)
     113{
     114    ScriptProfiler::collectGarbage();
    109115}
    110116
  • trunk/Source/WebCore/inspector/InspectorProfilerAgent.h

    r80350 r80723  
    6262    void addProfileFinishedMessageToConsole(PassRefPtr<ScriptProfile>, unsigned lineNumber, const String& sourceURL);
    6363    void addStartProfilingMessageToConsole(const String& title, unsigned lineNumber, const String& sourceURL);
     64    void collectGarbage(ErrorString*);
    6465    void clearProfiles(ErrorString*) { resetState(); }
    6566    void disable();
  • trunk/Source/WebCore/inspector/front-end/TimelinePanel.js

    r80416 r80723  
    148148    get statusBarItems()
    149149    {
    150         return [this.toggleFilterButton.element, this.toggleTimelineButton.element, this.clearButton.element, this._overviewPane.statusBarFilters];
     150        return [this.toggleFilterButton.element, this.toggleTimelineButton.element, this.garbageCollectButton.element, this.clearButton.element, this._overviewPane.statusBarFilters];
    151151    },
    152152
     
    210210        this.toggleFilterButton.addEventListener("click", this._toggleFilterButtonClicked.bind(this), false);
    211211
     212        this.garbageCollectButton = new WebInspector.StatusBarButton(WebInspector.UIString("Collect Garbage"), "garbage-collect-status-bar-item");
     213        this.garbageCollectButton.addEventListener("click", this._garbageCollectButtonClicked.bind(this), false);
     214
    212215        this.recordsCounter = document.createElement("span");
    213216        this.recordsCounter.className = "timeline-records-counter";
     
    284287        this.toggleFilterButton.element.title = this._calculator._showShortEvents ? this._hideShortRecordsTitleText : this._showShortRecordsTitleText;
    285288        this._scheduleRefresh(true);
     289    },
     290   
     291    _garbageCollectButtonClicked: function()
     292    {
     293        ProfilerAgent.collectGarbage();
    286294    },
    287295
  • trunk/Source/WebCore/inspector/front-end/WebKit.qrc

    r80102 r80723  
    175175    <file>Images/forward.png</file>
    176176    <file>Images/frame.png</file>
     177    <file>Images/garbageCollectButtonGlyph.png</file>
    177178    <file>Images/gearButtonGlyph.png</file>
    178179    <file>Images/glossyHeader.png</file>
  • trunk/Source/WebCore/inspector/front-end/inspector.css

    r80708 r80723  
    39363936}
    39373937
     3938.garbage-collect-status-bar-item .glyph {
     3939    -webkit-mask-image: url(Images/garbageCollectButtonGlyph.png);
     3940}
     3941
    39383942.timeline-records-counter, .storage-application-cache-status, .storage-application-cache-connectivity {
    39393943    font-size: 11px;
Note: See TracChangeset for help on using the changeset viewer.