Changeset 76770 in webkit


Ignore:
Timestamp:
Jan 27, 2011 12:36:21 AM (13 years ago)
Author:
yurys@chromium.org
Message:

2011-01-26 Yury Semikhatsky <yurys@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: store all settings related to the agents on the frontend side
https://bugs.webkit.org/show_bug.cgi?id=53174

  • CMakeLists.txt:
  • GNUmakefile.am:
  • WebCore.exp.in:
  • WebCore.gypi:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • inspector/Inspector.idl:
  • inspector/InspectorAgent.cpp: profiler and debugger enablement state is now stored on the front-end side and will be pushed to the backend when the frontend is loaded. (WebCore::InspectorAgent::InspectorAgent): (WebCore::InspectorAgent::disconnectFrontend): (WebCore::InspectorAgent::restoreDebugger): (WebCore::InspectorAgent::restoreProfiler): (WebCore::InspectorAgent::enableProfiler): (WebCore::InspectorAgent::disableProfiler): (WebCore::InspectorAgent::showAndEnableDebugger): (WebCore::InspectorAgent::enableDebugger): (WebCore::InspectorAgent::disableDebugger):
  • inspector/InspectorAgent.h:
  • inspector/InspectorConsoleAgent.cpp: XHR failures will be logged to the console only if the front-end was opened during current browser session and XHR logging is turned on there. (WebCore::InspectorConsoleAgent::setMonitoringXHREnabled): (WebCore::InspectorConsoleAgent::setConsoleMessagesEnabled):
  • inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::identifierForInitialRequestImpl): (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCacheImpl):
  • inspector/InspectorProfilerAgent.cpp: (WebCore::InspectorProfilerAgent::enable): (WebCore::InspectorProfilerAgent::startUserInitiatedProfiling):
  • inspector/InspectorProfilerAgent.h:
  • inspector/InspectorSettings.cpp: Removed.
  • inspector/InspectorSettings.h: Removed.
  • inspector/InspectorState.cpp: (WebCore::InspectorState::InspectorState):
  • inspector/InspectorState.h:
  • inspector/front-end/ConsoleView.js: (WebInspector.ConsoleView.prototype._registerConsoleDomainDispatcher.dispatcher.consoleMessagesCleared): (WebInspector.ConsoleView.prototype._registerConsoleDomainDispatcher): (WebInspector.ConsoleView.prototype._handleContextMenuEvent.itemAction): (WebInspector.ConsoleView.prototype._handleContextMenuEvent):
  • inspector/front-end/ProfilesPanel.js: (WebInspector.ProfilesPanel.prototype._toggleProfiling):
  • inspector/front-end/ScriptsPanel.js: (WebInspector.ScriptsPanel.prototype._toggleDebugging):
  • inspector/front-end/Settings.js: (WebInspector.Settings):
  • inspector/front-end/inspector.js:
Location:
trunk/Source/WebCore
Files:
2 deleted
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r76661 r76770  
    11741174    inspector/InspectorResourceAgent.cpp
    11751175    inspector/InspectorRuntimeAgent.cpp
    1176     inspector/InspectorSettings.cpp
    11771176    inspector/InspectorState.cpp
    11781177    inspector/InspectorStyleSheet.cpp
  • trunk/Source/WebCore/ChangeLog

    r76768 r76770  
     12011-01-26  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: store all settings related to the agents on the frontend side
     6        https://bugs.webkit.org/show_bug.cgi?id=53174
     7
     8        * CMakeLists.txt:
     9        * GNUmakefile.am:
     10        * WebCore.exp.in:
     11        * WebCore.gypi:
     12        * WebCore.pro:
     13        * WebCore.vcproj/WebCore.vcproj:
     14        * WebCore.xcodeproj/project.pbxproj:
     15        * inspector/Inspector.idl:
     16        * inspector/InspectorAgent.cpp: profiler and debugger enablement state is now stored
     17        on the front-end side and will be pushed to the backend when the frontend is loaded.
     18        (WebCore::InspectorAgent::InspectorAgent):
     19        (WebCore::InspectorAgent::disconnectFrontend):
     20        (WebCore::InspectorAgent::restoreDebugger):
     21        (WebCore::InspectorAgent::restoreProfiler):
     22        (WebCore::InspectorAgent::enableProfiler):
     23        (WebCore::InspectorAgent::disableProfiler):
     24        (WebCore::InspectorAgent::showAndEnableDebugger):
     25        (WebCore::InspectorAgent::enableDebugger):
     26        (WebCore::InspectorAgent::disableDebugger):
     27        * inspector/InspectorAgent.h:
     28        * inspector/InspectorConsoleAgent.cpp: XHR failures will be logged to the console only
     29        if the front-end was opened during current browser session and XHR logging is turned on
     30        there.
     31        (WebCore::InspectorConsoleAgent::setMonitoringXHREnabled):
     32        (WebCore::InspectorConsoleAgent::setConsoleMessagesEnabled):
     33        * inspector/InspectorInstrumentation.cpp:
     34        (WebCore::InspectorInstrumentation::identifierForInitialRequestImpl):
     35        (WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCacheImpl):
     36        * inspector/InspectorProfilerAgent.cpp:
     37        (WebCore::InspectorProfilerAgent::enable):
     38        (WebCore::InspectorProfilerAgent::startUserInitiatedProfiling):
     39        * inspector/InspectorProfilerAgent.h:
     40        * inspector/InspectorSettings.cpp: Removed.
     41        * inspector/InspectorSettings.h: Removed.
     42        * inspector/InspectorState.cpp:
     43        (WebCore::InspectorState::InspectorState):
     44        * inspector/InspectorState.h:
     45        * inspector/front-end/ConsoleView.js:
     46        (WebInspector.ConsoleView.prototype._registerConsoleDomainDispatcher.dispatcher.consoleMessagesCleared):
     47        (WebInspector.ConsoleView.prototype._registerConsoleDomainDispatcher):
     48        (WebInspector.ConsoleView.prototype._handleContextMenuEvent.itemAction):
     49        (WebInspector.ConsoleView.prototype._handleContextMenuEvent):
     50        * inspector/front-end/ProfilesPanel.js:
     51        (WebInspector.ProfilesPanel.prototype._toggleProfiling):
     52        * inspector/front-end/ScriptsPanel.js:
     53        (WebInspector.ScriptsPanel.prototype._toggleDebugging):
     54        * inspector/front-end/Settings.js:
     55        (WebInspector.Settings):
     56        * inspector/front-end/inspector.js:
     57
    1582011-01-27  Dan Bernstein  <mitz@apple.com>
    259
  • trunk/Source/WebCore/GNUmakefile.am

    r76661 r76770  
    19951995        Source/WebCore/inspector/InspectorRuntimeAgent.cpp \
    19961996        Source/WebCore/inspector/InspectorRuntimeAgent.h \
    1997         Source/WebCore/inspector/InspectorSettings.cpp \
    1998         Source/WebCore/inspector/InspectorSettings.h \
    19991997        Source/WebCore/inspector/InspectorState.cpp \
    20001998        Source/WebCore/inspector/InspectorState.h \
  • trunk/Source/WebCore/WebCore.exp.in

    r76756 r76770  
    13691369__ZN7WebCore14InspectorAgent12ConsolePanelE
    13701370__ZN7WebCore14InspectorAgent13ProfilesPanelE
    1371 __ZN7WebCore14InspectorAgent14enableProfilerEbb
    1372 __ZN7WebCore14InspectorAgent15disableDebuggerEb
    1373 __ZN7WebCore14InspectorAgent15disableProfilerEb
     1371__ZN7WebCore14InspectorAgent14enableProfilerEv
     1372__ZN7WebCore14InspectorAgent15disableDebuggerEv
     1373__ZN7WebCore14InspectorAgent15disableProfilerEv
    13741374__ZN7WebCore14InspectorAgent18disconnectFrontendEv
    13751375__ZN7WebCore14InspectorAgent20stopTimelineProfilerEv
  • trunk/Source/WebCore/WebCore.gypi

    r76661 r76770  
    20502050            'inspector/InspectorRuntimeAgent.h',
    20512051            'inspector/InspectorState.cpp',
    2052             'inspector/InspectorSettings.h',
    2053             'inspector/InspectorSettings.cpp',
    20542052            'inspector/InspectorState.h',
    20552053            'inspector/InspectorStyleSheet.cpp',
  • trunk/Source/WebCore/WebCore.pro

    r76661 r76770  
    10631063    inspector/InspectorResourceAgent.cpp \
    10641064    inspector/InspectorRuntimeAgent.cpp \
    1065     inspector/InspectorSettings.cpp \
    10661065    inspector/InspectorState.cpp \
    10671066    inspector/InspectorStyleSheet.cpp \
     
    19631962    inspector/InspectorResourceAgent.h \
    19641963    inspector/InspectorRuntimeAgent.h \
    1965     inspector/InspectorSettings.h \
    19661964    inspector/InspectorState.h \
    19671965    inspector/InspectorStyleSheet.h \
  • trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj

    r76661 r76770  
    6525565255                        </File>
    6525665256                        <File
    65257                                 RelativePath="..\inspector\InspectorSettings.cpp"
    65258                                 >
    65259                         </File>
    65260                         <File
    65261                                 RelativePath="..\inspector\InspectorSettings.h"
    65262                                 >
    65263                         </File>
    65264                         <File
    6526565257                                RelativePath="..\inspector\InspectorState.cpp"
    6526665258                                >
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r76745 r76770  
    16601660                7A24587B1021EAF4000A00AA /* InspectorDOMAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A2458791021EAF4000A00AA /* InspectorDOMAgent.cpp */; };
    16611661                7A24587C1021EAF4000A00AA /* InspectorDOMAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A24587A1021EAF4000A00AA /* InspectorDOMAgent.h */; settings = {ATTRIBUTES = (Private, ); }; };
    1662                 7A5640BF12DF9E5E00F4536D /* InspectorSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A5640BD12DF9E5E00F4536D /* InspectorSettings.cpp */; };
    1663                 7A5640C012DF9E5E00F4536D /* InspectorSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A5640BE12DF9E5E00F4536D /* InspectorSettings.h */; };
    16641662                7A674BDB0F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */; };
    16651663                7A674BDC0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */; };
     
    81048102                7A563E5412DE32B000F4536D /* InjectedScriptSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedScriptSource.h; sourceTree = "<group>"; };
    81058103                7A563F9512DF5C9100F4536D /* InjectedScriptSource.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = InjectedScriptSource.js; sourceTree = "<group>"; };
    8106                 7A5640BD12DF9E5E00F4536D /* InspectorSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorSettings.cpp; sourceTree = "<group>"; };
    8107                 7A5640BE12DF9E5E00F4536D /* InspectorSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorSettings.h; sourceTree = "<group>"; };
    81088104                7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroupLoadDeferrer.cpp; sourceTree = "<group>"; };
    81098105                7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroupLoadDeferrer.h; sourceTree = "<group>"; };
     
    1302713023                                7AA365ED12E7265400DCA242 /* InspectorRuntimeAgent.cpp */,
    1302813024                                7AF11A5912E727490061F23C /* InspectorRuntimeAgent.h */,
    13029                                 7A5640BD12DF9E5E00F4536D /* InspectorSettings.cpp */,
    13030                                 7A5640BE12DF9E5E00F4536D /* InspectorSettings.h */,
    1303113025                                4FA3B908125CD12100300BAD /* InspectorState.cpp */,
    1303213026                                4FA3B909125CD12200300BAD /* InspectorState.h */,
     
    2092920923                                82AB1776125C826700C5069D /* InspectorResourceAgent.h in Headers */,
    2093020924                                7AF11A5A12E727490061F23C /* InspectorRuntimeAgent.h in Headers */,
    20931                                 7A5640C012DF9E5E00F4536D /* InspectorSettings.h in Headers */,
    2093220925                                4FA3B90B125CD12200300BAD /* InspectorState.h in Headers */,
    2093320926                                82AB1774125C826700C5069D /* InspectorStyleSheet.h in Headers */,
     
    2367323666                                82AB1775125C826700C5069D /* InspectorResourceAgent.cpp in Sources */,
    2367423667                                7AA365EE12E7265400DCA242 /* InspectorRuntimeAgent.cpp in Sources */,
    23675                                 7A5640BF12DF9E5E00F4536D /* InspectorSettings.cpp in Sources */,
    2367623668                                4FA3B90A125CD12200300BAD /* InspectorState.cpp in Sources */,
    2367723669                                82AB1773125C826700C5069D /* InspectorStyleSheet.cpp in Sources */,
  • trunk/Source/WebCore/bindings/js/ScriptDebugServer.cpp

    r76518 r76770  
    118118}
    119119
    120 bool ScriptDebugServer::isDebuggerAlwaysEnabled()
    121 {
    122     return false;
    123 }
    124 
    125120bool ScriptDebugServer::hasListenersInterestedInPage(Page* page)
    126121{
  • trunk/Source/WebCore/bindings/js/ScriptDebugServer.h

    r76518 r76770  
    9494    JavaScriptCallFrame* currentCallFrame();
    9595
    96     bool isDebuggerAlwaysEnabled();
    97 
    9896private:
    9997    typedef HashSet<ScriptDebugListener*> ListenerSet;
  • trunk/Source/WebCore/bindings/js/ScriptProfiler.cpp

    r65797 r76770  
    4747}
    4848
    49 bool ScriptProfiler::isProfilerAlwaysEnabled()
    50 {
    51     return false;
    52 }
    53 
    5449} // namespace WebCore
    5550
  • trunk/Source/WebCore/bindings/js/ScriptProfiler.h

    r76597 r76770  
    5151    static PassRefPtr<ScriptProfile> stop(ScriptState* state, const String& title);
    5252    static PassRefPtr<ScriptHeapSnapshot> takeHeapSnapshot(const String&, HeapSnapshotProgress*) { return 0; }
    53     static bool isProfilerAlwaysEnabled();
    5453};
    5554
  • trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp

    r76509 r76770  
    343343}
    344344
    345 bool ScriptDebugServer::isDebuggerAlwaysEnabled()
    346 {
    347     return m_enabled;
    348 }
    349 
    350345void ScriptDebugServer::interruptAndRun(PassOwnPtr<Task> task)
    351346{
  • trunk/Source/WebCore/bindings/v8/ScriptDebugServer.h

    r76509 r76770  
    100100
    101101    void setEnabled(bool);
    102     bool isDebuggerAlwaysEnabled();
    103102
    104103    class Task {
  • trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp

    r76597 r76770  
    9191}
    9292
    93 bool ScriptProfiler::isProfilerAlwaysEnabled()
    94 {
    95     return true;
    96 }
    97 
    9893} // namespace WebCore
  • trunk/Source/WebCore/bindings/v8/ScriptProfiler.h

    r76597 r76770  
    5757    static PassRefPtr<ScriptProfile> stop(ScriptState* state, const String& title);
    5858    static PassRefPtr<ScriptHeapSnapshot> takeHeapSnapshot(const String& title, HeapSnapshotProgress*);
    59     static bool isProfilerAlwaysEnabled();
    6059};
    6160
  • trunk/Source/WebCore/inspector/Inspector.idl

    r76680 r76770  
    9595        [notify, domain=Console] void consoleMessagesCleared();
    9696        [domain=Console] void setMonitoringXHREnabled(in boolean enabled);
    97         [notify, domain=Console] void monitoringXHRStateChanged(out boolean enabled);
    9897
    9998        ///////////////////////////////////////////////////////////////////////
     
    240239        ///////////////////////////////////////////////////////////////////////
    241240
    242         [domain=Inspector] void enableDebugger(in boolean always);
    243         [domain=Inspector] void disableDebugger(in boolean always);
     241        [domain=Inspector] void enableDebugger();
     242        [domain=Inspector] void disableDebugger();
    244243
    245244        [notify, domain=Debugger] void debuggerWasEnabled();
     
    291290        ///////////////////////////////////////////////////////////////////////
    292291
    293         [domain=Inspector] void enableProfiler(in boolean always);
    294         [domain=Inspector] void disableProfiler(in boolean always);
     292        [domain=Inspector] void enableProfiler();
     293        [domain=Inspector] void disableProfiler();
    295294        [notify, domain=Profiler] void profilerWasEnabled();
    296295        [notify, domain=Profiler] void profilerWasDisabled();
  • trunk/Source/WebCore/inspector/InspectorAgent.cpp

    r76594 r76770  
    7373#include "InspectorResourceAgent.h"
    7474#include "InspectorRuntimeAgent.h"
    75 #include "InspectorSettings.h"
    7675#include "InspectorState.h"
    7776#include "InspectorTimelineAgent.h"
     
    147146    , m_consoleAgent(new InspectorConsoleAgent(this))
    148147#if ENABLE(JAVASCRIPT_DEBUGGER)
    149     , m_attachDebuggerWhenShown(false)
    150148    , m_profilerAgent(InspectorProfilerAgent::create(this))
    151149#endif
     
    451449    // remember this state to re-enable debugger on the next window
    452450    // opening.
    453     bool debuggerWasEnabled = debuggerEnabled();
    454451    disableDebugger();
    455     m_attachDebuggerWhenShown = debuggerWasEnabled;
    456452#endif
    457453    setSearchingForNode(false);
     
    571567    ASSERT(m_frontend);
    572568#if ENABLE(JAVASCRIPT_DEBUGGER)
    573     if (InspectorDebuggerAgent::isDebuggerAlwaysEnabled() || m_attachDebuggerWhenShown || m_settings->getBoolean(InspectorSettings::DebuggerAlwaysEnabled)) {
    574         enableDebugger(false);
    575         m_attachDebuggerWhenShown = false;
    576     }
     569    if (m_state->getBoolean(InspectorState::debuggerEnabled))
     570        enableDebugger();
    577571#endif
    578572}
     
    583577#if ENABLE(JAVASCRIPT_DEBUGGER)
    584578    m_profilerAgent->setFrontend(m_frontend.get());
    585     if (!ScriptProfiler::isProfilerAlwaysEnabled() && m_settings->getBoolean(InspectorSettings::ProfilerAlwaysEnabled))
     579    if (m_state->getBoolean(InspectorState::profilerEnabled))
    586580        enableProfiler();
    587581    if (action == ProfilerRestoreResetAgent)
     
    704698        }
    705699    }
    706 }
    707 
    708 void InspectorAgent::ensureSettingsLoaded()
    709 {
    710     if (m_settings)
    711         return;
    712     m_settings = new InspectorSettings(m_client);
    713     m_state->setBoolean(InspectorState::monitoringXHR, m_settings->getBoolean(InspectorSettings::MonitoringXHREnabled));
    714700}
    715701
     
    993979}
    994980
    995 void InspectorAgent::enableProfiler(bool always, bool skipRecompile)
    996 {
    997     if (always)
    998         m_settings->setBoolean(InspectorSettings::ProfilerAlwaysEnabled, true);
    999     m_profilerAgent->enable(skipRecompile);
    1000 }
    1001 
    1002 void InspectorAgent::disableProfiler(bool always)
    1003 {
    1004     if (always)
    1005         m_settings->setBoolean(InspectorSettings::ProfilerAlwaysEnabled, false);
     981void InspectorAgent::enableProfiler()
     982{
     983    if (profilerEnabled())
     984        return;
     985    m_state->setBoolean(InspectorState::profilerEnabled, true);
     986    m_profilerAgent->enable(false);
     987}
     988
     989void InspectorAgent::disableProfiler()
     990{
     991    m_state->setBoolean(InspectorState::profilerEnabled, false);
    1006992    m_profilerAgent->disable();
    1007993}
     
    10181004
    10191005    if (!m_frontend) {
    1020         m_attachDebuggerWhenShown = true;
     1006        m_state->setBoolean(InspectorState::debuggerEnabled, true);
    10211007        showPanel(ScriptsPanel);
    10221008    } else
    1023         enableDebugger(false);
    1024 }
    1025 
    1026 void InspectorAgent::enableDebugger(bool always)
    1027 {
    1028     ASSERT(!debuggerEnabled());
    1029     if (always)
    1030         m_settings->setBoolean(InspectorSettings::DebuggerAlwaysEnabled, true);
    1031 
     1009        enableDebugger();
     1010}
     1011
     1012void InspectorAgent::enableDebugger()
     1013{
     1014    if (debuggerEnabled())
     1015        return;
     1016    m_state->setBoolean(InspectorState::debuggerEnabled, true);
    10321017    ASSERT(m_inspectedPage);
    10331018
     
    10381023}
    10391024
    1040 void InspectorAgent::disableDebugger(bool always)
    1041 {
    1042     if (!enabled())
    1043         return;
    1044 
    1045     if (always)
    1046         m_settings->setBoolean(InspectorSettings::DebuggerAlwaysEnabled, false);
    1047 
     1025void InspectorAgent::disableDebugger()
     1026{
     1027    if (!enabled())
     1028        return;
    10481029    ASSERT(m_inspectedPage);
    1049 
    10501030    m_debuggerAgent.clear();
    10511031    m_browserDebuggerAgent.clear();
    10521032
    1053     m_attachDebuggerWhenShown = false;
    1054 
    1055     if (m_frontend)
     1033    if (m_frontend) {
    10561034        m_frontend->debuggerWasDisabled();
     1035        m_state->setBoolean(InspectorState::debuggerEnabled, false);
     1036    }
    10571037}
    10581038
  • trunk/Source/WebCore/inspector/InspectorAgent.h

    r76594 r76770  
    7575class InspectorResourceAgent;
    7676class InspectorRuntimeAgent;
    77 class InspectorSettings;
    7877class InspectorState;
    7978class InspectorStorageAgent;
     
    238237    void stopProfiling() { stopUserInitiatedProfiling(); }
    239238    void stopUserInitiatedProfiling();
    240     void enableProfiler(bool always = false, bool skipRecompile = false);
    241     void disableProfiler(bool always = false);
     239    void enableProfiler();
     240    void disableProfiler();
    242241    bool profilerEnabled() const;
    243242
    244243    void showAndEnableDebugger();
    245     void enableDebugger(bool always);
    246     void disableDebugger(bool always = false);
     244    void enableDebugger();
     245    void disableDebugger();
    247246    bool debuggerEnabled() const { return m_debuggerAgent; }
    248247    void resume();
     
    259258
    260259    InspectorState* state() { return m_state.get(); }
    261     InspectorSettings* settings() { return m_settings.get(); }
    262260
    263261    // InspectorAgent API
     
    270268
    271269    // InspectorInstrumentation API
    272     void ensureSettingsLoaded();
    273270    void willSendRequest(ResourceRequest&);
    274271
     
    315312    OwnPtr<InspectorTimelineAgent> m_timelineAgent;
    316313    OwnPtr<InspectorState> m_state;
    317     OwnPtr<InspectorSettings> m_settings;
    318314
    319315#if ENABLE(OFFLINE_WEB_APPLICATIONS)
     
    348344    String m_inspectorExtensionAPI;
    349345#if ENABLE(JAVASCRIPT_DEBUGGER)
    350     bool m_attachDebuggerWhenShown;
    351346    OwnPtr<InspectorDebuggerAgent> m_debuggerAgent;
    352347    OwnPtr<InspectorBrowserDebuggerAgent> m_browserDebuggerAgent;
  • trunk/Source/WebCore/inspector/InspectorConsoleAgent.cpp

    r76459 r76770  
    3434#include "InspectorDOMAgent.h"
    3535#include "InspectorFrontend.h"
    36 #include "InspectorSettings.h"
    3736#include "InspectorState.h"
    3837#include "ResourceError.h"
     
    195194{
    196195    m_inspectorAgent->state()->setBoolean(InspectorState::monitoringXHR, enabled);
    197     m_inspectorAgent->settings()->setBoolean(InspectorSettings::MonitoringXHREnabled, enabled);
    198     if (m_frontend)
    199         m_frontend->monitoringXHRStateChanged(enabled);
    200196}
    201197
     
    206202        return;
    207203
    208     m_frontend->monitoringXHRStateChanged(m_inspectorAgent->state()->getBoolean(InspectorState::monitoringXHR));
    209204    if (m_expiredConsoleMessageCount)
    210205        m_frontend->updateConsoleMessageExpiredCount(m_expiredConsoleMessageCount);
  • trunk/Source/WebCore/inspector/InspectorDebuggerAgent.cpp

    r76680 r76770  
    6767}
    6868
    69 bool InspectorDebuggerAgent::isDebuggerAlwaysEnabled()
    70 {
    71     return ScriptDebugServer::shared().isDebuggerAlwaysEnabled();
    72 }
    73 
    7469void InspectorDebuggerAgent::activateBreakpoints()
    7570{
  • trunk/Source/WebCore/inspector/InspectorDebuggerAgent.h

    r76680 r76770  
    6161    virtual ~InspectorDebuggerAgent();
    6262
    63     static bool isDebuggerAlwaysEnabled();
    64 
    6563    void setAllJavaScriptBreakpoints(PassRefPtr<InspectorObject>);
    6664    void inspectedURLChanged(const String& url);
  • trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp

    r76493 r76770  
    377377    if (!ic->enabled())
    378378        return;
    379     ic->ensureSettingsLoaded();
    380379
    381380    if (InspectorResourceAgent* resourceAgent = retrieveResourceAgent(ic))
     
    402401    if (!ic->enabled())
    403402        return;
    404     ic->ensureSettingsLoaded();
    405403    if (InspectorResourceAgent* resourceAgent = retrieveResourceAgent(ic))
    406404        resourceAgent->didLoadResourceFromMemoryCache(loader, cachedResource);
  • trunk/Source/WebCore/inspector/InspectorProfilerAgent.cpp

    r76597 r76770  
    6666    : m_inspectorAgent(inspectorAgent)
    6767    , m_frontend(0)
    68     , m_enabled(ScriptProfiler::isProfilerAlwaysEnabled())
     68    , m_enabled(false)
    6969    , m_recordingUserInitiatedProfile(false)
    7070    , m_currentUserInitiatedProfileNumber(-1)
     
    230230        return;
    231231    if (!enabled()) {
    232         enable(false);
     232        enable(true);
    233233        ScriptDebugServer::shared().recompileAllJSFunctions();
    234234    }
  • trunk/Source/WebCore/inspector/InspectorState.cpp

    r76581 r76770  
    4343    registerBoolean(timelineProfilerEnabled, false);
    4444    registerBoolean(searchingForNode, false);
     45    registerBoolean(debuggerEnabled, false);
     46    registerBoolean(profilerEnabled, false);
    4547    registerObject(javaScriptBreakpoints);
    4648    registerObject(browserBreakpoints);
  • trunk/Source/WebCore/inspector/InspectorState.h

    r76581 r76770  
    4949        searchingForNode,
    5050        consoleMessagesEnabled,
     51        profilerEnabled,
    5152        userInitiatedProfiling,
     53        debuggerEnabled,
    5254        javaScriptBreakpoints,
    5355        browserBreakpoints,
  • trunk/Source/WebCore/inspector/front-end/ConsoleView.js

    r76680 r76770  
    151151                console.clearMessages();
    152152            },
    153 
    154             monitoringXHRStateChanged: function(enabled)
    155             {
    156                 console._monitoringXHREnabled = enabled;
    157             }
    158153        }
    159154        InspectorBackend.registerDomainDispatcher("Console", dispatcher);
     
    419414        }
    420415
    421         var itemAction = InspectorBackend.setMonitoringXHREnabled.bind(InspectorBackend, !this._monitoringXHREnabled);
     416        var itemAction = function () {
     417            WebInspector.settings.monitoringXHREnabled = !WebInspector.settings.monitoringXHREnabled;
     418            InspectorBackend.setMonitoringXHREnabled(WebInspector.settings.monitoringXHREnabled);
     419        }.bind(this);
    422420        var contextMenu = new WebInspector.ContextMenu();
    423         contextMenu.appendCheckboxItem(WebInspector.UIString("XMLHttpRequest logging"), itemAction, this._monitoringXHREnabled);
     421        contextMenu.appendCheckboxItem(WebInspector.UIString("XMLHttpRequest logging"), itemAction, WebInspector.settings.monitoringXHREnabled)
    424422        contextMenu.appendItem(WebInspector.UIString("Clear Console"), this.requestClearMessages.bind(this));
    425423        contextMenu.show(event);
  • trunk/Source/WebCore/inspector/front-end/ProfilesPanel.js

    r76597 r76770  
    581581    _toggleProfiling: function(optionalAlways)
    582582    {
    583         if (this._profilerEnabled)
     583        if (this._profilerEnabled) {
     584            WebInspector.settings.profilerEnabled = false;
    584585            InspectorBackend.disableProfiler(true);
    585         else
    586             InspectorBackend.enableProfiler(!!optionalAlways);
     586        } else {
     587            WebInspector.settings.profilerEnabled = !!optionalAlways;
     588            InspectorBackend.enableProfiler();
     589        }
    587590    },
    588591
  • trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js

    r76681 r76770  
    802802        this._stepping = false;
    803803
    804         if (this._debuggerEnabled)
    805             InspectorBackend.disableDebugger(true);
    806         else
    807             InspectorBackend.enableDebugger(!!optionalAlways);
     804        if (this._debuggerEnabled) {
     805            WebInspector.settings.debuggerEnabled = false;
     806            InspectorBackend.disableDebugger();
     807        } else {
     808            WebInspector.settings.debuggerEnabled = !!optionalAlways;
     809            InspectorBackend.enableDebugger();
     810        }
    808811    },
    809812
  • trunk/Source/WebCore/inspector/front-end/Settings.js

    r76597 r76770  
    5959    this.installApplicationSetting("colorFormat", "hex");
    6060    this.installApplicationSetting("consoleHistory", []);
     61    this.installApplicationSetting("debuggerEnabled", false);
     62    this.installApplicationSetting("profilerEnabled", false);
    6163    this.installApplicationSetting("eventListenersFilter", "all");
     64    this.installApplicationSetting("lastActivePanel", "elements");
    6265    this.installApplicationSetting("lastViewedScriptFile", "application");
     66    this.installApplicationSetting("monitoringXHREnabled", false);
     67    this.installApplicationSetting("pauseOnExceptionState", WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions);
    6368    this.installApplicationSetting("resourcesLargeRows", true);
    6469    this.installApplicationSetting("resourcesSortOptions", {timeOption: "responseTime", sizeOption: "transferSize"});
     
    6772    this.installApplicationSetting("showUserAgentStyles", true);
    6873    this.installApplicationSetting("watchExpressions", []);
    69     this.installApplicationSetting("lastActivePanel", "elements");
    70     this.installApplicationSetting("pauseOnExceptionState", WebInspector.ScriptsPanel.PauseOnExceptionsState.DontPauseOnExceptions);
    7174
    7275    this.installProjectSetting("breakpoints", {});
  • trunk/Source/WebCore/inspector/front-end/inspector.js

    r76597 r76770  
    601601    }
    602602    InspectorBackend.populateScriptObjects(onPopulateScriptObjects);
     603
     604    if (Preferences.debuggerAlwaysEnabled || WebInspector.settings.debuggerEnabled)
     605        InspectorBackend.enableDebugger();
     606    if (Preferences.profilerAlwaysEnabled || WebInspector.settings.profilerEnabled)
     607        InspectorBackend.enableProfiler();
     608    if (WebInspector.settings.monitoringXHREnabled)
     609        InspectorBackend.setMonitoringXHREnabled(true);
    603610
    604611    InspectorBackend.setConsoleMessagesEnabled(true);
Note: See TracChangeset for help on using the changeset viewer.