Bug 72096 - Web Inspector: DevTools InspectorStubs.js incorrectly converting responses to arguments
Summary: Web Inspector: DevTools InspectorStubs.js incorrectly converting responses to...
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: Ilya Tikhonovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-11 00:28 PST by michael lewis
Modified: 2011-11-11 06:51 PST (History)
12 users (show)

See Also:


Attachments
Patch to fix this bug (3.93 KB, patch)
2011-11-11 00:28 PST, michael lewis
no flags Details | Formatted Diff | Diff
Patch (4.33 KB, patch)
2011-11-11 06:16 PST, Ilya Tikhonovsky
no flags Details | Formatted Diff | Diff
Patch (5.20 KB, patch)
2011-11-11 06:45 PST, Ilya Tikhonovsky
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description michael lewis 2011-11-11 00:28:14 PST
Created attachment 114638 [details]
Patch to fix this bug

I've been working with the WebSocket protocol and noticed that sometimes getBodyContents is broken.

I dug into this a little more and noticed that in WebInspectorStubs.js it was just taking the result argument (object) and converting them into an array.  Well, objects aren't ordered.  The reason this worked most of the times is that most commands have 1 or 0 result arguments.

I patched CodeGeneratorInspector.py to generate correct code.

Patch is attached.


(also posted on chromium http://code.google.com/p/chromium/issues/detail?id=103881)
Comment 1 Ilya Tikhonovsky 2011-11-11 02:29:12 PST
Comment on attachment 114638 [details]
Patch to fix this bug

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

lgtm

> Source/WebCore/inspector/CodeGeneratorInspector.py:1029
>          if (this.dumpInspectorTimeStats) {
> -            var wrappedCallback = this._callbacks[messageObject.id];
> -            wrappedCallback.methodName = messageObject.method;
>              wrappedCallback.sendRequestTime = Date.now();
>          }

style nits: curly bracers are not required
Comment 2 Ilya Tikhonovsky 2011-11-11 06:16:29 PST
Created attachment 114689 [details]
Patch
Comment 3 Ilya Tikhonovsky 2011-11-11 06:45:40 PST
Created attachment 114693 [details]
Patch
Comment 4 Ilya Tikhonovsky 2011-11-11 06:51:12 PST
Committed r99960: <http://trac.webkit.org/changeset/99960>