Changeset 55464 in webkit


Ignore:
Timestamp:
Mar 3, 2010 9:24:38 AM (14 years ago)
Author:
pfeldman@chromium.org
Message:

2010-03-03 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Timothy Hatcher.

Web Inspector: Get rid of synchronous debuggerEnabled, profilerEnabled calls.

https://bugs.webkit.org/show_bug.cgi?id=32331

  • inspector/InspectorBackend.cpp:
  • inspector/InspectorBackend.h:
  • inspector/InspectorBackend.idl:
  • inspector/front-end/BreakpointsSidebarPane.js: (WebInspector.BreakpointsSidebarPane.prototype.addBreakpoint): (WebInspector.BreakpointsSidebarPane.prototype.removeBreakpoint): (WebInspector.BreakpointsSidebarPane.prototype._breakpointEnableChanged):
  • inspector/front-end/ProfilesPanel.js: (WebInspector.ProfilesPanel): (WebInspector.ProfilesPanel.prototype.profilerWasEnabled): (WebInspector.ProfilesPanel.prototype.profilerWasDisabled): (WebInspector.ProfilesPanel.prototype._updateInterface): (WebInspector.ProfilesPanel.prototype._enableProfiling): (WebInspector.ProfilesPanel.prototype._toggleProfiling):
  • inspector/front-end/ScriptsPanel.js: (WebInspector.ScriptsPanel): (WebInspector.ScriptsPanel.prototype.debuggerWasEnabled): (WebInspector.ScriptsPanel.prototype.debuggerWasDisabled): (WebInspector.ScriptsPanel.prototype.reset): (WebInspector.ScriptsPanel.prototype.canShowSourceLine): (WebInspector.ScriptsPanel.prototype._updateDebuggerButtons): (WebInspector.ScriptsPanel.prototype._enableDebugging): (WebInspector.ScriptsPanel.prototype._toggleDebugging):
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r55463 r55464  
     12010-03-03  Pavel Feldman  <pfeldman@chromium.org>
     2
     3        Reviewed by Timothy Hatcher.
     4
     5        Web Inspector: Get rid of synchronous debuggerEnabled, profilerEnabled calls.
     6
     7        https://bugs.webkit.org/show_bug.cgi?id=32331
     8
     9        * inspector/InspectorBackend.cpp:
     10        * inspector/InspectorBackend.h:
     11        * inspector/InspectorBackend.idl:
     12        * inspector/front-end/BreakpointsSidebarPane.js:
     13        (WebInspector.BreakpointsSidebarPane.prototype.addBreakpoint):
     14        (WebInspector.BreakpointsSidebarPane.prototype.removeBreakpoint):
     15        (WebInspector.BreakpointsSidebarPane.prototype._breakpointEnableChanged):
     16        * inspector/front-end/ProfilesPanel.js:
     17        (WebInspector.ProfilesPanel):
     18        (WebInspector.ProfilesPanel.prototype.profilerWasEnabled):
     19        (WebInspector.ProfilesPanel.prototype.profilerWasDisabled):
     20        (WebInspector.ProfilesPanel.prototype._updateInterface):
     21        (WebInspector.ProfilesPanel.prototype._enableProfiling):
     22        (WebInspector.ProfilesPanel.prototype._toggleProfiling):
     23        * inspector/front-end/ScriptsPanel.js:
     24        (WebInspector.ScriptsPanel):
     25        (WebInspector.ScriptsPanel.prototype.debuggerWasEnabled):
     26        (WebInspector.ScriptsPanel.prototype.debuggerWasDisabled):
     27        (WebInspector.ScriptsPanel.prototype.reset):
     28        (WebInspector.ScriptsPanel.prototype.canShowSourceLine):
     29        (WebInspector.ScriptsPanel.prototype._updateDebuggerButtons):
     30        (WebInspector.ScriptsPanel.prototype._enableDebugging):
     31        (WebInspector.ScriptsPanel.prototype._toggleDebugging):
     32
    1332010-03-03  Eric Carlson  <eric.carlson@apple.com>
    234
  • trunk/WebCore/inspector/InspectorBackend.cpp

    r55347 r55464  
    156156
    157157#if ENABLE(JAVASCRIPT_DEBUGGER)
    158 bool InspectorBackend::debuggerEnabled() const
    159 {
    160     if (m_inspectorController)
    161         return m_inspectorController->debuggerEnabled();
    162     return false;
    163 }
    164158
    165159void InspectorBackend::enableDebugger(bool always)
     
    236230
    237231#if ENABLE(JAVASCRIPT_DEBUGGER)
    238 bool InspectorBackend::profilerEnabled()
    239 {
    240     if (m_inspectorController)
    241         return m_inspectorController->profilerEnabled();
    242     return false;
    243 }
    244232
    245233void InspectorBackend::enableProfiler(bool always)
  • trunk/WebCore/inspector/InspectorBackend.h

    r55347 r55464  
    7575
    7676#if ENABLE(JAVASCRIPT_DEBUGGER)
    77     bool debuggerEnabled() const;
    7877    void enableDebugger(bool always);
    7978    void disableDebugger(bool always);
     
    9493    void stepOutOfFunctionInDebugger();
    9594
    96     bool profilerEnabled();
    9795    void enableProfiler(bool always);
    9896    void disableProfiler(bool always);
  • trunk/WebCore/inspector/InspectorBackend.idl

    r55347 r55464  
    5050
    5151#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
    52         boolean debuggerEnabled();
    5352        void enableDebugger(in boolean always);
    5453        void disableDebugger(in boolean always);
     
    6968        void setPauseOnExceptionsState(in long pauseOnExceptionsState);
    7069
    71         boolean profilerEnabled();
    7270        void enableProfiler(in boolean always);
    7371        void disableProfiler(in boolean always);
  • trunk/WebCore/inspector/InspectorController.cpp

    r55347 r55464  
    691691#endif
    692692
     693    if (m_profilerEnabled)
     694        m_frontend->profilerWasEnabled();
     695
    693696    m_frontend->populateInterface();
    694697
  • trunk/WebCore/inspector/front-end/BreakpointsSidebarPane.js

    r55071 r55464  
    6969        }
    7070
    71         if (!InspectorBackend.debuggerEnabled() || !breakpoint.sourceID)
    72             return;
    73 
    74         if (breakpoint.enabled)
    75             InspectorBackend.setBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.enabled, breakpoint.condition);
     71        InspectorBackend.setBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.enabled, breakpoint.condition);
    7672    },
    7773
     
    146142        }
    147143
    148         if (!InspectorBackend.debuggerEnabled() || !breakpoint.sourceID)
    149             return;
    150 
    151144        InspectorBackend.removeBreakpoint(breakpoint.sourceID, breakpoint.line);
    152145    },
     
    158151        var checkbox = breakpoint._breakpointListElement.firstChild;
    159152        checkbox.checked = breakpoint.enabled;
    160 
    161         if (!InspectorBackend.debuggerEnabled() || !breakpoint.sourceID)
    162             return;
    163 
    164153        InspectorBackend.setBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.enabled, breakpoint.condition);
    165154    },
  • trunk/WebCore/inspector/front-end/ProfilesPanel.js

    r53996 r55464  
    121121
    122122    this._profiles = [];
     123    this._profilerEnabled = Preferences.profilerAlwaysEnabled;
    123124    this.reset();
    124125}
     
    172173    profilerWasEnabled: function()
    173174    {
     175        if (this._profilerEnabled)
     176            return;
     177
     178        this._profilerEnabled = true;
    174179        this.reset();
    175180        this.populateInterface();
     
    178183    profilerWasDisabled: function()
    179184    {
     185        if (!this._profilerEnabled)
     186            return;
     187
     188        this._profilerEnabled = false;
    180189        this.reset();
    181190    },
     
    430439    {
    431440        // FIXME: Replace ProfileType-specific button visibility changes by a single ProfileType-agnostic "combo-button" visibility change.
    432         if (InspectorBackend.profilerEnabled()) {
     441        if (this._profilerEnabled) {
    433442            this.enableToggleButton.title = WebInspector.UIString("Profiling enabled. Click to disable.");
    434443            this.enableToggleButton.toggled = true;
     
    449458    _enableProfiling: function()
    450459    {
    451         if (InspectorBackend.profilerEnabled())
     460        if (this._profilerEnabled)
    452461            return;
    453462        this._toggleProfiling(this.panelEnablerView.alwaysEnabled);
     
    456465    _toggleProfiling: function(optionalAlways)
    457466    {
    458         if (InspectorBackend.profilerEnabled())
     467        if (this._profilerEnabled)
    459468            InspectorBackend.disableProfiler(true);
    460469        else
  • trunk/WebCore/inspector/front-end/ScriptsPanel.js

    r55241 r55464  
    196196    this._shortcuts[shortcut] = handler;
    197197
     198    this._debuggerEnabled = Preferences.debuggerAlwaysEnabled;
    198199    this.reset();
    199200}
     
    419420    debuggerWasEnabled: function()
    420421    {
     422        if (this._debuggerEnabled)
     423            return;
     424
     425        this._debuggerEnabled = true;
    421426        this.reset();
    422427    },
     
    424429    debuggerWasDisabled: function()
    425430    {
     431        if (!this._debuggerEnabled)
     432            return;
     433
     434        this._debuggerEnabled = false;
    426435        this.reset();
    427436    },
     
    434443        this.searchCanceled();
    435444
    436         if (!InspectorBackend.debuggerEnabled()) {
     445        if (!this._debuggerEnabled) {
    437446            this._paused = false;
    438447            this._waitingToPause = false;
     
    492501    canShowSourceLine: function(url, line)
    493502    {
    494         if (!InspectorBackend.debuggerEnabled())
     503        if (!this._debuggerEnabled)
    495504            return false;
    496505        return !!this._scriptOrResourceForURLAndLine(url, line);
     
    798807    _updateDebuggerButtons: function()
    799808    {
    800         if (InspectorBackend.debuggerEnabled()) {
     809        if (this._debuggerEnabled) {
    801810            this.enableToggleButton.title = WebInspector.UIString("Debugging enabled. Click to disable.");
    802811            this.enableToggleButton.toggled = true;
     
    877886    _enableDebugging: function()
    878887    {
    879         if (InspectorBackend.debuggerEnabled())
     888        if (this._debuggerEnabled)
    880889            return;
    881890        this._toggleDebugging(this.panelEnablerView.alwaysEnabled);
     
    888897        this._stepping = false;
    889898
    890         if (InspectorBackend.debuggerEnabled())
     899        if (this._debuggerEnabled)
    891900            InspectorBackend.disableDebugger(true);
    892901        else
  • trunk/WebCore/inspector/front-end/Settings.js

    r54702 r55464  
    3939    showMissingLocalizedStrings: false,
    4040    samplingCPUProfiler: false,
    41     showColorNicknames: true
     41    showColorNicknames: true,
     42    debuggerAlwaysEnabled: false,
     43    profilerAlwaysEnabled: false
    4244}
    4345
  • trunk/WebCore/inspector/front-end/inspector.js

    r55347 r55464  
    633633            var profileString = WebInspector.ProfileType.URLRegExp.exec(anchor.href);
    634634            if (profileString)
    635                 WebInspector.showProfile(anchor.href, anchor.lineNumber);
     635                WebInspector.showProfileForURL(anchor.href);
    636636        }
    637637    }
  • trunk/WebKit/chromium/src/js/DevTools.js

    r55364 r55464  
    201201    Preferences.samplingCPUProfiler = true;
    202202    Preferences.heapProfilerPresent = true;
     203    Preferences.debuggerAlwaysEnabled = true;
     204    Preferences.profilerAlwaysEnabled = true;
    203205    oldLoaded.call(this);
    204206
Note: See TracChangeset for help on using the changeset viewer.