Bug 107280 - Web Inspector: [Canvas] add getResourceInfo and getResourceState methods to the protocol
Summary: Web Inspector: [Canvas] add getResourceInfo and getResourceState methods to t...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Andrey Adaikin
URL:
Keywords:
Depends on:
Blocks: 107274
  Show dependency treegraph
 
Reported: 2013-01-18 07:20 PST by Andrey Adaikin
Modified: 2013-01-18 08:51 PST (History)
8 users (show)

See Also:


Attachments
Patch (20.71 KB, patch)
2013-01-18 07:30 PST, Andrey Adaikin
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Adaikin 2013-01-18 07:20:57 PST
We need to expose replayable resource info and replay state via the protocol.
The ResourceInfo describes a replayable resource, i.e. the info about a resource that was stored to replay it later.
The ResourceState describes a current state of a resource being replayed on the back-end.

Patch to follow.
Comment 1 Andrey Adaikin 2013-01-18 07:30:17 PST
Created attachment 183452 [details]
Patch
Comment 2 Pavel Feldman 2013-01-18 08:02:35 PST
Comment on attachment 183452 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=183452&action=review

> Source/WebCore/inspector/InjectedScriptCanvasModule.cpp:158
> +void InjectedScriptCanvasModule::resourceInfo(ErrorString* errorString, const String& resourceId, RefPtr<TypeBuilder::Canvas::ResourceInfo>* result)

getResourceInfo (since you use output parameter).

> Source/WebCore/inspector/InjectedScriptCanvasModule.cpp:172
> +void InjectedScriptCanvasModule::resourceState(ErrorString* errorString, const String& traceLogId, const String& resourceId, RefPtr<TypeBuilder::Canvas::ResourceState>* result)

ditto

> Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js:2972
> +     * @param {string} traceLogId

CanvasAgent.TraceLogId

> Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js:3011
> +        return {

I'd introduce a small wrapper that goes into runtime cast.

> Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js:3069
> +     * @return {!Object}

@return {{id:string,...

> Source/WebCore/inspector/Inspector.json:3215
> +                    { "name": "dataURL", "type": "string", "optional": true, "description": "Screenshot data URL." }

imageURL
Comment 3 Andrey Adaikin 2013-01-18 08:44:48 PST
Comment on attachment 183452 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=183452&action=review

>> Source/WebCore/inspector/InjectedScriptCanvasModuleSource.js:2972
>> +     * @param {string} traceLogId
> 
> CanvasAgent.TraceLogId

we'll need to modify generate_protocol_externs.py to also generate JSON typedef's for @constructors, like:

/** @constructor */
CanvasAgent.TraceLog = function()
{
/** @type {CanvasAgent.TraceLogId} */ this.id;
/** @type {Array.<CanvasAgent.Call>} */ this.calls;
/** @type {number|undefined} */ this.startOffset;
/** @type {boolean|undefined} */ this.alive;
}

/** @typedef {{id:CanvasAgent.TraceLogId, calls:Array.<CanvasAgent.Call>, ...}} */
CanvasAgent.TraceLogJSON;

I'll do this in a separate patch: https://bugs.webkit.org/show_bug.cgi?id=107287
Comment 4 Andrey Adaikin 2013-01-18 08:51:25 PST
Committed r140157: <http://trac.webkit.org/changeset/140157>