[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

podivilov at chromium.org podivilov at chromium.org
Wed Dec 22 14:37:37 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 624fc637ad9be7795550b78c2c96c91c0bee7573
Author: podivilov at chromium.org <podivilov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 14 12:56:28 2010 +0000

    2010-10-14  Pavel Podivilov  <podivilov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: implement pausing on window events and timeouts
            https://bugs.webkit.org/show_bug.cgi?id=47542
    
            * inspector/InspectorInstrumentation.cpp:
            (WebCore::InspectorInstrumentation::didInstallTimerImpl):
            (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
            (WebCore::InspectorInstrumentation::willDispatchEventImpl):
            (WebCore::InspectorInstrumentation::didDispatchEventImpl):
            (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
            (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
            (WebCore::InspectorInstrumentation::willFireTimerImpl):
            (WebCore::InspectorInstrumentation::didFireTimerImpl):
            (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded):
            (WebCore::InspectorInstrumentation::cancelPauseOnNativeEvent):
            * inspector/InspectorInstrumentation.h:
            * inspector/front-end/BreakpointManager.js:
            (WebInspector.EventListenerBreakpoint.prototype.populateLabelElement):
            (WebInspector.EventListenerBreakpoint.prototype.populateStatusMessageElement):
            (WebInspector.EventListenerBreakpoint.prototype._condition):
            (WebInspector.EventListenerBreakpoint.prototype._uiEventName):
            * inspector/front-end/BreakpointsSidebarPane.js:
            (WebInspector.EventListenerBreakpointsSidebarPane.prototype._populate):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69760 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9ab02aa..a3e5e17 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,30 @@
+2010-10-14  Pavel Podivilov  <podivilov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: implement pausing on window events and timeouts
+        https://bugs.webkit.org/show_bug.cgi?id=47542
+
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::didInstallTimerImpl):
+        (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
+        (WebCore::InspectorInstrumentation::willDispatchEventImpl):
+        (WebCore::InspectorInstrumentation::didDispatchEventImpl):
+        (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
+        (WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
+        (WebCore::InspectorInstrumentation::willFireTimerImpl):
+        (WebCore::InspectorInstrumentation::didFireTimerImpl):
+        (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded):
+        (WebCore::InspectorInstrumentation::cancelPauseOnNativeEvent):
+        * inspector/InspectorInstrumentation.h:
+        * inspector/front-end/BreakpointManager.js:
+        (WebInspector.EventListenerBreakpoint.prototype.populateLabelElement):
+        (WebInspector.EventListenerBreakpoint.prototype.populateStatusMessageElement):
+        (WebInspector.EventListenerBreakpoint.prototype._condition):
+        (WebInspector.EventListenerBreakpoint.prototype._uiEventName):
+        * inspector/front-end/BreakpointsSidebarPane.js:
+        (WebInspector.EventListenerBreakpointsSidebarPane.prototype._populate):
+
 2010-10-14  Csaba Osztrogonác  <ossy at webkit.org>
 
         Reviewed by Andreas Kling.
diff --git a/WebCore/English.lproj/localizedStrings.js b/WebCore/English.lproj/localizedStrings.js
index e1e76ea..21081b1 100644
Binary files a/WebCore/English.lproj/localizedStrings.js and b/WebCore/English.lproj/localizedStrings.js differ
diff --git a/WebCore/inspector/InspectorInstrumentation.cpp b/WebCore/inspector/InspectorInstrumentation.cpp
index 6e5bed7..46c7d8c 100644
--- a/WebCore/inspector/InspectorInstrumentation.cpp
+++ b/WebCore/inspector/InspectorInstrumentation.cpp
@@ -43,6 +43,13 @@
 
 namespace WebCore {
 
+static const char* const listenerEventCategoryType = "listener";
+static const char* const instrumentationEventCategoryType = "instrumentation";
+
+static const char* const setTimerEventName = "setTimer";
+static const char* const clearTimerEventName = "clearTimer";
+static const char* const timerFiredEventName = "timerFired";
+
 int InspectorInstrumentation::s_frontendCounter = 0;
 
 static bool eventHasListeners(const AtomicString& eventType, DOMWindow* window, Node* node, const Vector<RefPtr<ContainerNode> >& ancestors)
@@ -158,12 +165,14 @@ void InspectorInstrumentation::didScheduleResourceRequestImpl(InspectorControlle
 
 void InspectorInstrumentation::didInstallTimerImpl(InspectorController* inspectorController, int timerId, int timeout, bool singleShot)
 {
+    pauseOnNativeEventIfNeeded(inspectorController, instrumentationEventCategoryType, setTimerEventName, true);
     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController))
         timelineAgent->didInstallTimer(timerId, timeout, singleShot);
 }
 
 void InspectorInstrumentation::didRemoveTimerImpl(InspectorController* inspectorController, int timerId)
 {
+    pauseOnNativeEventIfNeeded(inspectorController, instrumentationEventCategoryType, clearTimerEventName, true);
     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController))
         timelineAgent->didRemoveTimer(timerId);
 }
@@ -205,17 +214,7 @@ void InspectorInstrumentation::didChangeXHRReadyStateImpl(const InspectorInstrum
 
 InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventImpl(InspectorController* inspectorController, const Event& event, DOMWindow* window, Node* node, const Vector<RefPtr<ContainerNode> >& ancestors)
 {
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (InspectorDebuggerAgent* debuggerAgent = inspectorController->m_debuggerAgent.get()) {
-        String breakpointId = inspectorController->findEventListenerBreakpoint(event.type());
-        if (!breakpointId.isEmpty()) {
-            RefPtr<InspectorObject> eventData = InspectorObject::create();
-            eventData->setString("breakpointId", breakpointId);
-            eventData->setString("eventName", event.type());
-            debuggerAgent->schedulePauseOnNextStatement(NativeBreakpointDebuggerEventType, eventData);
-        }
-    }
-#endif
+    pauseOnNativeEventIfNeeded(inspectorController, listenerEventCategoryType, event.type(), false);
 
     int timelineAgentId = 0;
     InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
@@ -228,10 +227,7 @@ InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventImpl(I
 
 void InspectorInstrumentation::didDispatchEventImpl(const InspectorInstrumentationCookie& cookie)
 {
-#if ENABLE(JAVASCRIPT_DEBUGGER)
-    if (InspectorDebuggerAgent* debuggerAgent = cookie.first->m_debuggerAgent.get())
-        debuggerAgent->cancelPauseOnNextStatement();
-#endif
+    cancelPauseOnNativeEvent(cookie.first);
 
     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
         timelineAgent->didDispatchEvent();
@@ -239,6 +235,8 @@ void InspectorInstrumentation::didDispatchEventImpl(const InspectorInstrumentati
 
 InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventOnWindowImpl(InspectorController* inspectorController, const Event& event, DOMWindow* window)
 {
+    pauseOnNativeEventIfNeeded(inspectorController, listenerEventCategoryType, event.type(), false);
+
     int timelineAgentId = 0;
     InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
     if (timelineAgent && window->hasEventListeners(event.type())) {
@@ -250,6 +248,8 @@ InspectorInstrumentationCookie InspectorInstrumentation::willDispatchEventOnWind
 
 void InspectorInstrumentation::didDispatchEventOnWindowImpl(const InspectorInstrumentationCookie& cookie)
 {
+    cancelPauseOnNativeEvent(cookie.first);
+
     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
         timelineAgent->didDispatchEvent();
 }
@@ -273,6 +273,8 @@ void InspectorInstrumentation::didEvaluateScriptImpl(const InspectorInstrumentat
 
 InspectorInstrumentationCookie InspectorInstrumentation::willFireTimerImpl(InspectorController* inspectorController, int timerId)
 {
+    pauseOnNativeEventIfNeeded(inspectorController, instrumentationEventCategoryType, timerFiredEventName, false);
+
     int timelineAgentId = 0;
     InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(inspectorController);
     if (timelineAgent) {
@@ -284,6 +286,8 @@ InspectorInstrumentationCookie InspectorInstrumentation::willFireTimerImpl(Inspe
 
 void InspectorInstrumentation::didFireTimerImpl(const InspectorInstrumentationCookie& cookie)
 {
+    cancelPauseOnNativeEvent(cookie.first);
+
     if (InspectorTimelineAgent* timelineAgent = retrieveTimelineAgent(cookie))
         timelineAgent->didFireTimer();
 }
@@ -412,6 +416,33 @@ bool InspectorInstrumentation::hasFrontend(InspectorController* inspectorControl
     return inspectorController->hasFrontend();
 }
 
+void InspectorInstrumentation::pauseOnNativeEventIfNeeded(InspectorController* inspectorController, const String& categoryType, const String& eventName, bool synchronous)
+{
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    InspectorDebuggerAgent* debuggerAgent = inspectorController->m_debuggerAgent.get();
+    if (!debuggerAgent)
+        return;
+    String fullEventName = String::format("%s:%s", categoryType.utf8().data(), eventName.utf8().data());
+    String breakpointId = inspectorController->findEventListenerBreakpoint(fullEventName);
+    if (breakpointId.isEmpty())
+        return;
+    RefPtr<InspectorObject> eventData = InspectorObject::create();
+    eventData->setString("breakpointId", breakpointId);
+    if (synchronous)
+        debuggerAgent->breakProgram(NativeBreakpointDebuggerEventType, eventData);
+    else
+        debuggerAgent->schedulePauseOnNextStatement(NativeBreakpointDebuggerEventType, eventData);
+#endif
+}
+
+void InspectorInstrumentation::cancelPauseOnNativeEvent(InspectorController* inspectorController)
+{
+#if ENABLE(JAVASCRIPT_DEBUGGER)
+    if (InspectorDebuggerAgent* debuggerAgent = inspectorController->m_debuggerAgent.get())
+        debuggerAgent->cancelPauseOnNextStatement();
+#endif
+}
+
 InspectorTimelineAgent* InspectorInstrumentation::retrieveTimelineAgent(InspectorController* inspectorController)
 {
     return inspectorController->m_timelineAgent.get();
diff --git a/WebCore/inspector/InspectorInstrumentation.h b/WebCore/inspector/InspectorInstrumentation.h
index 7d5a527..e728a5e 100644
--- a/WebCore/inspector/InspectorInstrumentation.h
+++ b/WebCore/inspector/InspectorInstrumentation.h
@@ -146,6 +146,8 @@ private:
     static InspectorController* inspectorControllerForPage(Page*);
 
     static bool hasFrontend(InspectorController*);
+    static void pauseOnNativeEventIfNeeded(InspectorController*, const String& categoryType, const String& eventName, bool synchronous);
+    static void cancelPauseOnNativeEvent(InspectorController*);
     static InspectorTimelineAgent* retrieveTimelineAgent(InspectorController*);
     static InspectorTimelineAgent* retrieveTimelineAgent(const InspectorInstrumentationCookie&);
 
diff --git a/WebCore/inspector/front-end/BreakpointManager.js b/WebCore/inspector/front-end/BreakpointManager.js
index 0e72051..77ba89d 100644
--- a/WebCore/inspector/front-end/BreakpointManager.js
+++ b/WebCore/inspector/front-end/BreakpointManager.js
@@ -486,20 +486,32 @@ WebInspector.EventListenerBreakpoint.prototype = {
         return this._compare(this._eventName, other._eventName);
     },
 
-    label: function()
+    populateLabelElement: function(element)
     {
-        return this._eventName;
+        element.appendChild(document.createTextNode(this._uiEventName()));
     },
 
     populateStatusMessageElement: function(element, eventData)
     {
-        var status = WebInspector.UIString("Paused on a \"%s\" Event Listener.", this._eventName);
+        var status = WebInspector.UIString("Paused on a \"%s\" Event Listener.", this._uiEventName());
         element.appendChild(document.createTextNode(status));
     },
 
     _condition: function()
     {
         return { eventName: this._eventName };
+    },
+
+    _uiEventName: function()
+    {
+        if (!WebInspector.EventListenerBreakpoint._uiEventNames) {
+            WebInspector.EventListenerBreakpoint._uiEventNames = {
+                "instrumentation:setTimer": WebInspector.UIString("Set Timer"),
+                "instrumentation:clearTimer": WebInspector.UIString("Clear Timer"),
+                "instrumentation:timerFired": WebInspector.UIString("Timer Fired")
+            };
+        }
+        return WebInspector.EventListenerBreakpoint._uiEventNames[this._eventName] || this._eventName.substring(this._eventName.indexOf(":") + 1);
     }
 }
 
diff --git a/WebCore/inspector/front-end/BreakpointsSidebarPane.js b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
index 9ea67a1..2151137 100644
--- a/WebCore/inspector/front-end/BreakpointsSidebarPane.js
+++ b/WebCore/inspector/front-end/BreakpointsSidebarPane.js
@@ -246,8 +246,10 @@ WebInspector.EventListenerBreakpointsSidebarPane.prototype = {
     _populate: function()
     {
         var categories = {
-            "Mouse": ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove", "mouseout", "mousewheel"],
-            "Keyboard": ["keydown", "keypress", "keyup"]
+            "Mouse": { type: "listener", eventNames: ["click", "dblclick", "mousedown", "mouseup", "mouseover", "mousemove", "mouseout", "mousewheel"] },
+            "Keyboard": { type: "listener", eventNames: ["keydown", "keypress", "keyup"] },
+            "HTML frame/object":  { type: "listener", eventNames: ["load", "error", "resize", "scroll"] },
+            "Timer": { type: "instrumentation", eventNames: ["setTimer", "clearTimer", "timerFired"] }
         };
 
         for (var category in categories) {
@@ -260,15 +262,18 @@ WebInspector.EventListenerBreakpointsSidebarPane.prototype = {
             categoryItem.checkbox = this._createCheckbox(categoryTreeElement, this._categoryCheckboxClicked.bind(this, categoryItem));
             categoryItem.children = {};
 
-            var eventNames = categories[category];
+            var categoryType = categories[category].type;
+            var eventNames = categories[category].eventNames;
             for (var i = 0; i < eventNames.length; ++i) {
-                var eventName = eventNames[i];
+                var eventName = categoryType + ":" + eventNames[i];
 
                 var breakpoint = WebInspector.breakpointManager.createEventListenerBreakpoint(eventName, true);
                 if (!breakpoint)
                     continue;
 
-                var eventNameTreeElement = new TreeElement(breakpoint.label());
+                var labelElement = document.createElement("div");
+                breakpoint.populateLabelElement(labelElement);
+                var eventNameTreeElement = new TreeElement(labelElement);
                 categoryTreeElement.appendChild(eventNameTreeElement);
                 eventNameTreeElement.listItemElement.addStyleClass("source-code");
                 eventNameTreeElement.selectable = true;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list