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

podivilov at chromium.org podivilov at chromium.org
Wed Dec 22 18:40:13 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 9183c7550b05f7d6ccae0499d4686c818d214989
Author: podivilov at chromium.org <podivilov at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 15 17:36:04 2010 +0000

    2010-12-13  Pavel Podivilov  <podivilov at chromium.org>
    
            Reviewed by Pavel Feldman.
    
            Web Inspector: move scripts storage from ScriptsPanel to DebuggerModel.
            https://bugs.webkit.org/show_bug.cgi?id=50908
    
            * inspector/front-end/BreakpointManager.js:
            (WebInspector.BreakpointManager):
            (WebInspector.BreakpointManager.prototype._debuggerPaused):
            * inspector/front-end/CallStackSidebarPane.js:
            (WebInspector.CallStackSidebarPane):
            (WebInspector.CallStackSidebarPane.prototype.update):
            * inspector/front-end/DebuggerModel.js:
            (WebInspector.DebuggerModel):
            (WebInspector.DebuggerModel.prototype.setBreakpoint):
            (WebInspector.DebuggerModel.prototype._setBreakpoint):
            (WebInspector.DebuggerModel.prototype.scriptForSourceID):
            (WebInspector.DebuggerModel.prototype.scriptsForURL):
            (WebInspector.DebuggerModel.prototype.queryScripts):
            (WebInspector.DebuggerModel.prototype.parsedScriptSource):
            (WebInspector.DebuggerModel.prototype.failedToParseScriptSource):
            (WebInspector.DebuggerModel.prototype.breakpointRestored):
            (WebInspector.DebuggerModel.prototype.debuggerPaused):
            (WebInspector.DebuggerModel.prototype.debuggerResumed):
            * inspector/front-end/Resource.js:
            * inspector/front-end/ScriptsPanel.js:
            (WebInspector.ScriptsPanel): eliminate sourceIDMap
            * inspector/front-end/SourceFrame.js:
            (WebInspector.SourceFrame.prototype._createViewerIfNeeded):
            (WebInspector.SourceFrame.prototype._setBreakpoint):
            * inspector/front-end/SourceView.js:
            (WebInspector.SourceView):
            * inspector/front-end/inspector.js:
            (WebInspector.createJSBreakpointsSidebarPane):
            (WebInspector.parsedScriptSource):
            (WebInspector.failedToParseScriptSource):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74119 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1dc3732..5c1a1af 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,41 @@
+2010-12-13  Pavel Podivilov  <podivilov at chromium.org>
+
+        Reviewed by Pavel Feldman.
+
+        Web Inspector: move scripts storage from ScriptsPanel to DebuggerModel.
+        https://bugs.webkit.org/show_bug.cgi?id=50908
+
+        * inspector/front-end/BreakpointManager.js:
+        (WebInspector.BreakpointManager):
+        (WebInspector.BreakpointManager.prototype._debuggerPaused):
+        * inspector/front-end/CallStackSidebarPane.js:
+        (WebInspector.CallStackSidebarPane):
+        (WebInspector.CallStackSidebarPane.prototype.update):
+        * inspector/front-end/DebuggerModel.js:
+        (WebInspector.DebuggerModel):
+        (WebInspector.DebuggerModel.prototype.setBreakpoint):
+        (WebInspector.DebuggerModel.prototype._setBreakpoint):
+        (WebInspector.DebuggerModel.prototype.scriptForSourceID):
+        (WebInspector.DebuggerModel.prototype.scriptsForURL):
+        (WebInspector.DebuggerModel.prototype.queryScripts):
+        (WebInspector.DebuggerModel.prototype.parsedScriptSource):
+        (WebInspector.DebuggerModel.prototype.failedToParseScriptSource):
+        (WebInspector.DebuggerModel.prototype.breakpointRestored):
+        (WebInspector.DebuggerModel.prototype.debuggerPaused):
+        (WebInspector.DebuggerModel.prototype.debuggerResumed):
+        * inspector/front-end/Resource.js:
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel): eliminate sourceIDMap
+        * inspector/front-end/SourceFrame.js:
+        (WebInspector.SourceFrame.prototype._createViewerIfNeeded):
+        (WebInspector.SourceFrame.prototype._setBreakpoint):
+        * inspector/front-end/SourceView.js:
+        (WebInspector.SourceView):
+        * inspector/front-end/inspector.js:
+        (WebInspector.createJSBreakpointsSidebarPane):
+        (WebInspector.parsedScriptSource):
+        (WebInspector.failedToParseScriptSource):
+
 2010-12-15  Eric Carlson  <eric.carlson at apple.com>
 
         Reviewed by Darin Adler.
diff --git a/WebCore/inspector/front-end/BreakpointManager.js b/WebCore/inspector/front-end/BreakpointManager.js
index 172f0a6..4d9d3aa 100644
--- a/WebCore/inspector/front-end/BreakpointManager.js
+++ b/WebCore/inspector/front-end/BreakpointManager.js
@@ -40,8 +40,8 @@ WebInspector.BreakpointManager = function()
     this._domBreakpointsRestored = false;
 
     WebInspector.settings.addEventListener(WebInspector.Settings.Events.ProjectChanged, this._projectChanged, this);
-    WebInspector.debuggerModel.addEventListener("native-breakpoint-hit", this._nativeBreakpointHit, this);
-    WebInspector.debuggerModel.addEventListener("debugger-resumed", this._debuggerResumed, this);
+    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this);
+    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this);
 }
 
 WebInspector.BreakpointManager.NativeBreakpointTypes = {
@@ -152,9 +152,13 @@ WebInspector.BreakpointManager.prototype = {
         this._saveBreakpoints();
     },
 
-    _nativeBreakpointHit: function(event)
+    _debuggerPaused: function(event)
     {
-        var eventData = event.data;
+        var eventType = event.data.eventType;
+        var eventData = event.data.eventData;
+
+        if (eventType !== WebInspector.DebuggerEventTypes.NativeBreakpoint)
+            return;
 
         var breakpointId;
         if (eventData.breakpointType === WebInspector.BreakpointManager.NativeBreakpointTypes.DOM)
diff --git a/WebCore/inspector/front-end/CallStackSidebarPane.js b/WebCore/inspector/front-end/CallStackSidebarPane.js
index 265c80f..40b96f3 100644
--- a/WebCore/inspector/front-end/CallStackSidebarPane.js
+++ b/WebCore/inspector/front-end/CallStackSidebarPane.js
@@ -27,11 +27,11 @@ WebInspector.CallStackSidebarPane = function()
 {
     WebInspector.SidebarPane.call(this, WebInspector.UIString("Call Stack"));
     WebInspector.breakpointManager.addEventListener(WebInspector.BreakpointManager.Events.NativeBreakpointHit, this._nativeBreakpointHit, this);
-    WebInspector.debuggerModel.addEventListener("script-breakpoint-hit", this._scriptBreakpointHit, this);
+    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointHit, this._scriptBreakpointHit, this);
 }
 
 WebInspector.CallStackSidebarPane.prototype = {
-    update: function(callFrames, sourceIDMap)
+    update: function(callFrames)
     {
         this.bodyElement.removeChildren();
 
@@ -48,7 +48,7 @@ WebInspector.CallStackSidebarPane.prototype = {
 
         var title;
         var subtitle;
-        var scriptOrResource;
+        var script;
 
         for (var i = 0; i < callFrames.length; ++i) {
             var callFrame = callFrames[i];
@@ -61,9 +61,9 @@ WebInspector.CallStackSidebarPane.prototype = {
                 break;
             }
 
-            scriptOrResource = sourceIDMap[callFrame.sourceID];
-            if (scriptOrResource)
-                subtitle = WebInspector.displayNameForURL(scriptOrResource.sourceURL || scriptOrResource.url);
+            script = WebInspector.debuggerModel.scriptForSourceID(callFrame.sourceID);
+            if (script)
+                subtitle = WebInspector.displayNameForURL(script.sourceURL);
             else
                 subtitle = WebInspector.UIString("(internal script)");
 
diff --git a/WebCore/inspector/front-end/DebuggerModel.js b/WebCore/inspector/front-end/DebuggerModel.js
index ca74301..cc87755 100644
--- a/WebCore/inspector/front-end/DebuggerModel.js
+++ b/WebCore/inspector/front-end/DebuggerModel.js
@@ -30,8 +30,19 @@
 
 WebInspector.DebuggerModel = function()
 {
-    this._breakpoints = {};
     InspectorBackend.registerDomainDispatcher("Debugger", this);
+
+    this._breakpoints = {};
+    this._scripts = {};
+}
+
+WebInspector.DebuggerModel.Events = {
+    DebuggerPaused: "debugger-paused",
+    DebuggerResumed: "debugger-resumed",
+    ParsedScriptSource: "parsed-script-source",
+    FailedToParseScriptSource: "failed-to-parse-script-source",
+    BreakpointAdded: "breakpoint-added",
+    BreakpointHit: "breakpoint-hit"
 }
 
 WebInspector.DebuggerModel.prototype = {
@@ -55,18 +66,14 @@ WebInspector.DebuggerModel.prototype = {
         }
     },
 
-    setBreakpoint: function(sourceID, url, line, enabled, condition)
+    setBreakpoint: function(sourceID, line, enabled, condition)
     {
+        var url = this._scripts[sourceID].sourceURL;
         var breakpoint = this._setBreakpoint(sourceID, url, line, enabled, condition);
         if (breakpoint)
             this._setBreakpointOnBackend(breakpoint);
     },
 
-    breakpointRestored: function(sourceID, url, line, enabled, condition)
-    {
-        this._setBreakpoint(sourceID, url, line, enabled, condition);
-    },
-
     queryBreakpoints: function(filter)
     {
         var breakpoints = [];
@@ -88,6 +95,7 @@ WebInspector.DebuggerModel.prototype = {
     {
         this._breakpoints = {};
         delete this._oneTimeBreakpoint;
+        this._scripts = {};
     },
 
     _setBreakpoint: function(sourceID, url, line, enabled, condition)
@@ -99,7 +107,7 @@ WebInspector.DebuggerModel.prototype = {
             delete this._oneTimeBreakpoint;
         this._breakpoints[breakpoint.id] = breakpoint;
         breakpoint.addEventListener("removed", this._breakpointRemoved, this);
-        this.dispatchEventToListeners("breakpoint-added", breakpoint);
+        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointAdded, breakpoint);
         return breakpoint;
     },
 
@@ -128,16 +136,40 @@ WebInspector.DebuggerModel.prototype = {
         InspectorBackend.setBreakpoint(breakpoint.sourceID, breakpoint.line, breakpoint.enabled, breakpoint.condition, didSetBreakpoint.bind(this));
     },
 
+    scriptForSourceID: function(sourceID)
+    {
+        return this._scripts[sourceID];
+    },
+
+    scriptsForURL: function(url)
+    {
+        return this.queryScripts(function(s) { return s.sourceURL === url; });
+    },
+
+    queryScripts: function(filter)
+    {
+        var scripts = [];
+        for (var sourceID in this._scripts) {
+            var script = this._scripts[sourceID];
+            if (filter(script))
+                scripts.push(script);
+        }
+        return scripts;
+    },
+
+    // All the methods below are InspectorBackend notification handlers.
+
+    breakpointRestored: function(sourceID, url, line, enabled, condition)
+    {
+        this._setBreakpoint(sourceID, url, line, enabled, condition);
+    },
+
     pausedScript: function(details)
     {
-        this.dispatchEventToListeners("debugger-paused", details.callFrames);
+        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerPaused, details);
 
-        if (details.eventType === WebInspector.DebuggerEventTypes.JavaScriptPause)
-            return;
-        if (details.eventType === WebInspector.DebuggerEventTypes.NativeBreakpoint) {
-            this.dispatchEventToListeners("native-breakpoint-hit", details.eventData);
+        if (details.eventType === WebInspector.DebuggerEventTypes.JavaScriptPause || details.eventType === WebInspector.DebuggerEventTypes.NativeBreakpoint)
             return;
-        }
 
         var breakpointId = WebInspector.Breakpoint.jsBreakpointId(details.callFrames[0].sourceID, details.callFrames[0].line);
         var breakpoint = this._breakpoints[breakpointId];
@@ -145,12 +177,12 @@ WebInspector.DebuggerModel.prototype = {
             return;
         breakpoint.hit = true;
         this._lastHitBreakpoint = breakpoint;
-        this.dispatchEventToListeners("script-breakpoint-hit", breakpoint);
+        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.BreakpointHit, breakpoint);
     },
 
     resumedScript: function()
     {
-        this.dispatchEventToListeners("debugger-resumed");
+        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.DebuggerResumed);
 
         if (!this._lastHitBreakpoint)
             return;
@@ -175,12 +207,15 @@ WebInspector.DebuggerModel.prototype = {
 
     parsedScriptSource: function(sourceID, sourceURL, source, startingLine, scriptWorldType)
     {
-        WebInspector.panels.scripts.addScript(sourceID, sourceURL, source, startingLine, undefined, undefined, scriptWorldType);
+        var script = new WebInspector.Script(sourceID, sourceURL, source, startingLine, undefined, undefined, scriptWorldType);
+        this._scripts[sourceID] = script;
+        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ParsedScriptSource, sourceID);
     },
 
     failedToParseScriptSource: function(sourceURL, source, startingLine, errorLine, errorMessage)
     {
-        WebInspector.panels.scripts.addScript(null, sourceURL, source, startingLine, errorLine, errorMessage);
+        var script = new WebInspector.Script(null, sourceURL, source, startingLine, errorLine, errorMessage, undefined);
+        this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, script);
     },
 
     didCreateWorker: function()
diff --git a/WebCore/inspector/front-end/Resource.js b/WebCore/inspector/front-end/Resource.js
index d03a684..da21092 100644
--- a/WebCore/inspector/front-end/Resource.js
+++ b/WebCore/inspector/front-end/Resource.js
@@ -497,48 +497,6 @@ WebInspector.Resource.prototype = {
         }
     },
 
-    get scripts()
-    {
-        if (!("_scripts" in this))
-            this._scripts = [];
-        return this._scripts;
-    },
-
-    addScript: function(script)
-    {
-        if (!script)
-            return;
-        this.scripts.unshift(script);
-        script.resource = this;
-    },
-
-    removeAllScripts: function()
-    {
-        if (!this._scripts)
-            return;
-
-        for (var i = 0; i < this._scripts.length; ++i) {
-            if (this._scripts[i].resource === this)
-                delete this._scripts[i].resource;
-        }
-
-        delete this._scripts;
-    },
-
-    removeScript: function(script)
-    {
-        if (!script)
-            return;
-
-        if (script.resource === this)
-            delete script.resource;
-
-        if (!this._scripts)
-            return;
-
-        this._scripts.remove(script);
-    },
-
     get errors()
     {
         return this._errors || 0;
diff --git a/WebCore/inspector/front-end/ScriptsPanel.js b/WebCore/inspector/front-end/ScriptsPanel.js
index 97d5443..1409f74 100644
--- a/WebCore/inspector/front-end/ScriptsPanel.js
+++ b/WebCore/inspector/front-end/ScriptsPanel.js
@@ -177,8 +177,10 @@ WebInspector.ScriptsPanel = function()
 
     this.reset();
 
-    WebInspector.debuggerModel.addEventListener("debugger-paused", this._debuggerPaused, this);
-    WebInspector.debuggerModel.addEventListener("debugger-resumed", this._debuggerResumed, this);
+    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.ParsedScriptSource, this._parsedScriptSource, this);
+    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.FailedToParseScriptSource, this._failedToParseScriptSource, this);
+    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this);
+    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerResumed, this._debuggerResumed, this);
 }
 
 // Keep these in sync with WebCore::ScriptDebugServer
@@ -235,17 +237,25 @@ WebInspector.ScriptsPanel.prototype = {
         return this.toggleBreakpointsButton.toggled;
     },
 
-    addScript: function(sourceID, sourceURL, source, startingLine, errorLine, errorMessage, scriptWorldType)
+    _parsedScriptSource: function(event)
     {
-        var script = new WebInspector.Script(sourceID, sourceURL, source, startingLine, errorLine, errorMessage, scriptWorldType);
-        this._sourceIDMap[sourceID] = script;
+        var sourceID = event.data;
+        var script = WebInspector.debuggerModel.scriptForSourceID(sourceID);
+        this._addScript(script);
+    },
+
+    _failedToParseScriptSource: function(event)
+    {
+        this._addScript(event.data);
+    },
 
-        var resource = WebInspector.resourceForURL(sourceURL);
+    _addScript: function(script)
+    {
+        var resource = WebInspector.resourceForURL(script.sourceURL);
         if (resource) {
             if (resource.finished) {
                 // Resource is finished, bind the script right away.
-                resource.addScript(script);
-                this._sourceIDMap[sourceID] = resource;
+                script.resource = resource;
             } else {
                 // Resource is not finished, bind the script later.
                 if (!resource._scriptsPendingResourceLoad) {
@@ -271,8 +281,7 @@ WebInspector.ScriptsPanel.prototype = {
         for (var i = 0; i < resource._scriptsPendingResourceLoad.length; ++i) {
             // Bind script to resource.
             var script = resource._scriptsPendingResourceLoad[i];
-            resource.addScript(script);
-            this._sourceIDMap[script.sourceID] = resource;
+            script.resource = resource;
 
             // Remove script from the files list.
             script.filesSelectOption.parentElement.removeChild(script.filesSelectOption);
@@ -302,7 +311,7 @@ WebInspector.ScriptsPanel.prototype = {
             if (success) {
                 commitEditingCallback(newBodyOrErrorMessage);
                 if (callFrames && callFrames.length)
-                    this._debuggerPaused({ data: callFrames });
+                    this._debuggerPaused({ data: { callFrames: callFrames } });
             } else {
                 if (cancelEditingCallback)
                     cancelEditingCallback();
@@ -313,7 +322,7 @@ WebInspector.ScriptsPanel.prototype = {
                 var newLine = breakpoint.line;
                 if (success && breakpoint.line >= editData.line)
                     newLine += editData.linesCountToShift;
-                WebInspector.debuggerModel.setBreakpoint(editData.sourceID, breakpoint.url, newLine, breakpoint.enabled, breakpoint.condition);
+                WebInspector.debuggerModel.setBreakpoint(editData.sourceID, newLine, breakpoint.enabled, breakpoint.condition);
             }
         };
         InspectorBackend.editScriptSource(editData.sourceID, editData.content, mycallback.bind(this));
@@ -358,7 +367,7 @@ WebInspector.ScriptsPanel.prototype = {
 
     _debuggerPaused: function(event)
     {
-        var callFrames = event.data;
+        var callFrames = event.data.callFrames;
 
         WebInspector.debuggerModel.removeOneTimeBreakpoint();
         this._paused = true;
@@ -369,7 +378,7 @@ WebInspector.ScriptsPanel.prototype = {
 
         WebInspector.currentPanel = this;
 
-        this.sidebarPanes.callstack.update(callFrames, this._sourceIDMap);
+        this.sidebarPanes.callstack.update(callFrames);
         this.sidebarPanes.callstack.selectedCallFrame = callFrames[0];
 
         window.focus();
@@ -430,17 +439,9 @@ WebInspector.ScriptsPanel.prototype = {
         this.functionsSelectElement.removeChildren();
         this.viewsContainerElement.removeChildren();
 
-        if (this._sourceIDMap) {
-            for (var sourceID in this._sourceIDMap) {
-                var object = this._sourceIDMap[sourceID];
-                if (object instanceof WebInspector.Resource) {
-                    object.removeAllScripts();
-                    delete object._resourcesView;
-                }
-            }
-        }
-
-        this._sourceIDMap = {};
+        var scripts = WebInspector.debuggerModel.queryScripts(function(s) { return !!s.resource; });
+        for (var i = 0; i < scripts.length; ++i)
+            delete scripts[i].resource._resourcesView;
 
         this.sidebarPanes.watchExpressions.refreshExpressions();
         if (!preserveItems)
@@ -487,22 +488,15 @@ WebInspector.ScriptsPanel.prototype = {
 
     _scriptOrResourceForURLAndLine: function(url, line)
     {
-        var scriptWithMatchingUrl = null;
-        for (var sourceID in this._sourceIDMap) {
-            var scriptOrResource = this._sourceIDMap[sourceID];
-            if (scriptOrResource instanceof WebInspector.Script) {
-                if (scriptOrResource.sourceURL !== url)
-                    continue;
-                scriptWithMatchingUrl = scriptOrResource;
-                if (scriptWithMatchingUrl.startingLine <= line && scriptWithMatchingUrl.startingLine + scriptWithMatchingUrl.linesCount > line)
-                    return scriptWithMatchingUrl;
-            } else {
-                var resource = scriptOrResource;
-                if (resource.url === url)
-                    return resource;
-            }
+        var scripts = WebInspector.debuggerModel.scriptsForURL(url);
+        for (var i = 0; i < scripts.length; ++i) {
+            var script = scripts[i];
+            if (script.resource)
+                return script.resource;
+            if (script.startingLine <= line && script.startingLine + script.linesCount > line)
+                return script;
         }
-        return scriptWithMatchingUrl;
+        return null;
     },
 
     showView: function(view)
@@ -721,7 +715,8 @@ WebInspector.ScriptsPanel.prototype = {
         this.sidebarPanes.scopechain.update(currentFrame);
         this.sidebarPanes.watchExpressions.refreshExpressions();
 
-        var scriptOrResource = this._sourceIDMap[currentFrame.sourceID];
+        var script = WebInspector.debuggerModel.scriptForSourceID(currentFrame.sourceID);
+        var scriptOrResource = script.resource || script;
         this._showScriptOrResource(scriptOrResource, {line: currentFrame.line});
 
         this._executionSourceFrame = this._sourceFrameForScriptOrResource(scriptOrResource);
diff --git a/WebCore/inspector/front-end/SourceFrame.js b/WebCore/inspector/front-end/SourceFrame.js
index ab03807..97e0d9d 100644
--- a/WebCore/inspector/front-end/SourceFrame.js
+++ b/WebCore/inspector/front-end/SourceFrame.js
@@ -220,7 +220,7 @@ WebInspector.SourceFrame.prototype = {
         var breakpoints = this._breakpoints();
         for (var i = 0; i < breakpoints.length; ++i)
             this._addBreakpoint(breakpoints[i]);
-        WebInspector.debuggerModel.addEventListener("breakpoint-added", this._breakpointAdded, this);
+        WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointAdded, this._breakpointAdded, this);
 
         this._textViewer.endUpdates();
 
@@ -819,7 +819,7 @@ WebInspector.SourceFrame.prototype = {
     _setBreakpoint: function(lineNumber)
     {
         var sourceID = this._sourceIDForLine(lineNumber);
-        WebInspector.debuggerModel.setBreakpoint(sourceID, this._url, lineNumber, true, "");
+        WebInspector.debuggerModel.setBreakpoint(sourceID, lineNumber, true, "");
         if (!WebInspector.panels.scripts.breakpointsActivated)
             WebInspector.panels.scripts.toggleBreakpointsClicked();
     },
diff --git a/WebCore/inspector/front-end/SourceView.js b/WebCore/inspector/front-end/SourceView.js
index fe9a7e3..7a97db2 100644
--- a/WebCore/inspector/front-end/SourceView.js
+++ b/WebCore/inspector/front-end/SourceView.js
@@ -32,8 +32,9 @@ WebInspector.SourceView = function(resource)
 
     this.element.addStyleClass("source");
 
+    var scripts = WebInspector.debuggerModel.scriptsForURL(resource.url);
     var canEditScripts = WebInspector.panels.scripts.canEditScripts() && resource.type === WebInspector.Resource.Type.Script;
-    this.sourceFrame = new WebInspector.SourceFrame(this.element, resource.scripts, canEditScripts);
+    this.sourceFrame = new WebInspector.SourceFrame(this.element, scripts, canEditScripts);
     resource.addEventListener("finished", this._resourceLoadingFinished, this);
     this._frameNeedsSetup = true;
 }
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index e2c8b7b..98c398c 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -192,7 +192,7 @@ var WebInspector = {
         {
             pane.addBreakpointItem(new WebInspector.BreakpointItem(event.data));
         }
-        WebInspector.debuggerModel.addEventListener("breakpoint-added", breakpointAdded);
+        WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.BreakpointAdded, breakpointAdded);
         return pane;
     },
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list