Changeset 64540 in webkit


Ignore:
Timestamp:
Aug 3, 2010 2:33:30 AM (14 years ago)
Author:
yurys@chromium.org
Message:

2010-08-02 Yury Semikhatsky <yurys@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: debugger code should serialize call frames to InspectorObjects instead of SerializedScriptValues.
https://bugs.webkit.org/show_bug.cgi?id=43339

No new tests. Refactoring.

  • inspector/InjectedScript.cpp: (WebCore::InjectedScript::callFrames):
  • inspector/InjectedScript.h:
  • inspector/Inspector.idl:
  • inspector/InspectorController.cpp: (WebCore::InspectorController::editScriptSource): (WebCore::InspectorController::getScriptSource): (WebCore::InspectorController::currentCallFrames): (WebCore::InspectorController::didPause):
  • inspector/InspectorController.h:
  • inspector/front-end/InspectorBackendStub.js: (WebInspector.InspectorBackendStub):
Location:
trunk/WebCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r64539 r64540  
     12010-08-02  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Reviewed by Pavel Feldman.
     4
     5        Web Inspector: debugger code should serialize call frames to InspectorObjects instead of SerializedScriptValues.
     6        https://bugs.webkit.org/show_bug.cgi?id=43339
     7
     8        No new tests. Refactoring.
     9
     10        * inspector/InjectedScript.cpp:
     11        (WebCore::InjectedScript::callFrames):
     12        * inspector/InjectedScript.h:
     13        * inspector/Inspector.idl:
     14        * inspector/InspectorController.cpp:
     15        (WebCore::InspectorController::editScriptSource):
     16        (WebCore::InspectorController::getScriptSource):
     17        (WebCore::InspectorController::currentCallFrames):
     18        (WebCore::InspectorController::didPause):
     19        * inspector/InspectorController.h:
     20        * inspector/front-end/InspectorBackendStub.js:
     21        (WebInspector.InspectorBackendStub):
     22
    1232010-08-03  Nikolas Zimmermann  <nzimmermann@rim.com>
    224
  • trunk/WebCore/bindings/js/ScriptValue.cpp

    r64015 r64540  
    144144        return inspectorObject;
    145145    }
     146    ASSERT_NOT_REACHED();
    146147    return 0;
    147148}
  • trunk/WebCore/bindings/v8/ScriptValue.cpp

    r64464 r64540  
    114114        return inspectorObject;
    115115    }
     116    ASSERT_NOT_REACHED();
    116117    return 0;
    117118}
  • trunk/WebCore/inspector/InjectedScript.cpp

    r63891 r64540  
    6666
    6767#if ENABLE(JAVASCRIPT_DEBUGGER)
    68 PassRefPtr<SerializedScriptValue> InjectedScript::callFrames()
     68PassRefPtr<InspectorValue> InjectedScript::callFrames()
    6969{
    7070    ASSERT(!hasNoValue());
    7171    ScriptFunctionCall function(m_injectedScriptObject, "callFrames");
    7272    ScriptValue callFramesValue = function.call();
    73     return callFramesValue.serialize(m_injectedScriptObject.scriptState());
     73    return callFramesValue.toInspectorValue(m_injectedScriptObject.scriptState());
    7474}
    7575#endif
  • trunk/WebCore/inspector/InjectedScript.h

    r63891 r64540  
    5252    void dispatch(long callId, const String& methodName, const String& arguments, bool async, RefPtr<SerializedScriptValue>* result, bool* hadException);
    5353#if ENABLE(JAVASCRIPT_DEBUGGER)
    54     PassRefPtr<SerializedScriptValue> callFrames();
     54    PassRefPtr<InspectorValue> callFrames();
    5555#endif
    5656    PassRefPtr<InspectorValue> wrapForConsole(ScriptValue);
  • trunk/WebCore/inspector/Inspector.idl

    r64536 r64540  
    4545        [notify] void updateConsoleMessageExpiredCount(out unsigned long count);
    4646        [notify] void updateConsoleMessageRepeatCount(out unsigned long count);
     47#if defined(ENABLE_JAVASCRIPT_DEBUGGER) && ENABLE_JAVASCRIPT_DEBUGGER
     48        [notify] void pausedScript(out Value callFrames);
     49        [notify] void resumedScript();
     50#endif
    4751
    4852        [handler=Controller] void storeLastActivePanel(in String panelName);
     
    8387        [handler=Controller] void setPauseOnExceptionsState(in long pauseOnExceptionsState);
    8488
    85         [handler=Controller] void editScriptSource(in long callId, in String sourceID, in String newContent);
    86         [handler=Controller] void getScriptSource(in long callId, in String sourceID);
     89        [handler=Controller] void editScriptSource(in long callId, in String sourceID, in String newContent, out boolean success, out String result, out Value newCallFrames);
     90        [handler=Controller] void getScriptSource(in long callId, in String sourceID, out String scriptSource);
    8791
    8892        [handler=Controller] void enableProfiler(in boolean always);
  • trunk/WebCore/inspector/InspectorController.cpp

    r64534 r64540  
    17471747    String result;
    17481748    bool success = ScriptDebugServer::shared().editScriptSource(sourceID, newContent, result);
    1749     RefPtr<SerializedScriptValue> callFrames;
     1749    RefPtr<InspectorValue> callFrames;
    17501750    if (success)
    17511751        callFrames = currentCallFrames();
    1752     m_frontend->didEditScriptSource(callId, success, result, callFrames.get());
     1752    m_remoteFrontend->didEditScriptSource(callId, success, result, callFrames.get());
    17531753}
    17541754
     
    17581758        return;
    17591759    String scriptSource = m_scriptIDToContent.get(sourceID);
    1760     m_frontend->didGetScriptSource(callId, scriptSource);
     1760    m_remoteFrontend->didGetScriptSource(callId, scriptSource);
    17611761}
    17621762
     
    17751775}
    17761776
    1777 PassRefPtr<SerializedScriptValue> InspectorController::currentCallFrames()
     1777PassRefPtr<InspectorValue> InspectorController::currentCallFrames()
    17781778{
    17791779    if (!m_pausedScriptState)
    1780         return 0;
     1780        return InspectorValue::null();
    17811781    InjectedScript injectedScript = m_injectedScriptHost->injectedScriptFor(m_pausedScriptState);
    17821782    if (injectedScript.hasNoValue()) {
    17831783        ASSERT_NOT_REACHED();
    1784         return 0;
     1784        return InspectorValue::null();
    17851785    }
    17861786    return injectedScript.callFrames();
     
    18741874    ASSERT(scriptState && !m_pausedScriptState);
    18751875    m_pausedScriptState = scriptState;
    1876     RefPtr<SerializedScriptValue> callFrames = currentCallFrames();
    1877     m_frontend->pausedScript(callFrames.get());
     1876    RefPtr<InspectorValue> callFrames = currentCallFrames();
     1877    m_remoteFrontend->pausedScript(callFrames.get());
    18781878}
    18791879
  • trunk/WebCore/inspector/InspectorController.h

    r64536 r64540  
    3939#include "ScriptProfile.h"
    4040#include "ScriptState.h"
    41 #include "ScriptValue.h"
    4241#include "StringHash.h"
    4342#include "Timer.h"
     
    270269    void resume();
    271270    void setPauseOnExceptionsState(long pauseState);
    272     PassRefPtr<SerializedScriptValue> currentCallFrames();
    273271
    274272    virtual void didParseSource(const String& sourceID, const String& url, const String& data, int firstLine, ScriptWorldType);
     
    309307
    310308#if ENABLE(JAVASCRIPT_DEBUGGER)
     309    PassRefPtr<InspectorValue> currentCallFrames();
     310
    311311    void setBreakpoint(long callId, const String& sourceID, unsigned lineNumber, bool enabled, const String& condition);
    312312    void removeBreakpoint(const String& sourceID, unsigned lineNumber);
  • trunk/WebCore/inspector/InspectorFrontend.cpp

    r63427 r64540  
    358358}
    359359
    360 void InspectorFrontend::didEditScriptSource(long callId, bool success, const String& result, SerializedScriptValue* newCallFrames)
    361 {
    362     ScriptFunctionCall function(m_webInspector, "dispatch");
    363     function.appendArgument("didEditScriptSource");
    364     function.appendArgument(callId);
    365     function.appendArgument(success);
    366     function.appendArgument(result);
    367     if (success && newCallFrames) {
    368         ScriptValue newCallFramesValue = ScriptValue::deserialize(scriptState(), newCallFrames);
    369         ASSERT(!newCallFramesValue .hasNoValue());
    370         function.appendArgument(newCallFramesValue);
    371     }
    372     function.call();
    373 }
    374 
    375 void InspectorFrontend::didGetScriptSource(long callId, const String& result)
    376 {
    377     ScriptFunctionCall function(m_webInspector, "dispatch");
    378     function.appendArgument("didGetScriptSource");
    379     function.appendArgument(callId);
    380     function.appendArgument(result);
    381     function.call();
    382 }
    383 
    384360void InspectorFrontend::profilerWasEnabled()
    385361{
  • trunk/WebCore/inspector/InspectorFrontend.h

    r63427 r64540  
    110110        void resumedScript();
    111111
    112         void didEditScriptSource(long callId, bool success, const String& result, SerializedScriptValue* newCallFrames);
    113         void didGetScriptSource(long callId, const String& result);
    114 
    115112        void profilerWasEnabled();
    116113        void profilerWasDisabled();
  • trunk/WebCore/inspector/front-end/InspectorBackendStub.js

    r64534 r64540  
    105105    this._registerDelegate("activateBreakpoints");
    106106    this._registerDelegate("deactivateBreakpoints");
     107    this._registerDelegate("pause");
    107108    this._registerDelegate("resume");
    108109    this._registerDelegate("stepIntoStatement");
Note: See TracChangeset for help on using the changeset viewer.