Title: [119898] trunk
Revision
119898
Author
[email protected]
Date
2012-06-09 04:23:50 -0700 (Sat, 09 Jun 2012)

Log Message

Web Inspector: Limit DebuggerAgent.Location use to DebuggerModel only, introduce WebInspector.RawLocation to be used elsewhere.
https://bugs.webkit.org/show_bug.cgi?id=87270

Reviewed by Pavel Feldman.

Source/WebCore:

Introduced WebInspector.RawLocation interface, a generic raw location independent from concrete domain (Styles, Debugger).
Made WebInspector.DebuggerModel.Location implement it and switched all debugger related methods to it.

* inspector/front-end/BreakpointManager.js:
(WebInspector.BreakpointManager.prototype._breakpointResolved):
* inspector/front-end/CompilerScriptMapping.js:
(WebInspector.CompilerScriptMapping.prototype.rawLocationToUILocation):
* inspector/front-end/DebuggerModel.js:
(WebInspector.DebuggerModel.Location):
(WebInspector.DebuggerModel.prototype.continueToLocation):
(WebInspector.DebuggerModel.prototype.setBreakpointByScriptLocation):
(WebInspector.DebuggerModel.prototype.setBreakpoint.didSetBreakpoint):
(WebInspector.DebuggerModel.prototype.setBreakpoint):
(WebInspector.DebuggerModel.prototype.setBreakpointBySourceId):
(WebInspector.DebuggerModel.prototype._breakpointResolved):
(WebInspector.DebuggerModel.prototype.createRawLocation):
(WebInspector.DebuggerModel.prototype.createRawLocationByURL):
(WebInspector.DebuggerModel.prototype.setSelectedCallFrame):
(WebInspector.DebuggerModel.prototype.createLiveLocation):
(WebInspector.DebuggerModel.CallFrame.prototype.get location):
(WebInspector.DebuggerModel.CallFrame.prototype.createLiveLocation):
* inspector/front-end/DebuggerResourceBinding.js:
(WebInspector.DebuggerResourceBinding.setScriptSource.didEditScriptSource):
(WebInspector.DebuggerResourceBinding.setScriptSource):
(WebInspector.DebuggerResourceBinding.prototype.setContent.get if):
(WebInspector.DebuggerResourceBinding.prototype.setContent):
(WebInspector.DebuggerResourceBinding.prototype._setContentWithInitialContent):
* inspector/front-end/_javascript_Source.js:
(WebInspector._javascript_Source.prototype.uiLocationToRawLocation):
* inspector/front-end/Linkifier.js:
* inspector/front-end/ObjectPopoverHelper.js:
(WebInspector.ObjectPopoverHelper.prototype._showObjectPopover.showObjectPopover.):
(WebInspector.ObjectPopoverHelper.prototype._showObjectPopover):
* inspector/front-end/PresentationConsoleMessageHelper.js:
* inspector/front-end/RawSourceCode.js:
* inspector/front-end/ResourceScriptMapping.js:
(WebInspector.ResourceScriptMapping.prototype.rawLocationToUILocation):
* inspector/front-end/Script.js:
(WebInspector.Script.prototype.rawLocationToUILocation):
* inspector/front-end/ScriptSnippetModel.js:
(WebInspector.SnippetScriptMapping.prototype.rawLocationToUILocation):
* inspector/front-end/SourceMapping.js:
* inspector/front-end/UISourceCode.js:
(WebInspector.RawLocation):

LayoutTests:

* inspector/debugger/breakpoint-manager.html:
* inspector/debugger/pause-in-inline-script.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (119897 => 119898)


--- trunk/LayoutTests/ChangeLog	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/LayoutTests/ChangeLog	2012-06-09 11:23:50 UTC (rev 119898)
@@ -1,3 +1,13 @@
+2012-05-25  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: Limit DebuggerAgent.Location use to DebuggerModel only, introduce WebInspector.RawLocation to be used elsewhere.
+        https://bugs.webkit.org/show_bug.cgi?id=87270
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/debugger/breakpoint-manager.html:
+        * inspector/debugger/pause-in-inline-script.html:
+
 2012-06-08  Levi Weintraub  <[email protected]>
 
         RenderLayer::paintChildLayerIntoColumns doesn't properly pixel snap

Modified: trunk/LayoutTests/inspector/debugger/breakpoint-manager.html (119897 => 119898)


--- trunk/LayoutTests/inspector/debugger/breakpoint-manager.html	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/LayoutTests/inspector/debugger/breakpoint-manager.html	2012-06-09 11:23:50 UTC (rev 119898)
@@ -16,7 +16,7 @@
 
         uiLocationToRawLocation: function(uiSourceCode, lineNumber)
         {
-            return { scriptId: uiSourceCode.url, lineNumber: lineNumber, columnNumber: 0 };
+            return new WebInspector.DebuggerModel.Location(uiSourceCode.url, lineNumber, 0);
         }
     };
 
@@ -28,7 +28,7 @@
 
         uiLocationToRawLocation: function(uiSourceCode, lineNumber)
         {
-            return { scriptId: uiSourceCode.url, lineNumber: lineNumber - 10, columnNumber: 0 };
+            return new WebInspector.DebuggerModel.Location(uiSourceCode.url, lineNumber - 10, 0);
         }
     };
 

Modified: trunk/LayoutTests/inspector/debugger/pause-in-inline-script.html (119897 => 119898)


--- trunk/LayoutTests/inspector/debugger/pause-in-inline-script.html	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/LayoutTests/inspector/debugger/pause-in-inline-script.html	2012-06-09 11:23:50 UTC (rev 119898)
@@ -49,7 +49,7 @@
         for (var scriptId in WebInspector.debuggerModel.scripts) {
             var script = WebInspector.debuggerModel.scripts[scriptId];
             if (script.sourceURL && script.sourceURL.indexOf(testName) !== -1 && script.lineOffset == 6) {
-                var location = new WebInspector.DebuggerModel.Location(script, 6, 0);
+                var location = new WebInspector.DebuggerModel.Location(script.scriptId, 6, 0);
                 var uiLocation = WebInspector.debuggerModel.rawLocationToUILocation(location);
                 WebInspector.panels.scripts.showUISourceCode(uiLocation.uiSourceCode);
                 var sourceFrame = WebInspector.panels.scripts.visibleView;

Modified: trunk/Source/WebCore/ChangeLog (119897 => 119898)


--- trunk/Source/WebCore/ChangeLog	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/ChangeLog	2012-06-09 11:23:50 UTC (rev 119898)
@@ -1,3 +1,55 @@
+2012-05-25  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: Limit DebuggerAgent.Location use to DebuggerModel only, introduce WebInspector.RawLocation to be used elsewhere.
+        https://bugs.webkit.org/show_bug.cgi?id=87270
+
+        Reviewed by Pavel Feldman.
+
+        Introduced WebInspector.RawLocation interface, a generic raw location independent from concrete domain (Styles, Debugger).
+        Made WebInspector.DebuggerModel.Location implement it and switched all debugger related methods to it.
+
+        * inspector/front-end/BreakpointManager.js:
+        (WebInspector.BreakpointManager.prototype._breakpointResolved):
+        * inspector/front-end/CompilerScriptMapping.js:
+        (WebInspector.CompilerScriptMapping.prototype.rawLocationToUILocation):
+        * inspector/front-end/DebuggerModel.js:
+        (WebInspector.DebuggerModel.Location):
+        (WebInspector.DebuggerModel.prototype.continueToLocation):
+        (WebInspector.DebuggerModel.prototype.setBreakpointByScriptLocation):
+        (WebInspector.DebuggerModel.prototype.setBreakpoint.didSetBreakpoint):
+        (WebInspector.DebuggerModel.prototype.setBreakpoint):
+        (WebInspector.DebuggerModel.prototype.setBreakpointBySourceId):
+        (WebInspector.DebuggerModel.prototype._breakpointResolved):
+        (WebInspector.DebuggerModel.prototype.createRawLocation):
+        (WebInspector.DebuggerModel.prototype.createRawLocationByURL):
+        (WebInspector.DebuggerModel.prototype.setSelectedCallFrame):
+        (WebInspector.DebuggerModel.prototype.createLiveLocation):
+        (WebInspector.DebuggerModel.CallFrame.prototype.get location):
+        (WebInspector.DebuggerModel.CallFrame.prototype.createLiveLocation):
+        * inspector/front-end/DebuggerResourceBinding.js:
+        (WebInspector.DebuggerResourceBinding.setScriptSource.didEditScriptSource):
+        (WebInspector.DebuggerResourceBinding.setScriptSource):
+        (WebInspector.DebuggerResourceBinding.prototype.setContent.get if):
+        (WebInspector.DebuggerResourceBinding.prototype.setContent):
+        (WebInspector.DebuggerResourceBinding.prototype._setContentWithInitialContent):
+        * inspector/front-end/_javascript_Source.js:
+        (WebInspector._javascript_Source.prototype.uiLocationToRawLocation):
+        * inspector/front-end/Linkifier.js:
+        * inspector/front-end/ObjectPopoverHelper.js:
+        (WebInspector.ObjectPopoverHelper.prototype._showObjectPopover.showObjectPopover.):
+        (WebInspector.ObjectPopoverHelper.prototype._showObjectPopover):
+        * inspector/front-end/PresentationConsoleMessageHelper.js:
+        * inspector/front-end/RawSourceCode.js:
+        * inspector/front-end/ResourceScriptMapping.js:
+        (WebInspector.ResourceScriptMapping.prototype.rawLocationToUILocation):
+        * inspector/front-end/Script.js:
+        (WebInspector.Script.prototype.rawLocationToUILocation):
+        * inspector/front-end/ScriptSnippetModel.js:
+        (WebInspector.SnippetScriptMapping.prototype.rawLocationToUILocation):
+        * inspector/front-end/SourceMapping.js:
+        * inspector/front-end/UISourceCode.js:
+        (WebInspector.RawLocation):
+
 2012-06-09  Eugene Klyuchnikov  <[email protected]>
 
         Web Inspector: Add message loop instrumentation to public API and timeline agent

Modified: trunk/Source/WebCore/inspector/front-end/BreakpointManager.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/BreakpointManager.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/BreakpointManager.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -186,7 +186,7 @@
     _breakpointResolved: function(event)
     {
         var breakpointId = /** @type {DebuggerAgent.BreakpointId} */ event.data.breakpointId;
-        var location = /** @type {DebuggerAgent.Location} */ event.data.location;
+        var location = /** @type {WebInspector.DebuggerModel.Location} */ event.data.location;
         var breakpoint = this._breakpointForDebuggerId[breakpointId];
         if (!breakpoint || breakpoint._isProvisional)
             return;
@@ -282,7 +282,7 @@
     },
 
     /**
-     * @param {DebuggerAgent.Location} location
+     * @param {WebInspector.DebuggerModel.Location} location
      */
     _addResolvedLocation: function(location)
     {
@@ -290,7 +290,7 @@
     },
 
     /**
-     * @param {DebuggerAgent.Location} location
+     * @param {WebInspector.DebuggerModel.Location} location
      * @param {WebInspector.UILocation} uiLocation
      */
     _locationUpdated: function(location, uiLocation)
@@ -368,11 +368,12 @@
     _setInDebugger: function()
     {
         var rawLocation = this._primaryUILocation.uiLocationToRawLocation();
-        this._breakpointManager._debuggerModel.setBreakpointByScriptLocation(rawLocation, this._condition, didSetBreakpoint.bind(this));
+        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */ rawLocation;
+        this._breakpointManager._debuggerModel.setBreakpointByScriptLocation(debuggerModelLocation, this._condition, didSetBreakpoint.bind(this));
         /**
          * @this {WebInspector.BreakpointManager.Breakpoint}
          * @param {?DebuggerAgent.BreakpointId} breakpointId
-         * @param {Array.<DebuggerAgent.Location>} locations
+         * @param {Array.<WebInspector.DebuggerModel.Location>} locations
          */
         function didSetBreakpoint(breakpointId, locations)
         {

Modified: trunk/Source/WebCore/inspector/front-end/CompilerScriptMapping.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/CompilerScriptMapping.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/CompilerScriptMapping.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -45,13 +45,14 @@
 
 WebInspector.CompilerScriptMapping.prototype = {
     /**
-     * @param {DebuggerAgent.Location} rawLocation
+     * @param {WebInspector.RawLocation} rawLocation
      * @return {WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation)
     {
-        var sourceMap = this._sourceMapForScriptId[rawLocation.scriptId];
-        var entry = sourceMap.findEntry(rawLocation.lineNumber, rawLocation.columnNumber || 0);
+        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */ rawLocation;
+        var sourceMap = this._sourceMapForScriptId[debuggerModelLocation.scriptId];
+        var entry = sourceMap.findEntry(debuggerModelLocation.lineNumber, debuggerModelLocation.columnNumber || 0);
         return new WebInspector.UILocation(this._uiSourceCodeByURL[entry[2]], entry[3], entry[4]);
     },
 
@@ -59,7 +60,7 @@
      * @param {WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {DebuggerAgent.Location}
+     * @return {WebInspector.DebuggerModel.Location}
      */
     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
     {

Modified: trunk/Source/WebCore/inspector/front-end/DebuggerModel.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/DebuggerModel.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/DebuggerModel.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -49,14 +49,15 @@
 
 /**
  * @constructor
+ * @implements {WebInspector.RawLocation}
  * @extends {DebuggerAgent.Location}
- * @param {WebInspector.Script} script
+ * @param {string} scriptId
  * @param {number} lineNumber
  * @param {number} columnNumber
  */
-WebInspector.DebuggerModel.Location = function(script, lineNumber, columnNumber)
+WebInspector.DebuggerModel.Location = function(scriptId, lineNumber, columnNumber)
 {
-    this.scriptId = script.scriptId;
+    this.scriptId = scriptId;
     this.lineNumber = lineNumber;
     this.columnNumber = columnNumber;
 }
@@ -118,25 +119,25 @@
     },
 
     /**
-     * @param {DebuggerAgent.Location} location
+     * @param {WebInspector.DebuggerModel.Location} rawLocation
      */
-    continueToLocation: function(location)
+    continueToLocation: function(rawLocation)
     {
-        DebuggerAgent.continueToLocation(location);
+        DebuggerAgent.continueToLocation(rawLocation);
     },
 
     /**
-     * @param {DebuggerAgent.Location} location
+     * @param {WebInspector.DebuggerModel.Location} rawLocation
      * @param {string} condition
-     * @param {function(?DebuggerAgent.BreakpointId, Array.<DebuggerAgent.Location>):void=} callback
+     * @param {function(?DebuggerAgent.BreakpointId, Array.<WebInspector.DebuggerModel.Location>):void=} callback
      */
-    setBreakpointByScriptLocation: function(location, condition, callback)
+    setBreakpointByScriptLocation: function(rawLocation, condition, callback)
     {
-        var script = this.scriptForId(location.scriptId);
+        var script = this.scriptForId(rawLocation.scriptId);
         if (script.sourceURL)
-            this.setBreakpoint(script.sourceURL, location.lineNumber, location.columnNumber, condition, callback);
+            this.setBreakpoint(script.sourceURL, rawLocation.lineNumber, rawLocation.columnNumber, condition, callback);
         else
-            this.setBreakpointBySourceId(location, condition, callback);
+            this.setBreakpointBySourceId(rawLocation, condition, callback);
     },
 
     /**
@@ -144,7 +145,7 @@
      * @param {number} lineNumber
      * @param {number=} columnNumber
      * @param {string=} condition
-     * @param {function(?DebuggerAgent.BreakpointId, Array.<DebuggerAgent.Location>)=} callback
+     * @param {function(?DebuggerAgent.BreakpointId, Array.<WebInspector.DebuggerModel.Location>)=} callback
      */
     setBreakpoint: function(url, lineNumber, columnNumber, condition, callback)
     {
@@ -166,19 +167,21 @@
          */
         function didSetBreakpoint(error, breakpointId, locations)
         {
-            if (callback)
-                callback(error ? null : breakpointId, locations);
+            if (callback) {
+                var rawLocations = /** @type {Array.<WebInspector.DebuggerModel.Location>} */ locations;
+                callback(error ? null : breakpointId, rawLocations);
+            }
         }
         DebuggerAgent.setBreakpointByUrl(lineNumber, url, undefined, columnNumber, condition, didSetBreakpoint.bind(this));
         WebInspector.userMetrics.ScriptsBreakpointSet.record();
     },
 
     /**
-     * @param {DebuggerAgent.Location} location
+     * @param {WebInspector.DebuggerModel.Location} rawLocation
      * @param {string} condition
-     * @param {function(?DebuggerAgent.BreakpointId, Array.<DebuggerAgent.Location>)=} callback
+     * @param {function(?DebuggerAgent.BreakpointId, Array.<WebInspector.DebuggerModel.Location>)=} callback
      */
-    setBreakpointBySourceId: function(location, condition, callback)
+    setBreakpointBySourceId: function(rawLocation, condition, callback)
     {
         /**
          * @this {WebInspector.DebuggerModel}
@@ -188,10 +191,12 @@
          */
         function didSetBreakpoint(error, breakpointId, actualLocation)
         {
-            if (callback)
-                callback(error ? null : breakpointId, [actualLocation]);
+            if (callback) {
+                var rawLocation = /** @type {WebInspector.DebuggerModel.Location} */ actualLocation;
+                callback(error ? null : breakpointId, [rawLocation]);
+            }
         }
-        DebuggerAgent.setBreakpoint(location, condition, didSetBreakpoint.bind(this));
+        DebuggerAgent.setBreakpoint(rawLocation, condition, didSetBreakpoint.bind(this));
         WebInspector.userMetrics.ScriptsBreakpointSet.record();
     },
 
@@ -367,20 +372,20 @@
      * @param {WebInspector.Script} script
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {DebuggerAgent.Location}
+     * @return {WebInspector.DebuggerModel.Location}
      */
     createRawLocation: function(script, lineNumber, columnNumber)
     {
         if (script.sourceURL)
             return this.createRawLocationByURL(script.sourceURL, lineNumber, columnNumber)
-        return new WebInspector.DebuggerModel.Location(script, lineNumber, columnNumber);
+        return new WebInspector.DebuggerModel.Location(script.scriptId, lineNumber, columnNumber);
     },
 
     /**
      * @param {string} sourceURL
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {DebuggerAgent.Location}
+     * @return {WebInspector.DebuggerModel.Location}
      */
     createRawLocationByURL: function(sourceURL, lineNumber, columnNumber)
     {
@@ -397,7 +402,7 @@
             closestScript = script;
             break;
         }
-        return closestScript ? new WebInspector.DebuggerModel.Location(closestScript, lineNumber, columnNumber) : null;
+        return closestScript ? new WebInspector.DebuggerModel.Location(closestScript.scriptId, lineNumber, columnNumber) : null;
     },
 
     /**
@@ -427,7 +432,7 @@
         {
             this.dispatchEventToListeners(WebInspector.DebuggerModel.Events.ExecutionLineChanged, uiLocation);
         }
-        this._executionLineLiveLocation = callFrame.script.createLiveLocation(callFrame._payload.location, updateExecutionLine.bind(this));
+        this._executionLineLiveLocation = callFrame.script.createLiveLocation(callFrame.location, updateExecutionLine.bind(this));
     },
 
     /**
@@ -516,18 +521,18 @@
     },
 
     /**
-     * @param {DebuggerAgent.Location} location
+     * @param {WebInspector.DebuggerModel.Location} rawLocation
      * @param {function(WebInspector.UILocation):(boolean|undefined)} updateDelegate
      * @return {WebInspector.Script.Location}
      */
-    createLiveLocation: function(location, updateDelegate)
+    createLiveLocation: function(rawLocation, updateDelegate)
     {
-        var script = this._scripts[location.scriptId];
-        return script.createLiveLocation(location, updateDelegate);
+        var script = this._scripts[rawLocation.scriptId];
+        return script.createLiveLocation(rawLocation, updateDelegate);
     },
 
     /**
-     * @param {DebuggerAgent.Location} rawLocation
+     * @param {WebInspector.DebuggerModel.Location} rawLocation
      * @return {?WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation)
@@ -668,11 +673,12 @@
     },
 
     /**
-     * @return {DebuggerAgent.Location}
+     * @return {WebInspector.DebuggerModel.Location}
      */
     get location()
     {
-        return this._payload.location;
+        var rawLocation = /** @type {WebInspector.DebuggerModel.Location} */ this._payload.location;
+        return rawLocation;
     },
 
     /**
@@ -708,7 +714,7 @@
      */
     createLiveLocation: function(updateDelegate)
     {
-        var location = this._script.createLiveLocation(this._payload.location, updateDelegate);
+        var location = this._script.createLiveLocation(this.location, updateDelegate);
         this._locations.push(location);
         return location;
     },

Modified: trunk/Source/WebCore/inspector/front-end/DebuggerResourceBinding.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/DebuggerResourceBinding.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/DebuggerResourceBinding.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -40,13 +40,13 @@
 }
 
 /**
- * @param {WebInspector.UISourceCode} uiSourceCode
+ * @param {WebInspector._javascript_Source} _javascript_Source
  * @param {string} newSource
  * @param {function(?Protocol.Error)} callback
  */
-WebInspector.DebuggerResourceBinding.setScriptSource = function(uiSourceCode, newSource, callback)
+WebInspector.DebuggerResourceBinding.setScriptSource = function(_javascript_Source, newSource, callback)
 {
-    var rawLocation = uiSourceCode.uiLocationToRawLocation(0, 0);
+    var rawLocation = _javascript_Source.uiLocationToRawLocation(0, 0);
     var script = WebInspector.debuggerModel.scriptForId(rawLocation.scriptId);
 
     /**
@@ -60,7 +60,7 @@
             return;
         }
 
-        var resource = uiSourceCode.resource();
+        var resource = _javascript_Source.resource();
         if (resource)
             resource.addRevision(newSource);
 
@@ -91,24 +91,24 @@
         if (!majorChange)
             return;
 
-        var uiSourceCode = WebInspector._javascript_Source._javascript_SourceForResource.get(resource);
-        if (!uiSourceCode) {
+        var _javascript_Source = WebInspector._javascript_Source._javascript_SourceForResource.get(resource);
+        if (!_javascript_Source) {
             userCallback("Resource is not editable");
             return;
         }
 
-        resource.requestContent(this._setContentWithInitialContent.bind(this, uiSourceCode, content, userCallback));
+        resource.requestContent(this._setContentWithInitialContent.bind(this, _javascript_Source, content, userCallback));
     },
 
     /**
-     * @param {WebInspector.UISourceCode} uiSourceCode
+     * @param {WebInspector._javascript_Source} _javascript_Source
      * @param {string} content
      * @param {function(?string)} userCallback
      * @param {?string} oldContent
      * @param {boolean} oldContentEncoded
      * @param {string} mimeType
      */
-    _setContentWithInitialContent: function(uiSourceCode, content, userCallback, oldContent, oldContentEncoded, mimeType)
+    _setContentWithInitialContent: function(_javascript_Source, content, userCallback, oldContent, oldContentEncoded, mimeType)
     {
         /**
          * @this {WebInspector.DebuggerResourceBinding}
@@ -119,7 +119,7 @@
             if (userCallback)
                 userCallback(error);
         }
-        WebInspector.DebuggerResourceBinding.setScriptSource(uiSourceCode, content, callback.bind(this));
+        WebInspector.DebuggerResourceBinding.setScriptSource(_javascript_Source, content, callback.bind(this));
     }
 }
 

Modified: trunk/Source/WebCore/inspector/front-end/_javascript_Source.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/_javascript_Source.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/_javascript_Source.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -142,12 +142,14 @@
     /**
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {DebuggerAgent.Location}
+     * @return {WebInspector.DebuggerModel.Location}
      */
     uiLocationToRawLocation: function(lineNumber, columnNumber)
     {
         var location = this._formatterMapping.formattedToOriginal(lineNumber, columnNumber);
-        return WebInspector.UISourceCode.prototype.uiLocationToRawLocation.call(this, location[0], location[1]);
+        var rawLocation = WebInspector.UISourceCode.prototype.uiLocationToRawLocation.call(this, location[0], location[1]);
+        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */ rawLocation;
+        return debuggerModelLocation;
     },
 
     /**

Modified: trunk/Source/WebCore/inspector/front-end/Linkifier.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/Linkifier.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/Linkifier.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -69,7 +69,7 @@
     },
 
     /**
-     * @param {DebuggerAgent.Location} rawLocation
+     * @param {WebInspector.DebuggerModel.Location} rawLocation
      * @param {string=} classes
      */
     linkifyRawLocation: function(rawLocation, classes)

Modified: trunk/Source/WebCore/inspector/front-end/ObjectPopoverHelper.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/ObjectPopoverHelper.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/ObjectPopoverHelper.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -90,7 +90,8 @@
                         functionName.textContent = response.name || response.inferredName || response.displayName || WebInspector.UIString("(anonymous function)");
 
                         this._linkifier = new WebInspector.Linkifier();
-                        var link = this._linkifier.linkifyRawLocation(response.location, "function-location-link");
+                        var rawLocation = /** @type {WebInspector.DebuggerModel.Location} */ response.location;
+                        var link = this._linkifier.linkifyRawLocation(rawLocation, "function-location-link");
                         if (link)
                             title.appendChild(link);
 

Modified: trunk/Source/WebCore/inspector/front-end/PresentationConsoleMessageHelper.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/PresentationConsoleMessageHelper.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/PresentationConsoleMessageHelper.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -65,7 +65,7 @@
 
     /**
      * @param {WebInspector.ConsoleMessage} message
-     * @param {DebuggerAgent.Location} rawLocation
+     * @param {WebInspector.DebuggerModel.Location} rawLocation
      */
     _addConsoleMessageToScript: function(message, rawLocation)
     {
@@ -130,7 +130,7 @@
 /**
  * @constructor
  * @param {WebInspector.ConsoleMessage} message
- * @param {DebuggerAgent.Location} rawLocation
+ * @param {WebInspector.DebuggerModel.Location} rawLocation
  */
 WebInspector.PresentationConsoleMessage = function(message, rawLocation)
 {

Modified: trunk/Source/WebCore/inspector/front-end/RawSourceCode.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/RawSourceCode.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/RawSourceCode.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -76,7 +76,7 @@
     },
 
     /**
-     * @param {DebuggerAgent.Location} rawLocation
+     * @param {WebInspector.DebuggerModel.Location} rawLocation
      * @return {WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation)
@@ -114,7 +114,7 @@
      * @param {WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {DebuggerAgent.Location}
+     * @return {WebInspector.RawLocation}
      */
     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
     {

Modified: trunk/Source/WebCore/inspector/front-end/ResourceScriptMapping.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/ResourceScriptMapping.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/ResourceScriptMapping.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -45,20 +45,21 @@
 
 WebInspector.ResourceScriptMapping.prototype = {
     /**
-     * @param {DebuggerAgent.Location} rawLocation
+     * @param {WebInspector.RawLocation} rawLocation
      * @return {WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation)
     {
-        var rawSourceCode = this._rawSourceCodeForScriptId[rawLocation.scriptId];
-        return rawSourceCode.rawLocationToUILocation(rawLocation);
+        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */ rawLocation;
+        var rawSourceCode = this._rawSourceCodeForScriptId[debuggerModelLocation.scriptId];
+        return rawSourceCode.rawLocationToUILocation(debuggerModelLocation);
     },
 
     /**
      * @param {WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {DebuggerAgent.Location}
+     * @return {WebInspector.DebuggerModel.Location}
      */
     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
     {

Modified: trunk/Source/WebCore/inspector/front-end/Script.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/Script.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/Script.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -173,7 +173,7 @@
      */
     rawLocationToUILocation: function(lineNumber, columnNumber)
     {
-        var uiLocation = this._sourceMapping.rawLocationToUILocation(new WebInspector.DebuggerModel.Location(this, lineNumber, columnNumber || 0));
+        var uiLocation = this._sourceMapping.rawLocationToUILocation(new WebInspector.DebuggerModel.Location(this.scriptId, lineNumber, columnNumber || 0));
         return uiLocation.uiSourceCode.overrideLocation(uiLocation);
     },
 
@@ -188,7 +188,7 @@
     },
 
     /**
-     * @param {DebuggerAgent.Location} rawLocation
+     * @param {WebInspector.DebuggerModel.Location} rawLocation
      * @param {function(WebInspector.UILocation):(boolean|undefined)} updateDelegate
      * @return {WebInspector.Script.Location}
      */
@@ -205,7 +205,7 @@
 /**
  * @constructor
  * @param {WebInspector.Script} script
- * @param {DebuggerAgent.Location} rawLocation
+ * @param {WebInspector.DebuggerModel.Location} rawLocation
  * @param {function(WebInspector.UILocation):(boolean|undefined)} updateDelegate
  */
 WebInspector.Script.Location = function(script, rawLocation, updateDelegate)

Modified: trunk/Source/WebCore/inspector/front-end/ScriptSnippetModel.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/ScriptSnippetModel.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/ScriptSnippetModel.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -133,7 +133,7 @@
     },
 
     /**
-     * @param {DebuggerAgent.Location} rawLocation
+     * @param {WebInspector.DebuggerModel.Location} rawLocation
      * @return {WebInspector.UILocation}
      */
     _rawLocationToUILocation: function(rawLocation)
@@ -151,7 +151,7 @@
      * @param {WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {DebuggerAgent.Location}
+     * @return {WebInspector.DebuggerModel.Location}
      */
     _uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
     {
@@ -350,19 +350,20 @@
 
 WebInspector.SnippetScriptMapping.prototype = {
     /**
-     * @param {DebuggerAgent.Location} rawLocation
+     * @param {WebInspector.RawLocation} rawLocation
      * @return {WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation)
     {
-        return this._scriptSnippetModel._rawLocationToUILocation(rawLocation);
+        var debuggerModelLocation = /** @type {WebInspector.DebuggerModel.Location} */ rawLocation;
+        return this._scriptSnippetModel._rawLocationToUILocation(debuggerModelLocation);
     },
 
     /**
      * @param {WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {DebuggerAgent.Location}
+     * @return {WebInspector.DebuggerModel.Location}
      */
     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber)
     {

Modified: trunk/Source/WebCore/inspector/front-end/SourceMapping.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/SourceMapping.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/SourceMapping.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -37,7 +37,7 @@
 
 WebInspector.SourceMapping.prototype = {
     /**
-     * @param {DebuggerAgent.Location} rawLocation
+     * @param {WebInspector.RawLocation} rawLocation
      * @return {WebInspector.UILocation}
      */
     rawLocationToUILocation: function(rawLocation) { },
@@ -46,7 +46,7 @@
      * @param {WebInspector.UISourceCode} uiSourceCode
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {DebuggerAgent.Location}
+     * @return {WebInspector.RawLocation}
      */
     uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber) { }
 }

Modified: trunk/Source/WebCore/inspector/front-end/UISourceCode.js (119897 => 119898)


--- trunk/Source/WebCore/inspector/front-end/UISourceCode.js	2012-06-09 10:16:10 UTC (rev 119897)
+++ trunk/Source/WebCore/inspector/front-end/UISourceCode.js	2012-06-09 11:23:50 UTC (rev 119898)
@@ -287,7 +287,7 @@
     /**
      * @param {number} lineNumber
      * @param {number} columnNumber
-     * @return {DebuggerAgent.Location}
+     * @return {WebInspector.RawLocation}
      */
     uiLocationToRawLocation: function(lineNumber, columnNumber)
     {
@@ -420,10 +420,17 @@
 
 WebInspector.UILocation.prototype = {
     /**
-     * @return {DebuggerAgent.Location}
+     * @return {WebInspector.RawLocation}
      */
     uiLocationToRawLocation: function()
     {
         return this.uiSourceCode.uiLocationToRawLocation(this.lineNumber, this.columnNumber);
     }
 }
+
+/**
+ * @interface
+ */
+WebInspector.RawLocation = function()
+{
+}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to