2010-06-26 Pavel Feldman <pfeldman@chromium.org>
authorpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Jun 2010 13:25:43 +0000 (13:25 +0000)
committerpfeldman@chromium.org <pfeldman@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 26 Jun 2010 13:25:43 +0000 (13:25 +0000)
        Reviewed by Yury Semikhatsky.

        Web Inspector: ScripsPanel.prototype.editScriptSource uses old addBreakpoint signature.

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

        * inspector/front-end/BreakpointManager.js:
        (WebInspector.BreakpointManager.prototype.removeBreakpoint):
        (WebInspector.Breakpoint.prototype.set enabled):
        (WebInspector.Breakpoint.prototype.set condition):
        * inspector/front-end/Object.js:
        (WebInspector.Object.prototype.addEventListener):
        (WebInspector.Object.prototype.removeEventListener):
        (WebInspector.Object.prototype.removeAllListeners):
        * inspector/front-end/ScriptsPanel.js:
        (WebInspector.ScriptsPanel.prototype.editScriptSource.mycallback):
        (WebInspector.ScriptsPanel.prototype.editScriptSource):

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

WebCore/ChangeLog
WebCore/inspector/front-end/BreakpointManager.js
WebCore/inspector/front-end/Object.js
WebCore/inspector/front-end/ScriptsPanel.js

index cd533b15078ea400a64a4fcea2003c72c1647bfd..fde8186076ae616bf068b5abc5f46962d1c0206f 100644 (file)
@@ -1,3 +1,23 @@
+2010-06-26  Pavel Feldman  <pfeldman@chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        Web Inspector: ScripsPanel.prototype.editScriptSource uses old addBreakpoint signature.
+
+        https://bugs.webkit.org/show_bug.cgi?id=41247
+
+        * inspector/front-end/BreakpointManager.js:
+        (WebInspector.BreakpointManager.prototype.removeBreakpoint):
+        (WebInspector.Breakpoint.prototype.set enabled):
+        (WebInspector.Breakpoint.prototype.set condition):
+        * inspector/front-end/Object.js:
+        (WebInspector.Object.prototype.addEventListener):
+        (WebInspector.Object.prototype.removeEventListener):
+        (WebInspector.Object.prototype.removeAllListeners):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype.editScriptSource.mycallback):
+        (WebInspector.ScriptsPanel.prototype.editScriptSource):
+
 2010-06-26  Tony Gentilcore  <tonyg@chromium.org>
 
         Reviewed by Dimitri Glazkov.
index 4f6965ad9ade3ef85d9290f55ea02cf393433714..9356b7a5aa98d4b521e2d5c16ffbe39a41d85a5a 100644 (file)
@@ -66,6 +66,8 @@ WebInspector.BreakpointManager.prototype = {
     {
         if (!(breakpoint.id in this._breakpoints))
             return;
+        breakpoint.removeAllListeners();
+        delete breakpoint._breakpointManager;
         delete this._breakpoints[breakpoint.id];
         this._removeBreakpointFromBackend(breakpoint);
         this.dispatchEventToListeners("breakpoint-removed", breakpoint);
index 27e21445e2f85d8682b3c5eaad3365ebd89a7843..5872b8b51fbcb53d4fb46fa6cebb3fc702480680 100644 (file)
@@ -27,7 +27,8 @@ WebInspector.Object = function() {
 }
 
 WebInspector.Object.prototype = {
-    addEventListener: function(eventType, listener, thisObject) {
+    addEventListener: function(eventType, listener, thisObject)
+    {
         if (!("_listeners" in this))
             this._listeners = {};
         if (!(eventType in this._listeners))
@@ -35,7 +36,8 @@ WebInspector.Object.prototype = {
         this._listeners[eventType].push({ thisObject: thisObject, listener: listener });
     },
 
-    removeEventListener: function(eventType, listener, thisObject) {
+    removeEventListener: function(eventType, listener, thisObject)
+    {
         if (!("_listeners" in this) || !(eventType in this._listeners))
             return;
         var listeners = this._listeners[eventType];
@@ -50,7 +52,13 @@ WebInspector.Object.prototype = {
             delete this._listeners[eventType];
     },
 
-    dispatchEventToListeners: function(eventType, eventData) {
+    removeAllListeners: function()
+    {
+        delete this._listeners;
+    },
+
+    dispatchEventToListeners: function(eventType, eventData)
+    {
         if (!("_listeners" in this) || !(eventType in this._listeners))
             return;
 
index c23db141d59207cef9904448d46b517604b699be..9e9b2ecc59dc00296668e53855d789ff61262443 100644 (file)
@@ -364,9 +364,10 @@ WebInspector.ScriptsPanel.prototype = {
             }
             for (var i = 0; i < breakpoints.length; ++i) {
                 var breakpoint = breakpoints[i];
+                var newLine = breakpoint.line;
                 if (success && breakpoint.line >= line)
-                    breakpoint.line += linesCountToShift;
-                WebInspector.breakpointManager.addBreakpoint(breakpoint);
+                    newLine += linesCountToShift;
+                WebInspector.breakpointManager.addBreakpoint(sourceID, breakpoint.url, newLine, breakpoint.enabled, breakpoint.condition);
             }
         };
         var callbackId = WebInspector.Callback.wrap(mycallback.bind(this))