Changeset 139729 in webkit


Ignore:
Timestamp:
Jan 15, 2013 1:46:29 AM (11 years ago)
Author:
aandrey@chromium.org
Message:

Web Inspector: [Canvas] introduce CallArgument type into the protocol
https://bugs.webkit.org/show_bug.cgi?id=106640

Reviewed by Yury Semikhatsky.

Source/WebCore:

CallArgument type abstraction to describe arguments of a canvas context call.
Drive-by: Introduce a CanvasContext to fix the wrong contextId value in the protocol.
The contextId should point to the Resource that represents a context (2D or 3D canvas).

  • inspector/InjectedScriptCanvasModuleSource.js:

(.):

  • inspector/Inspector.json:
  • inspector/front-end/CanvasProfileView.js:

LayoutTests:

Replaced hacky stub with actual Cache implementation.

  • inspector/profiler/webgl/webgl-profiler-get-error.html:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r139718 r139729  
     12013-01-15  Andrey Adaikin  <aandrey@chromium.org>
     2
     3        Web Inspector: [Canvas] introduce CallArgument type into the protocol
     4        https://bugs.webkit.org/show_bug.cgi?id=106640
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        Replaced hacky stub with actual Cache implementation.
     9
     10        * inspector/profiler/webgl/webgl-profiler-get-error.html:
     11
    1122013-01-14  Dominic Cooney   <dominicc@chromium.org>
    213
  • trunk/LayoutTests/inspector/profiler/webgl/webgl-profiler-get-error.html

    r133438 r139729  
    44    <script src="../canvas-profiler-test.js"></script>
    55<script>
     6
     7/**
     8 * @constructor
     9 */
     10function Cache()
     11{
     12    this.reset();
     13}
     14
     15Cache.prototype = {
     16    /**
     17     * @return {number}
     18     */
     19    size: function()
     20    {
     21        return this._size;
     22    },
     23
     24    reset: function()
     25    {
     26        /** @type {!Object.<number, Object>} */
     27        this._items = Object.create(null);
     28        /** @type {number} */
     29        this._size = 0;
     30    },
     31
     32    /**
     33     * @param {number} key
     34     * @return {boolean}
     35     */
     36    has: function(key)
     37    {
     38        return key in this._items;
     39    },
     40
     41    /**
     42     * @param {number} key
     43     * @return {Object}
     44     */
     45    get: function(key)
     46    {
     47        return this._items[key];
     48    },
     49
     50    /**
     51     * @param {number} key
     52     * @param {Object} item
     53     */
     54    put: function(key, item)
     55    {
     56        if (!this.has(key))
     57            ++this._size;
     58        this._items[key] = item;
     59    }
     60}
    661
    762var gl;
     
    84139    var errors = [rawGL.INVALID_ENUM, rawGL.INVALID_VALUE, rawGL.INVALID_OPERATION];
    85140    errors.forEach(generateWebGLError.bind(this, rawGL));
    86     var cache = {
    87         put: function() {},
    88         get: function() {}
    89     };
    90     glResource.toReplayable(cache);
     141    glResource.toReplayable(new Cache());
    91142    assertNoErrors(rawGL);
    92143    assertEqualArrays(errors, getAllErrors(gl));
     
    97148    var errors = [rawGL.INVALID_ENUM, rawGL.INVALID_VALUE, rawGL.INVALID_OPERATION];
    98149    errors.forEach(generateWebGLError.bind(this, rawGL));
    99     var cache = {
    100         put: function() {},
    101         get: function() {}
    102     };
    103     glResource.toReplayable(cache);
     150    glResource.toReplayable(new Cache());
    104151    assertNoErrors(rawGL);
    105152
  • trunk/Source/WebCore/ChangeLog

    r139726 r139729  
     12013-01-15  Andrey Adaikin  <aandrey@chromium.org>
     2
     3        Web Inspector: [Canvas] introduce CallArgument type into the protocol
     4        https://bugs.webkit.org/show_bug.cgi?id=106640
     5
     6        Reviewed by Yury Semikhatsky.
     7
     8        CallArgument type abstraction to describe arguments of a canvas context call.
     9        Drive-by: Introduce a CanvasContext to fix the wrong contextId value in the protocol.
     10        The contextId should point to the Resource that represents a context (2D or 3D canvas).
     11
     12        * inspector/InjectedScriptCanvasModuleSource.js:
     13        (.):
     14        * inspector/Inspector.json:
     15        * inspector/front-end/CanvasProfileView.js:
     16
    1172012-12-28  Vsevolod Vlasov  <vsevik@chromium.org>
    218
  • trunk/Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js

    r139426 r139729  
    397397    {
    398398        if (attachment) {
    399             this._attachments = this._attachments || {};
     399            /** @type {Object.<string, Object>} */
     400            this._attachments = this._attachments || Object.create(null);
    400401            this._attachments[name] = attachment;
    401402        } else if (this._attachments)
     
    447448    replay: function(replayableCall, cache)
    448449    {
    449         var replayObject = ReplayableResource.replay(replayableCall.resource(), cache);
     450        var replayObject = ReplayableResource.replay(replayableCall.replayableResource(), cache);
    450451        var replayArgs = replayableCall.args().map(function(obj) {
    451452            return ReplayableResource.replay(obj, cache);
     
    503504     * @return {ReplayableResource}
    504505     */
    505     resource: function()
     506    replayableResource: function()
    506507    {
    507508        return this._thisObject;
     
    579580 * @constructor
    580581 * @param {!Object} wrappedObject
    581  */
    582 function Resource(wrappedObject)
     582 * @param {string} name
     583 */
     584function Resource(wrappedObject, name)
    583585{
    584586    /** @type {number} */
    585587    this._id = ++Resource._uniqueId;
     588    /** @type {string} */
     589    this._name = name || "Resource";
     590    /** @type {number} */
     591    this._kindId = Resource._uniqueKindIds[this._name] = (Resource._uniqueKindIds[this._name] || 0) + 1;
    586592    /** @type {ResourceTrackingManager} */
    587593    this._resourceManager = null;
     
    604610 */
    605611Resource._uniqueId = 0;
     612
     613/**
     614 * @type {!Object.<string, number>}
     615 */
     616Resource._uniqueKindIds = {};
    606617
    607618/**
     
    704715
    705716    /**
     717     * @return {ContextResource}
     718     */
     719    contextResource: function()
     720    {
     721        if (this instanceof ContextResource)
     722            return /** @type {ContextResource} */ (this);
     723
     724        if (this._calculatingContextResource)
     725            return null;
     726
     727        this._calculatingContextResource = true;
     728        var result = null;
     729        for (var i = 0, n = this._calls.length; i < n; ++i) {
     730            result = this._calls[i].resource().contextResource();
     731            if (result)
     732                break;
     733        }
     734        delete this._calculatingContextResource;
     735        console.assert(result, "Failed to find context resource for " + this._name + "@" + this._kindId);
     736        return result;
     737    },
     738
     739    /**
    706740     * @param {!Cache} cache
    707741     * @return {!ReplayableResource}
     
    713747            return result;
    714748        var data = {
    715             id: this._id
     749            id: this._id,
     750            name: this._name,
     751            kindId: this._kindId
    716752        };
    717753        result = new ReplayableResource(this, data);
     
    721757        });
    722758        this._populateReplayableData(data, cache);
     759        var contextResource = this.contextResource();
     760        if (contextResource !== this)
     761            data.contextResource = Resource.toReplayable(contextResource, cache);
    723762        return result;
    724763    },
     
    744783            return resource;
    745784        this._id = data.id;
     785        this._name = data.name;
     786        this._kindId = data.kindId;
    746787        this._resourceManager = null;
    747788        this._calls = [];
     
    9841025
    9851026/**
    986  * @param {function(new:Resource, !Object)} resourceConstructor
     1027 * @param {function(new:Resource, !Object, string)} resourceConstructor
     1028 * @param {string} resourceName
    9871029 * @return {function(this:Resource.WrapFunction)}
    9881030 */
    989 Resource.WrapFunction.resourceFactoryMethod = function(resourceConstructor)
     1031Resource.WrapFunction.resourceFactoryMethod = function(resourceConstructor, resourceName)
    9901032{
    9911033    /** @this Resource.WrapFunction */
     
    9951037        if (!wrappedObject)
    9961038            return;
    997         var resource = new resourceConstructor(wrappedObject);
     1039        var resource = new resourceConstructor(wrappedObject, resourceName);
    9981040        var manager = this._resource.manager();
    9991041        if (manager)
     
    10251067
    10261068    /**
     1069     * @return {string}
     1070     */
     1071    description: function()
     1072    {
     1073        return this._data.name + "@" + this._data.kindId;
     1074    },
     1075
     1076    /**
     1077     * @return {!ReplayableResource}
     1078     */
     1079    replayableContextResource: function()
     1080    {
     1081        return this._data.contextResource || this;
     1082    },
     1083
     1084    /**
    10271085     * @param {!Cache} cache
    10281086     * @return {!Resource}
     
    10501108 * @constructor
    10511109 * @extends {Resource}
    1052  */
    1053 function LogEverythingResource(wrappedObject)
     1110 * @param {!Object} wrappedObject
     1111 * @param {string} name
     1112 */
     1113function ContextResource(wrappedObject, name)
    10541114{
    1055     Resource.call(this, wrappedObject);
     1115    Resource.call(this, wrappedObject, name);
     1116}
     1117
     1118ContextResource.prototype = {
     1119    __proto__: Resource.prototype
     1120}
     1121
     1122/**
     1123 * @constructor
     1124 * @extends {Resource}
     1125 * @param {!Object} wrappedObject
     1126 * @param {string} name
     1127 */
     1128function LogEverythingResource(wrappedObject, name)
     1129{
     1130    Resource.call(this, wrappedObject, name);
    10561131}
    10571132
     
    10871162 * @constructor
    10881163 * @extends {Resource}
    1089  */
    1090 function WebGLBoundResource(wrappedObject)
     1164 * @param {!Object} wrappedObject
     1165 * @param {string} name
     1166 */
     1167function WebGLBoundResource(wrappedObject, name)
    10911168{
    1092     Resource.call(this, wrappedObject);
     1169    Resource.call(this, wrappedObject, name);
    10931170    /** @type {!Object.<string, *>} */
    10941171    this._state = {};
     
    11171194    _doReplayCalls: function(data, cache)
    11181195    {
    1119         var state = {};
    1120         Object.keys(data.state).forEach(function(parameter) {
    1121             state[parameter] = ReplayableResource.replay(data.state[parameter], cache);
    1122         });
    1123         this._state = state;
    1124 
    11251196        var gl = this._replayContextResource(data, cache).wrappedObject();
    11261197
     1198        /** @type {!Object.<string, Array.<string>>} */
    11271199        var bindingsData = {
    11281200            TEXTURE_2D: ["bindTexture", "TEXTURE_BINDING_2D"],
     
    11391211        });
    11401212
     1213        var state = {};
     1214        Object.keys(data.state).forEach(function(parameter) {
     1215            state[parameter] = ReplayableResource.replay(data.state[parameter], cache);
     1216        });
     1217        this._state = state;
    11411218        Resource.prototype._doReplayCalls.call(this, data, cache);
    11421219
     
    11541231    _replayContextResource: function(data, cache)
    11551232    {
    1156         var calls = data.calls;
     1233        var calls = /** @type {!Array.<ReplayableCall>} */ (data.calls);
    11571234        for (var i = 0, n = calls.length; i < n; ++i) {
    1158             var resource = ReplayableResource.replay(calls[i].resource(), cache);
     1235            var resource = ReplayableResource.replay(calls[i].replayableResource(), cache);
    11591236            var contextResource = WebGLRenderingContextResource.forObject(resource);
    11601237            if (contextResource)
     
    11821259 * @constructor
    11831260 * @extends {WebGLBoundResource}
    1184  */
    1185 function WebGLTextureResource(wrappedObject)
     1261 * @param {!Object} wrappedObject
     1262 * @param {string} name
     1263 */
     1264function WebGLTextureResource(wrappedObject, name)
    11861265{
    1187     WebGLBoundResource.call(this, wrappedObject);
     1266    WebGLBoundResource.call(this, wrappedObject, name);
    11881267}
    11891268
     
    12551334        var glResource = WebGLRenderingContextResource.forObject(call.resource());
    12561335        var gl = glResource.wrappedObject();
    1257         var framebufferResource = /** @type {WebGLFramebufferResource} */ glResource.currentBinding(gl.FRAMEBUFFER);
     1336        var framebufferResource = /** @type {WebGLFramebufferResource} */ (glResource.currentBinding(gl.FRAMEBUFFER));
    12581337        if (framebufferResource)
    12591338            this.pushCall(new Call(glResource, "bindFramebuffer", [gl.FRAMEBUFFER, framebufferResource]));
     
    12711350 * @constructor
    12721351 * @extends {Resource}
    1273  */
    1274 function WebGLProgramResource(wrappedObject)
     1352 * @param {!Object} wrappedObject
     1353 * @param {string} name
     1354 */
     1355function WebGLProgramResource(wrappedObject, name)
    12751356{
    1276     Resource.call(this, wrappedObject);
     1357    Resource.call(this, wrappedObject, name);
    12771358}
    12781359
     
    13011382
    13021383        var uniforms = [];
    1303         var uniformsCount = /** @type {number} */ gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
     1384        var uniformsCount = /** @type {number} */ (gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS));
    13041385        for (var i = 0; i < uniformsCount; ++i) {
    13051386            var activeInfo = gl.getActiveUniform(program, i);
     
    14041485 * @constructor
    14051486 * @extends {Resource}
    1406  */
    1407 function WebGLShaderResource(wrappedObject)
     1487 * @param {!Object} wrappedObject
     1488 * @param {string} name
     1489 */
     1490function WebGLShaderResource(wrappedObject, name)
    14081491{
    1409     Resource.call(this, wrappedObject);
     1492    Resource.call(this, wrappedObject, name);
    14101493}
    14111494
     
    14401523 * @constructor
    14411524 * @extends {WebGLBoundResource}
    1442  */
    1443 function WebGLBufferResource(wrappedObject)
     1525 * @param {!Object} wrappedObject
     1526 * @param {string} name
     1527 */
     1528function WebGLBufferResource(wrappedObject, name)
    14441529{
    1445     WebGLBoundResource.call(this, wrappedObject);
     1530    WebGLBoundResource.call(this, wrappedObject, name);
    14461531}
    14471532
     
    14641549 * @constructor
    14651550 * @extends {WebGLBoundResource}
    1466  */
    1467 function WebGLFramebufferResource(wrappedObject)
     1551 * @param {!Object} wrappedObject
     1552 * @param {string} name
     1553 */
     1554function WebGLFramebufferResource(wrappedObject, name)
    14681555{
    1469     WebGLBoundResource.call(this, wrappedObject);
     1556    WebGLBoundResource.call(this, wrappedObject, name);
    14701557}
    14711558
     
    14871574 * @constructor
    14881575 * @extends {WebGLBoundResource}
    1489  */
    1490 function WebGLRenderbufferResource(wrappedObject)
     1576 * @param {!Object} wrappedObject
     1577 * @param {string} name
     1578 */
     1579function WebGLRenderbufferResource(wrappedObject, name)
    14911580{
    1492     WebGLBoundResource.call(this, wrappedObject);
     1581    WebGLBoundResource.call(this, wrappedObject, name);
    14931582}
    14941583
     
    15091598/**
    15101599 * @constructor
    1511  * @extends {Resource}
     1600 * @extends {ContextResource}
    15121601 * @param {!WebGLRenderingContext} glContext
    15131602 * @param {function():WebGLRenderingContext} replayContextCallback
     
    15151604function WebGLRenderingContextResource(glContext, replayContextCallback)
    15161605{
    1517     Resource.call(this, glContext);
     1606    ContextResource.call(this, glContext, "WebGLRenderingContext");
    15181607    this._replayContextCallback = replayContextCallback;
    15191608    /** @type {Object.<number, boolean>} */
     
    16141703{
    16151704    var resource = Resource.forObject(obj);
    1616     if (!resource || resource instanceof WebGLRenderingContextResource)
    1617         return resource;
    1618     var calls = resource.calls();
    1619     if (!calls || !calls.length)
     1705    if (!resource)
    16201706        return null;
    1621     resource = calls[0].resource();
     1707    resource = resource.contextResource();
    16221708    return (resource instanceof WebGLRenderingContextResource) ? resource : null;
    16231709}
     
    18641950        gl.activeTexture(glState.ACTIVE_TEXTURE);
    18651951
    1866         Resource.prototype._doReplayCalls.call(this, data, cache);
     1952        ContextResource.prototype._doReplayCalls.call(this, data, cache);
    18671953    },
    18681954
     
    19322018            wrapFunctions = Object.create(null);
    19332019
    1934             wrapFunctions["createBuffer"] = Resource.WrapFunction.resourceFactoryMethod(WebGLBufferResource);
    1935             wrapFunctions["createShader"] = Resource.WrapFunction.resourceFactoryMethod(WebGLShaderResource);
    1936             wrapFunctions["createProgram"] = Resource.WrapFunction.resourceFactoryMethod(WebGLProgramResource);
    1937             wrapFunctions["createTexture"] = Resource.WrapFunction.resourceFactoryMethod(WebGLTextureResource);
    1938             wrapFunctions["createFramebuffer"] = Resource.WrapFunction.resourceFactoryMethod(WebGLFramebufferResource);
    1939             wrapFunctions["createRenderbuffer"] = Resource.WrapFunction.resourceFactoryMethod(WebGLRenderbufferResource);
    1940             wrapFunctions["getUniformLocation"] = Resource.WrapFunction.resourceFactoryMethod(Resource);
     2020            wrapFunctions["createBuffer"] = Resource.WrapFunction.resourceFactoryMethod(WebGLBufferResource, "WebGLBuffer");
     2021            wrapFunctions["createShader"] = Resource.WrapFunction.resourceFactoryMethod(WebGLShaderResource, "WebGLShader");
     2022            wrapFunctions["createProgram"] = Resource.WrapFunction.resourceFactoryMethod(WebGLProgramResource, "WebGLProgram");
     2023            wrapFunctions["createTexture"] = Resource.WrapFunction.resourceFactoryMethod(WebGLTextureResource, "WebGLTexture");
     2024            wrapFunctions["createFramebuffer"] = Resource.WrapFunction.resourceFactoryMethod(WebGLFramebufferResource, "WebGLFramebuffer");
     2025            wrapFunctions["createRenderbuffer"] = Resource.WrapFunction.resourceFactoryMethod(WebGLRenderbufferResource, "WebGLRenderbuffer");
     2026            wrapFunctions["getUniformLocation"] = Resource.WrapFunction.resourceFactoryMethod(Resource, "WebGLUniformLocation");
    19412027
    19422028            /**
     
    20902176    },
    20912177
    2092     __proto__: Resource.prototype
     2178    __proto__: ContextResource.prototype
    20932179}
    20942180
     
    20992185/**
    21002186 * @constructor
    2101  * @extends {Resource}
     2187 * @extends {ContextResource}
    21022188 * @param {!CanvasRenderingContext2D} context
    21032189 * @param {function():CanvasRenderingContext2D} replayContextCallback
     
    21052191function CanvasRenderingContext2DResource(context, replayContextCallback)
    21062192{
    2107     Resource.call(this, context);
     2193    ContextResource.call(this, context, "CanvasRenderingContext2D");
    21082194    this._replayContextCallback = replayContextCallback;
    21092195}
     
    24342520            wrapFunctions = Object.create(null);
    24352521
    2436             wrapFunctions["createLinearGradient"] = Resource.WrapFunction.resourceFactoryMethod(LogEverythingResource);
    2437             wrapFunctions["createRadialGradient"] = Resource.WrapFunction.resourceFactoryMethod(LogEverythingResource);
    2438             wrapFunctions["createPattern"] = Resource.WrapFunction.resourceFactoryMethod(LogEverythingResource);
     2522            wrapFunctions["createLinearGradient"] = Resource.WrapFunction.resourceFactoryMethod(LogEverythingResource, "CanvasGradient");
     2523            wrapFunctions["createRadialGradient"] = Resource.WrapFunction.resourceFactoryMethod(LogEverythingResource, "CanvasGradient");
     2524            wrapFunctions["createPattern"] = Resource.WrapFunction.resourceFactoryMethod(LogEverythingResource, "CanvasPattern");
    24392525
    24402526            /**
     
    24732559    },
    24742560
    2475     __proto__: Resource.prototype
     2561    __proto__: ContextResource.prototype
    24762562}
    24772563
     
    25172603    addCall: function(call)
    25182604    {
    2519         var res = Resource.forObject(call.result());
    2520         if (res)
    2521             this.captureResource(res);
    2522         var size = this._replayablesCache.size();
    25232605        this._replayableCalls.push(call.toReplayable(this._replayablesCache));
    2524         console.assert(this._replayablesCache.size() === size, "Internal error: We should have captured all the resources already by this time.");
    25252606    }
    25262607}
     
    27112792 * @constructor
    27122793 */
    2713 var InjectedScript = function()
     2794var InjectedCanvasModule = function()
    27142795{
    27152796    /** @type {!ResourceTrackingManager} */
     
    27252806}
    27262807
    2727 InjectedScript.prototype = {
     2808InjectedCanvasModule.prototype = {
    27282809    /**
    27292810     * @param {!WebGLRenderingContext} glContext
     
    28282909        for (var i = startOffset, n = calls.length; i < n; ++i) {
    28292910            var call = calls[i];
    2830             var args = call.args().map(function(argument) {
    2831                 return argument + "";
    2832             });
     2911            var contextResource = call.replayableResource().replayableContextResource();
    28332912            var stackTrace = call.stackTrace();
    28342913            var callFrame = stackTrace ? stackTrace.callFrame(0) || {} : {};
    28352914            var traceLogItem = {
    2836                 contextId: this._makeContextId(call.resource().id()),
     2915                contextId: this._makeContextId(contextResource.id()),
    28372916                sourceURL: callFrame.sourceURL,
    28382917                lineNumber: callFrame.lineNumber,
     
    28412920            if (call.functionName()) {
    28422921                traceLogItem.functionName = call.functionName();
    2843                 traceLogItem.arguments = args;
     2922                traceLogItem.arguments = call.args().map(this._createRemoteObject.bind(this));
     2923                if (call.result() !== undefined)
     2924                    traceLogItem.result = this._createRemoteObject(call.result());
    28442925            } else {
    2845                 traceLogItem.property = args[0];
    2846                 traceLogItem.value = args[1];
     2926                traceLogItem.property = call.args()[0];
     2927                traceLogItem.value = this._createRemoteObject(call.args()[1]);
    28472928            }
    2848             var callResult = call.result();
    2849             if (callResult !== undefined && callResult !== null)
    2850                 traceLogItem.result = callResult + "";
    28512929            result.calls.push(traceLogItem);
    28522930        }
    28532931        return result;
     2932    },
     2933
     2934    /**
     2935     * @param {*} obj
     2936     * @return {Object}
     2937     */
     2938    _createRemoteObject: function(obj)
     2939    {
     2940        if (obj instanceof ReplayableResource)
     2941            var description = obj.description();
     2942        else
     2943            var description = "" + obj;
     2944        return { description: description };
    28542945    },
    28552946
     
    29463037}
    29473038
    2948 var injectedScript = new InjectedScript();
    2949 return injectedScript;
     3039var injectedCanvasModule = new InjectedCanvasModule();
     3040return injectedCanvasModule;
    29503041
    29513042})
  • trunk/Source/WebCore/inspector/Inspector.json

    r139429 r139729  
    31973197            },
    31983198            {
     3199                "id": "CallArgument",
     3200                "type": "object",
     3201                "properties": [
     3202                    { "name": "description", "type": "string" }
     3203                ]
     3204            },
     3205            {
    31993206                "id": "Call",
    32003207                "type": "object",
     
    32023209                    { "name": "contextId", "$ref": "ContextId" },
    32033210                    { "name": "functionName", "type": "string", "optional": true },
    3204                     { "name": "arguments", "type": "array", "items": { "type": "string" }, "optional": true },
     3211                    { "name": "arguments", "type": "array", "items": { "$ref": "CallArgument" }, "optional": true },
     3212                    { "name": "result", "$ref": "CallArgument", "optional": true },
    32053213                    { "name": "property", "type": "string", "optional": true },
    3206                     { "name": "value", "type": "string", "optional": true },
    3207                     { "name": "result", "type": "string", "optional": true },
     3214                    { "name": "value", "$ref": "CallArgument", "optional": true },
    32083215                    { "name": "sourceURL", "type": "string", "optional": true },
    32093216                    { "name": "lineNumber", "type": "integer", "optional": true },
  • trunk/Source/WebCore/inspector/front-end/CanvasProfileView.js

    r139614 r139729  
    218218    _createCallNode: function(index, call)
    219219    {
    220         var traceLogItem = document.createElement("div");
    221220        var data = {};
    222221        data[0] = index + 1;
     
    230229        }
    231230
    232         if (call.arguments)
    233             data[1] += "(" + call.arguments.join(", ") + ")";
    234         else
    235             data[1] += " = " + call.value;
     231        if (call.arguments) {
     232            var args = call.arguments.map(function(argument) {
     233                return argument.description;
     234            });
     235            data[1] += "(" + args.join(", ") + ")";
     236        } else
     237            data[1] += " = " + call.value.description;
    236238
    237239        if (typeof call.result !== "undefined")
    238             data[1] += " => " + call.result;
     240            data[1] += " => " + call.result.description;
    239241
    240242        var node = new WebInspector.DataGridNode(data);
    241         node.call = call;
    242243        node.index = index;
    243244        node.selectable = true;
Note: See TracChangeset for help on using the changeset viewer.