2010-09-22 Pavel Podivilov <podivilov@chromium.org>
authorpodivilov@chromium.org <podivilov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Sep 2010 16:06:24 +0000 (16:06 +0000)
committerpodivilov@chromium.org <podivilov@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Sep 2010 16:06:24 +0000 (16:06 +0000)
        Reviewed by Pavel Feldman.

        Web Inspector: implement pausing on XHR
        https://bugs.webkit.org/show_bug.cgi?id=46086

        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
        (WebCore::V8XMLHttpRequest::sendCallback):
        * inspector/Inspector.idl:
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::InspectorController):
        (WebCore::InspectorController::setNativeBreakpoint):
        (WebCore::InspectorController::removeNativeBreakpoint):
        (WebCore::InspectorController::willInsertDOMNodeImpl):
        (WebCore::InspectorController::willRemoveDOMNodeImpl):
        (WebCore::InspectorController::willModifyDOMAttrImpl):
        (WebCore::InspectorController::instrumentWillSendXMLHttpRequestImpl):
        * inspector/InspectorController.h:
        (WebCore::InspectorController::instrumentWillSendXMLHttpRequest):
        (WebCore::InspectorController::inspectorControllerForScriptExecutionContext):
        (WebCore::InspectorController::inspectorControllerForNode):
        (WebCore::InspectorController::inspectorControllerForDocument):
        * inspector/InspectorDebuggerAgent.cpp:
        (WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
        (WebCore::InspectorDebuggerAgent::didPause):
        (WebCore::InspectorDebuggerAgent::breakProgram):
        * inspector/InspectorDebuggerAgent.h:
        * inspector/InspectorTimelineAgent.h:
        * inspector/front-end/CallStackSidebarPane.js:
        (WebInspector.CallStackSidebarPane.prototype.updateStatus):
        * inspector/front-end/ElementsPanel.js:
        (WebInspector.ElementsPanel):
        (WebInspector.ElementsPanel.prototype.reset):
        * inspector/front-end/ElementsTreeOutline.js:
        (WebInspector.ElementsTreeElement.prototype._populateTagContextMenu):
        * inspector/front-end/ScriptsPanel.js:
        (WebInspector.ScriptsPanel):
        (WebInspector.ScriptsPanel.prototype.debuggerPaused):
        (WebInspector.ScriptsPanel.prototype.reset):
        * inspector/front-end/Settings.js:
        * xml/XMLHttpRequest.h:
        (WebCore::XMLHttpRequest::url):
2010-09-22  Pavel Podivilov  <podivilov@chromium.org>

        Reviewed by Pavel Feldman.

        Web Inspector: implement pausing on XHR
        https://bugs.webkit.org/show_bug.cgi?id=46086

        * src/js/DevTools.js:
        ():

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@68049 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
WebCore/ChangeLog
WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp
WebCore/inspector/Inspector.idl
WebCore/inspector/InspectorController.cpp
WebCore/inspector/InspectorController.h
WebCore/inspector/InspectorDebuggerAgent.cpp
WebCore/inspector/InspectorDebuggerAgent.h
WebCore/inspector/InspectorTimelineAgent.h
WebCore/inspector/front-end/CallStackSidebarPane.js
WebCore/inspector/front-end/ElementsPanel.js
WebCore/inspector/front-end/ElementsTreeOutline.js
WebCore/inspector/front-end/ScriptsPanel.js
WebCore/inspector/front-end/Settings.js
WebCore/xml/XMLHttpRequest.h
WebKit/chromium/ChangeLog
WebKit/chromium/src/js/DevTools.js

index 8e3b25d..f49c859 100644 (file)
@@ -1,3 +1,47 @@
+2010-09-22  Pavel Podivilov  <podivilov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: implement pausing on XHR
+        https://bugs.webkit.org/show_bug.cgi?id=46086
+
+        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
+        (WebCore::V8XMLHttpRequest::sendCallback):
+        * inspector/Inspector.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::setNativeBreakpoint):
+        (WebCore::InspectorController::removeNativeBreakpoint):
+        (WebCore::InspectorController::willInsertDOMNodeImpl):
+        (WebCore::InspectorController::willRemoveDOMNodeImpl):
+        (WebCore::InspectorController::willModifyDOMAttrImpl):
+        (WebCore::InspectorController::instrumentWillSendXMLHttpRequestImpl):
+        * inspector/InspectorController.h:
+        (WebCore::InspectorController::instrumentWillSendXMLHttpRequest):
+        (WebCore::InspectorController::inspectorControllerForScriptExecutionContext):
+        (WebCore::InspectorController::inspectorControllerForNode):
+        (WebCore::InspectorController::inspectorControllerForDocument):
+        * inspector/InspectorDebuggerAgent.cpp:
+        (WebCore::InspectorDebuggerAgent::InspectorDebuggerAgent):
+        (WebCore::InspectorDebuggerAgent::didPause):
+        (WebCore::InspectorDebuggerAgent::breakProgram):
+        * inspector/InspectorDebuggerAgent.h:
+        * inspector/InspectorTimelineAgent.h:
+        * inspector/front-end/CallStackSidebarPane.js:
+        (WebInspector.CallStackSidebarPane.prototype.updateStatus):
+        * inspector/front-end/ElementsPanel.js:
+        (WebInspector.ElementsPanel):
+        (WebInspector.ElementsPanel.prototype.reset):
+        * inspector/front-end/ElementsTreeOutline.js:
+        (WebInspector.ElementsTreeElement.prototype._populateTagContextMenu):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel):
+        (WebInspector.ScriptsPanel.prototype.debuggerPaused):
+        (WebInspector.ScriptsPanel.prototype.reset):
+        * inspector/front-end/Settings.js:
+        * xml/XMLHttpRequest.h:
+        (WebCore::XMLHttpRequest::url):
+
 2010-09-22  Kenneth Russell  <kbr@google.com>
 
         Reviewed by James Robinson.
index cfeb503..2355d2a 100644 (file)
@@ -32,6 +32,7 @@
 #include "V8XMLHttpRequest.h"
 
 #include "Frame.h"
+#include "InspectorController.h"
 #include "V8Binding.h"
 #include "V8Blob.h"
 #include "V8DOMFormData.h"
@@ -113,6 +114,8 @@ v8::Handle<v8::Value> V8XMLHttpRequest::sendCallback(const v8::Arguments& args)
     INC_STATS("DOM.XMLHttpRequest.send()");
     XMLHttpRequest* xmlHttpRequest = V8XMLHttpRequest::toNative(args.Holder());
 
+    InspectorController::instrumentWillSendXMLHttpRequest(xmlHttpRequest->scriptExecutionContext(), xmlHttpRequest->url());
+
     ExceptionCode ec = 0;
     if (args.Length() < 1)
         xmlHttpRequest->send(ec);
index 1fe1dd2..9a1b94b 100644 (file)
@@ -138,6 +138,9 @@ module core {
         [handler=Debug] void editScriptSource(in String sourceID, in String newContent, out boolean success, out String result, out Value newCallFrames);
         [handler=Debug] void getScriptSource(in String sourceID, out String scriptSource);
 
+        [handler=Controller] void setNativeBreakpoint(in Object breakpoint, out unsigned int breakpointId);
+        [handler=Controller] void removeNativeBreakpoint(in unsigned int breakpointId);
+
         [handler=Controller] void enableProfiler(in boolean always);
         [handler=Controller] void disableProfiler(in boolean always);
 
index 64ea4bc..7ea15b9 100644 (file)
@@ -153,7 +153,7 @@ static const float maximumAttachedHeightRatio = 0.75f;
 static const unsigned maximumConsoleMessages = 1000;
 static const unsigned expireConsoleMessagesStep = 100;
 
-static unsigned s_inspectorControllerCount;
+unsigned InspectorController::s_inspectorControllerCount = 0;
 
 InspectorController::InspectorController(Page* page, InspectorClient* client)
     : m_inspectedPage(page)
@@ -174,6 +174,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)
     , m_injectedScriptHost(InjectedScriptHost::create(this))
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     , m_attachDebuggerWhenShown(false)
+    , m_lastBreakpointId(0)
     , m_profilerAgent(InspectorProfilerAgent::create(this))
 #endif
 {
@@ -1672,6 +1673,29 @@ void InspectorController::resume()
         m_debuggerAgent->resume();
 }
 
+void InspectorController::setNativeBreakpoint(PassRefPtr<InspectorObject> breakpoint, unsigned int* breakpointId)
+{
+    *breakpointId = 0;
+    String type;
+    if (!breakpoint->getString("type", &type))
+        return;
+    if (type == "XHR") {
+        RefPtr<InspectorObject> condition = breakpoint->getObject("condition");
+        if (!condition)
+            return;
+        String url;
+        if (!condition->getString("url", &url))
+            return;
+        *breakpointId = ++m_lastBreakpointId;
+        m_XHRBreakpoints.set(*breakpointId, url);
+    }
+}
+
+void InspectorController::removeNativeBreakpoint(unsigned int breakpointId)
+{
+    m_XHRBreakpoints.remove(breakpointId);
+}
+
 #endif
 
 void InspectorController::evaluateForTestInFrontend(long callId, const String& script)
@@ -2085,9 +2109,9 @@ void InspectorController::willInsertDOMNodeImpl(Node* node, Node* parent)
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     if (!m_debuggerAgent || !m_domAgent)
         return;
-    PassRefPtr<InspectorValue> details;
-    if (m_domAgent->shouldBreakOnNodeInsertion(node, parent, &details))
-        m_debuggerAgent->breakProgram(details);
+    PassRefPtr<InspectorValue> eventData;
+    if (m_domAgent->shouldBreakOnNodeInsertion(node, parent, &eventData))
+        m_debuggerAgent->breakProgram(DOMBreakpointDebuggerEventType, eventData);
 #endif
 }
 
@@ -2102,9 +2126,9 @@ void InspectorController::willRemoveDOMNodeImpl(Node* node)
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     if (!m_debuggerAgent || !m_domAgent)
         return;
-    PassRefPtr<InspectorValue> details;
-    if (m_domAgent->shouldBreakOnNodeRemoval(node, &details))
-        m_debuggerAgent->breakProgram(details);
+    PassRefPtr<InspectorValue> eventData;
+    if (m_domAgent->shouldBreakOnNodeRemoval(node, &eventData))
+        m_debuggerAgent->breakProgram(DOMBreakpointDebuggerEventType, eventData);
 #endif
 }
 
@@ -2119,9 +2143,9 @@ void InspectorController::willModifyDOMAttrImpl(Element* element)
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     if (!m_debuggerAgent || !m_domAgent)
         return;
-    PassRefPtr<InspectorValue> details;
-    if (m_domAgent->shouldBreakOnAttributeModification(element, &details))
-        m_debuggerAgent->breakProgram(details);
+    PassRefPtr<InspectorValue> eventData;
+    if (m_domAgent->shouldBreakOnAttributeModification(element, &eventData))
+        m_debuggerAgent->breakProgram(DOMBreakpointDebuggerEventType, eventData);
 #endif
 }
 
@@ -2137,6 +2161,21 @@ void InspectorController::characterDataModifiedImpl(CharacterData* characterData
         m_domAgent->characterDataModified(characterData);
 }
 
+void InspectorController::instrumentWillSendXMLHttpRequestImpl(const KURL& url)
+{
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    if (m_debuggerAgent) {
+        if (!m_XHRBreakpoints.size())
+            return;
+        RefPtr<InspectorObject> eventData = InspectorObject::create();
+        eventData->setNumber("recordType", XHRSendRecordType);
+        eventData->setString("url", url);
+        m_debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData);
+    }
+#endif
+}
+
+
 } // namespace WebCore
 
 #endif // ENABLE(INSPECTOR)
index f17f1d3..f3a17c2 100644 (file)
@@ -205,6 +205,8 @@ public:
     static void didModifyDOMAttr(Element*);
     static void characterDataModified(CharacterData*);
 
+    static void instrumentWillSendXMLHttpRequest(ScriptExecutionContext*, const KURL&);
+
 #if ENABLE(WORKERS)
     enum WorkerAction { WorkerCreated, WorkerDestroyed };
 
@@ -267,6 +269,10 @@ public:
     bool debuggerEnabled() const { return m_debuggerAgent; }
     InspectorDebuggerAgent* debuggerAgent() const { return m_debuggerAgent.get(); }
     void resume();
+
+    void setNativeBreakpoint(PassRefPtr<InspectorObject> breakpoint, unsigned int* breakpointId);
+    void removeNativeBreakpoint(unsigned int breakpointId);
+
 #endif
 
     void evaluateForTestInFrontend(long testCallId, const String& script);
@@ -334,7 +340,10 @@ private:
 
     void didEvaluateForTestInFrontend(long callId, const String& jsonResult);
 
+    static InspectorController* inspectorControllerForScriptExecutionContext(ScriptExecutionContext* context);
     static InspectorController* inspectorControllerForNode(Node*);
+    static InspectorController* inspectorControllerForDocument(Document* document);
+
     void willInsertDOMNodeImpl(Node* node, Node* parent);
     void didInsertDOMNodeImpl(Node*);
     void willRemoveDOMNodeImpl(Node*);
@@ -343,6 +352,8 @@ private:
     void didModifyDOMAttrImpl(Element*);
     void characterDataModifiedImpl(CharacterData*);
 
+    void instrumentWillSendXMLHttpRequestImpl(const KURL&);
+
 #if ENABLE(JAVASCRIPT_DEBUGGER)
     friend class InspectorDebuggerAgent;
     String breakpointsSettingKey();
@@ -350,6 +361,8 @@ private:
     void saveBreakpoints(PassRefPtr<InspectorObject> breakpoints);
 #endif
 
+    static unsigned s_inspectorControllerCount;
+
     Page* m_inspectedPage;
     InspectorClient* m_client;
     OwnPtr<InspectorFrontendClient> m_inspectorFrontendClient;
@@ -404,6 +417,9 @@ private:
     bool m_attachDebuggerWhenShown;
     OwnPtr<InspectorDebuggerAgent> m_debuggerAgent;
 
+    HashMap<unsigned int, String> m_XHRBreakpoints;
+    unsigned int m_lastBreakpointId;
+
     OwnPtr<InspectorProfilerAgent> m_profilerAgent;
 #endif
 #if ENABLE(WORKERS)
@@ -463,18 +479,40 @@ inline void InspectorController::characterDataModified(CharacterData* characterD
 #endif
 }
 
-inline InspectorController* InspectorController::inspectorControllerForNode(Node* node)
+inline void InspectorController::instrumentWillSendXMLHttpRequest(ScriptExecutionContext* context, const KURL& url)
 {
 #if ENABLE(INSPECTOR)
-    if (Page* page = node->document()->page()) {
-        if (InspectorController* inspectorController = page->inspectorController()) {
-            if (inspectorController->hasFrontend())
-                return inspectorController;
-        }
-    }
+    if (InspectorController* inspectorController = inspectorControllerForScriptExecutionContext(context))
+        inspectorController->instrumentWillSendXMLHttpRequestImpl(url);
 #endif
+}
 
-    return 0;
+inline InspectorController* InspectorController::inspectorControllerForScriptExecutionContext(ScriptExecutionContext* context)
+{
+    if (!s_inspectorControllerCount || !context || !context->isDocument())
+        return 0;
+    return inspectorControllerForDocument(static_cast<Document*>(context));
+}
+
+inline InspectorController* InspectorController::inspectorControllerForNode(Node* node)
+{
+    if (!s_inspectorControllerCount)
+        return 0;
+    return inspectorControllerForDocument(node->document());
+}
+
+inline InspectorController* InspectorController::inspectorControllerForDocument(Document* document)
+{
+    ASSERT(document);
+    Page* page = document->page();
+    if (!page)
+        return 0;
+    InspectorController* inspectorController = page->inspectorController();
+    if (!inspectorController)
+        return 0;
+    if (!inspectorController->hasFrontend())
+        return 0;
+    return inspectorController;
 }
 
 } // namespace WebCore
index 3875be0..9275961 100644 (file)
@@ -64,7 +64,6 @@ InspectorDebuggerAgent::InspectorDebuggerAgent(InspectorController* inspectorCon
     , m_frontend(frontend)
     , m_pausedScriptState(0)
     , m_breakpointsLoaded(false)
-    , m_breakProgramReason(InspectorValue::null())
 {
 }
 
@@ -289,12 +288,13 @@ void InspectorDebuggerAgent::failedToParseSource(const String& url, const String
 void InspectorDebuggerAgent::didPause(ScriptState* scriptState)
 {
     ASSERT(scriptState && !m_pausedScriptState);
-    ASSERT(m_breakProgramReason);
     m_pausedScriptState = scriptState;
-    RefPtr<InspectorObject> details = InspectorObject::create();
-    details->setValue("callFrames", currentCallFrames());
-    details->setValue("status", m_breakProgramReason);
-    m_frontend->pausedScript(details);
+
+    if (!m_breakProgramDetails)
+        m_breakProgramDetails = InspectorObject::create();
+    m_breakProgramDetails->setValue("callFrames", currentCallFrames());
+
+    m_frontend->pausedScript(m_breakProgramDetails);
 }
 
 void InspectorDebuggerAgent::didContinue()
@@ -303,17 +303,19 @@ void InspectorDebuggerAgent::didContinue()
     m_frontend->resumedScript();
 }
 
-void InspectorDebuggerAgent::breakProgram(PassRefPtr<InspectorValue> reason)
+void InspectorDebuggerAgent::breakProgram(DebuggerEventType type, PassRefPtr<InspectorValue> data)
 {
+    m_breakProgramDetails = InspectorObject::create();
+    m_breakProgramDetails->setNumber("eventType", type);
+    m_breakProgramDetails->setValue("eventData", data);
     s_debuggerAgentOnBreakpoint = this;
-    m_breakProgramReason = reason;
 
     ScriptDebugServer::shared().breakProgram();
     if (!s_debuggerAgentOnBreakpoint)
         return;
 
     s_debuggerAgentOnBreakpoint = 0;
-    m_breakProgramReason = InspectorValue::null();
+    m_breakProgramDetails = 0;
 }
 
 } // namespace WebCore
index 79b0a0e..f5baabc 100644 (file)
@@ -43,8 +43,14 @@ namespace WebCore {
 class InjectedScriptHost;
 class InspectorController;
 class InspectorFrontend;
+class InspectorObject;
 class InspectorValue;
 
+enum DebuggerEventType {
+    DOMBreakpointDebuggerEventType,
+    NativeBreakpointDebuggerEventType
+};
+
 class InspectorDebuggerAgent : public ScriptDebugListener, public Noncopyable {
 public:
     static PassOwnPtr<InspectorDebuggerAgent> create(InspectorController*, InspectorFrontend*);
@@ -61,7 +67,7 @@ public:
     void getScriptSource(const String& sourceID, String* scriptSource);
 
     void pause();
-    void breakProgram(PassRefPtr<InspectorValue> reason);
+    void breakProgram(DebuggerEventType type, PassRefPtr<InspectorValue> data);
     void resume();
     void stepOverStatement();
     void stepIntoStatement();
@@ -95,7 +101,7 @@ private:
     HashMap<String, unsigned> m_breakpointsMapping;
     bool m_breakpointsLoaded;
     static InspectorDebuggerAgent* s_debuggerAgentOnBreakpoint;
-    RefPtr<InspectorValue> m_breakProgramReason;
+    RefPtr<InspectorObject> m_breakProgramDetails;
 };
 
 } // namespace WebCore
index 6b3324b..410e189 100644 (file)
@@ -69,7 +69,8 @@ enum TimelineRecordType {
     GCEventTimelineRecordType = 17,
     MarkDOMContentEventType = 18,
     MarkLoadEventType = 19,
-    ScheduleResourceRequestTimelineRecordType = 20
+    ScheduleResourceRequestTimelineRecordType = 20,
+    XHRSendRecordType = 21
 };
 
 class InspectorTimelineAgent : ScriptGCEventListener, public Noncopyable {
index 91f35a6..2c45b14 100644 (file)
@@ -82,13 +82,13 @@ WebInspector.CallStackSidebarPane.prototype = {
         }
     },
 
-    updateStatus:  function(status)
+    updateStatus:  function(eventType, eventData)
     {
         var statusElement = document.createElement("div");
         statusElement.className = "info";
 
-        var breakpointType = status.breakpoint.type;
-        var substitutions = [WebInspector.DOMBreakpoint.labelForType(breakpointType), WebInspector.panels.elements.linkifyNodeById(status.breakpoint.nodeId)];
+        var breakpoint = eventData.breakpoint;
+        var substitutions = [WebInspector.DOMBreakpoint.labelForType(breakpoint.type), WebInspector.panels.elements.linkifyNodeById(breakpoint.nodeId)];
         var formatters = {
             s: function(substitution)
             {
@@ -101,10 +101,10 @@ WebInspector.CallStackSidebarPane.prototype = {
                 b = document.createTextNode(b);
             statusElement.appendChild(b);
         }
-        if (breakpointType === WebInspector.DOMBreakpoint.Types.SubtreeModified) {
-            var targetNode = WebInspector.panels.elements.linkifyNodeById(status.targetNodeId);
-            if (status.insertion) {
-                if (status.targetNodeId !== status.breakpoint.nodeId)
+        if (breakpoint.type === WebInspector.DOMBreakpoint.Types.SubtreeModified) {
+            var targetNode = WebInspector.panels.elements.linkifyNodeById(eventData.targetNodeId);
+            if (eventData.insertion) {
+                if (eventData.targetNodeId !== breakpoint.nodeId)
                     WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to its descendant %s.", substitutions.concat(targetNode), formatters, "", append);
                 else
                     WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because a new child was added to that node.", substitutions, formatters, "", append);
@@ -112,6 +112,7 @@ WebInspector.CallStackSidebarPane.prototype = {
                 WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s, because its descendant %s was removed.", substitutions.concat(targetNode), formatters, "", append);
         } else
             WebInspector.formatLocalized("Paused on a \"%s\" breakpoint set on %s.", substitutions, formatters, "", append);
+
         this.bodyElement.appendChild(statusElement);
     },
 
index 9f4dbf2..f57dea5 100644 (file)
@@ -74,7 +74,7 @@ WebInspector.ElementsPanel = function()
     this.sidebarPanes.styles = new WebInspector.StylesSidebarPane(this.sidebarPanes.computedStyle);
     this.sidebarPanes.metrics = new WebInspector.MetricsSidebarPane();
     this.sidebarPanes.properties = new WebInspector.PropertiesSidebarPane();
-    if (Preferences.domBreakpointsEnabled)
+    if (Preferences.nativeInstrumentationEnabled)
         this.sidebarPanes.domBreakpoints = WebInspector.createDOMBreakpointsSidebarPane();
     this.sidebarPanes.eventListeners = new WebInspector.EventListenersSidebarPane();
 
@@ -171,7 +171,7 @@ WebInspector.ElementsPanel.prototype = {
 
         delete this.currentQuery;
 
-        if (Preferences.domBreakpointsEnabled)
+        if (Preferences.nativeInstrumentationEnabled)
             this.sidebarPanes.domBreakpoints.reset();
     },
 
index 2571a15..5109ce7 100644 (file)
@@ -752,7 +752,7 @@ WebInspector.ElementsTreeElement.prototype = {
         contextMenu.appendItem(WebInspector.UIString("Copy as HTML"), this._copyHTML.bind(this));
         contextMenu.appendItem(WebInspector.UIString("Delete Node"), this.remove.bind(this));
 
-        if (Preferences.domBreakpointsEnabled) {
+        if (Preferences.nativeInstrumentationEnabled) {
             // Add debbuging-related actions
             contextMenu.appendSeparator();
 
index 715339d..aa6d2b7 100644 (file)
@@ -133,8 +133,11 @@ WebInspector.ScriptsPanel = function()
     this.sidebarPanes.callstack = new WebInspector.CallStackSidebarPane();
     this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane();
     this.sidebarPanes.jsBreakpoints = WebInspector.createJSBreakpointsSidebarPane();
-    if (Preferences.domBreakpointsEnabled)
+    if (Preferences.nativeInstrumentationEnabled) {
         this.sidebarPanes.domBreakpoints = WebInspector.createDOMBreakpointsSidebarPane();
+        this.sidebarPanes.domBreakpoints.expanded = true;
+    }
+
     this.sidebarPanes.workers = new WebInspector.WorkersSidebarPane();
 
     for (var pane in this.sidebarPanes)
@@ -145,8 +148,6 @@ WebInspector.ScriptsPanel = function()
 
     this.sidebarPanes.scopechain.expanded = true;
     this.sidebarPanes.jsBreakpoints.expanded = true;
-    if (Preferences.domBreakpointsEnabled)
-        this.sidebarPanes.domBreakpoints.expanded = true;
 
     var panelEnablerHeading = WebInspector.UIString("You need to enable debugging before you can use the Scripts panel.");
     var panelEnablerDisclaimer = WebInspector.UIString("Enabling debugging will make scripts run slower.");
@@ -387,8 +388,8 @@ WebInspector.ScriptsPanel.prototype = {
         this.sidebarPanes.callstack.update(details.callFrames, this._sourceIDMap);
         this.sidebarPanes.callstack.selectedCallFrame = details.callFrames[0];
 
-        if (details.status)
-            this.sidebarPanes.callstack.updateStatus(details.status);
+        if ("eventType" in details)
+            this.sidebarPanes.callstack.updateStatus(details.eventType, details.eventData);
 
         WebInspector.currentPanel = this;
         window.focus();
@@ -467,7 +468,7 @@ WebInspector.ScriptsPanel.prototype = {
         this.sidebarPanes.watchExpressions.refreshExpressions();
         if (!preserveItems) {
             this.sidebarPanes.jsBreakpoints.reset();
-            if (Preferences.domBreakpointsEnabled)
+            if (Preferences.nativeInstrumentationEnabled)
                 this.sidebarPanes.domBreakpoints.reset();
             this.sidebarPanes.workers.reset();
         }
index 63f2641..a678611 100644 (file)
@@ -44,7 +44,7 @@ var Preferences = {
     profilerAlwaysEnabled: false,
     auditsPanelEnabled: true,
     onlineDetectionEnabled: true,
-    domBreakpointsEnabled: false,
+    nativeInstrumentationEnabled: false,
     resourceExportEnabled: false
 }
 
index ac18828..481b51f 100644 (file)
@@ -65,6 +65,7 @@ public:
 
     virtual ScriptExecutionContext* scriptExecutionContext() const;
 
+    const KURL& url() const { return m_url; }
     String statusText(ExceptionCode&) const;
     int status(ExceptionCode&) const;
     State readyState() const;
index 1f001c9..0aea610 100644 (file)
@@ -1,3 +1,13 @@
+2010-09-22  Pavel Podivilov  <podivilov@chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: implement pausing on XHR
+        https://bugs.webkit.org/show_bug.cgi?id=46086
+
+        * src/js/DevTools.js:
+        ():
+
 2010-09-21  Brett Wilson  <brettw@chromium.org>
 
         Reviewed by Darin Fisher.
index 0c7241d..a66e174 100644 (file)
@@ -45,7 +45,7 @@ var context = {};  // Used by WebCore's inspector routines.
     Preferences.profilerAlwaysEnabled = true;
     Preferences.canEditScriptSource = true;
     Preferences.onlineDetectionEnabled = false;
-    Preferences.domBreakpointsEnabled = true;
+    Preferences.nativeInstrumentationEnabled = true;
 })();
 
 var devtools = devtools || {};