Bug 42345 - Web Inspector: pass all parameters to WebInspector.addConsoleMessage as a single payload object
Summary: Web Inspector: pass all parameters to WebInspector.addConsoleMessage as a sin...
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: Yury Semikhatsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-15 02:26 PDT by Yury Semikhatsky
Modified: 2010-07-15 08:23 PDT (History)
8 users (show)

See Also:


Attachments
Patch (18.84 KB, patch)
2010-07-15 02:29 PDT, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (20.18 KB, patch)
2010-07-15 03:27 PDT, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (31.94 KB, patch)
2010-07-15 06:16 PDT, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (20.49 KB, patch)
2010-07-15 08:06 PDT, Yury Semikhatsky
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yury Semikhatsky 2010-07-15 02:26:56 PDT
Web Inspector: pass all parameters to WebInspector.addConsoleMessage as a single payload object. This would simplify parameter addition/removal.
Comment 1 Yury Semikhatsky 2010-07-15 02:29:48 PDT
Created attachment 61621 [details]
Patch
Comment 2 Pavel Feldman 2010-07-15 02:33:51 PDT
Comment on attachment 61621 [details]
Patch

I'd suggest that we remove ScriptArray as a whole instead. Ilya is almost there.
Comment 3 Yury Semikhatsky 2010-07-15 03:00:32 PDT
(In reply to comment #2)
> (From update of attachment 61621 [details])
> I'd suggest that we remove ScriptArray as a whole instead. Ilya is almost there.

At the present time we cannot serialize console parameters into InspectorObject's, because there is no way to get InspectorObject from JavaScript object. I think it should be addressed in a separate change .
Comment 4 Pavel Feldman 2010-07-15 03:07:25 PDT
Comment on attachment 61621 [details]
Patch

WebCore/inspector/ConsoleMessage.cpp: 
 +      frontend->addConsoleMessage(jsonObj, m_frames, arguments,  m_message);
m_frames, arguments are missing.
Comment 5 Yury Semikhatsky 2010-07-15 03:27:11 PDT
Created attachment 61630 [details]
Patch
Comment 6 Yury Semikhatsky 2010-07-15 03:27:26 PDT
(In reply to comment #4)
> (From update of attachment 61621 [details])
> WebCore/inspector/ConsoleMessage.cpp: 
>  +      frontend->addConsoleMessage(jsonObj, m_frames, arguments,  m_message);
> m_frames, arguments are missing.

Fixed.
Comment 7 Pavel Feldman 2010-07-15 05:17:14 PDT
Comment on attachment 61630 [details]
Patch

WebCore/inspector/front-end/ConsoleView.js:278
 +              msgCopy = new WebInspector.ConsoleMessage(msg.source, msg.type, msg.level, msg.line, msg.url, msg.groupLevel, count, msg.messageText, msg.parameters, msg.stackTrace);
I think you affect the repeatCount and repeatDelta properties.

WebCore/inspector/front-end/ConsoleView.js:658
 +      this.parameters = parameters;
These should be private.



WebCore/inspector/front-end/ConsoleView.js:676
 +                  var stack = this.stackTrace.slice();
No need.
Comment 8 Yury Semikhatsky 2010-07-15 06:16:44 PDT
Created attachment 61646 [details]
Patch
Comment 9 Yury Semikhatsky 2010-07-15 06:17:09 PDT
(In reply to comment #7)
> (From update of attachment 61630 [details])
> WebCore/inspector/front-end/ConsoleView.js:278
>  +              msgCopy = new WebInspector.ConsoleMessage(msg.source, msg.type, msg.level, msg.line, msg.url, msg.groupLevel, count, msg.messageText, msg.parameters, msg.stackTrace);
> I think you affect the repeatCount and repeatDelta properties.
>
Fixed.
 
> WebCore/inspector/front-end/ConsoleView.js:658
>  +      this.parameters = parameters;
> These should be private.
> 
Done.

> 
> 
> WebCore/inspector/front-end/ConsoleView.js:676
>  +                  var stack = this.stackTrace.slice();
> No need.
Done.
Comment 10 Pavel Feldman 2010-07-15 07:19:58 PDT
Comment on attachment 61646 [details]
Patch

I think it is too risky to rename everything. Could you name only new members as private?
Comment 11 Yury Semikhatsky 2010-07-15 08:06:05 PDT
Created attachment 61664 [details]
Patch
Comment 12 Pavel Feldman 2010-07-15 08:13:24 PDT
Comment on attachment 61664 [details]
Patch

WebCore/inspector/front-end/ConsoleView.js:685
 +                  this.formattedMessage = this._format(["%O", this._parameters[0]]);
I am a bit concerned with the potential switch from <non-undefined>[0] to <potentially-undefined>[0].
Comment 13 Yury Semikhatsky 2010-07-15 08:19:50 PDT
(In reply to comment #12)
> (From update of attachment 61664 [details])
> WebCore/inspector/front-end/ConsoleView.js:685
>  +                  this.formattedMessage = this._format(["%O", this._parameters[0]]);
> I am a bit concerned with the potential switch from <non-undefined>[0] to <potentially-undefined>[0].

Added explicit check.
Comment 14 Yury Semikhatsky 2010-07-15 08:23:54 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/bindings/js/ScriptArray.cpp
	M	WebCore/bindings/js/ScriptArray.h
	M	WebCore/bindings/v8/ScriptArray.cpp
	M	WebCore/bindings/v8/ScriptArray.h
	M	WebCore/inspector/ConsoleMessage.cpp
	M	WebCore/inspector/InspectorFrontend.cpp
	M	WebCore/inspector/InspectorFrontend.h
	M	WebCore/inspector/front-end/ConsoleView.js
	M	WebCore/inspector/front-end/ElementsPanel.js
	M	WebCore/inspector/front-end/InjectedScriptAccess.js
	M	WebCore/inspector/front-end/Resource.js
	M	WebCore/inspector/front-end/inspector.js
Committed r63427