RESOLVED FIXED 42345
Web Inspector: pass all parameters to WebInspector.addConsoleMessage as a single payload object
https://bugs.webkit.org/show_bug.cgi?id=42345
Summary Web Inspector: pass all parameters to WebInspector.addConsoleMessage as a sin...
Yury Semikhatsky
Reported 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.
Attachments
Patch (18.84 KB, patch)
2010-07-15 02:29 PDT, Yury Semikhatsky
no flags
Patch (20.18 KB, patch)
2010-07-15 03:27 PDT, Yury Semikhatsky
no flags
Patch (31.94 KB, patch)
2010-07-15 06:16 PDT, Yury Semikhatsky
no flags
Patch (20.49 KB, patch)
2010-07-15 08:06 PDT, Yury Semikhatsky
pfeldman: review+
Yury Semikhatsky
Comment 1 2010-07-15 02:29:48 PDT
Pavel Feldman
Comment 2 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.
Yury Semikhatsky
Comment 3 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 .
Pavel Feldman
Comment 4 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.
Yury Semikhatsky
Comment 5 2010-07-15 03:27:11 PDT
Yury Semikhatsky
Comment 6 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.
Pavel Feldman
Comment 7 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.
Yury Semikhatsky
Comment 8 2010-07-15 06:16:44 PDT
Yury Semikhatsky
Comment 9 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.
Pavel Feldman
Comment 10 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?
Yury Semikhatsky
Comment 11 2010-07-15 08:06:05 PDT
Pavel Feldman
Comment 12 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].
Yury Semikhatsky
Comment 13 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.
Yury Semikhatsky
Comment 14 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
Note You need to log in before you can comment on or make changes to this bug.