RESOLVED FIXED165975
Address some style problems found by static analysis
https://bugs.webkit.org/show_bug.cgi?id=165975
Summary Address some style problems found by static analysis
Brent Fulgham
Reported 2016-12-16 16:33:52 PST
The static analyzer identified some miscellaneous problems in the code: 1. Some methods did not actually override the expected method due to signature differences. 2. Some large arguments were being passed by value. This patch tidies up these issues.
Attachments
Patch (21.62 KB, patch)
2016-12-16 16:40 PST, Brent Fulgham
no flags
Patch (35.70 KB, patch)
2016-12-20 09:06 PST, Brent Fulgham
no flags
Patch (35.78 KB, patch)
2016-12-20 09:47 PST, Brent Fulgham
no flags
Patch (43.99 KB, patch)
2016-12-20 10:17 PST, Brent Fulgham
no flags
Brent Fulgham
Comment 1 2016-12-16 16:40:37 PST
Brent Fulgham
Comment 2 2016-12-16 16:41:24 PST
Note that the instances of "const int*" -> "const int* const", etc., were to match the method declarations in the implementation files.
Alex Christensen
Comment 3 2016-12-19 09:14:24 PST
Comment on attachment 297374 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297374&action=review > Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h:70 > + void setBreakpointByUrl(ErrorString&, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const Inspector::InspectorObject* options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations) final; This change caused a warning on Windows. Let's double check it. > Source/WebKit2/Shared/WebBackForwardListItem.h:47 > - static PassRefPtr<WebBackForwardListItem> create(BackForwardListItemState, uint64_t pageID); > + static PassRefPtr<WebBackForwardListItem> create(BackForwardListItemState&&, uint64_t pageID); As long as we're touching this, can we make this return a Ref?
Brent Fulgham
Comment 4 2016-12-19 09:54:23 PST
Comment on attachment 297374 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297374&action=review >> Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h:70 >> + void setBreakpointByUrl(ErrorString&, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const Inspector::InspectorObject* options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations) final; > > This change caused a warning on Windows. Let's double check it. I think this is due to out-of-sync intermediate files. It's clear that JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp is declared as "const String* const" (etc.), so the headers should be made to match.
Brent Fulgham
Comment 5 2016-12-20 09:06:51 PST
WebKit Commit Bot
Comment 6 2016-12-20 09:09:27 PST
Attachment 297521 [details] did not pass style-queue: ERROR: Source/WebCore/inspector/PageDebuggerAgent.h:68: The parameter name "const" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h:86: The parameter name "const" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 2 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
Brent Fulgham
Comment 7 2016-12-20 09:47:52 PST
WebKit Commit Bot
Comment 8 2016-12-20 09:49:34 PST
Attachment 297527 [details] did not pass style-queue: ERROR: Source/WebCore/inspector/PageDebuggerAgent.h:68: The parameter name "const" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h:86: The parameter name "const" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 2 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
Blaze Burg
Comment 9 2016-12-20 10:06:04 PST
(In reply to comment #4) > Comment on attachment 297374 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=297374&action=review > > >> Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h:70 > >> + void setBreakpointByUrl(ErrorString&, int lineNumber, const String* const optionalURL, const String* const optionalURLRegex, const int* const optionalColumnNumber, const Inspector::InspectorObject* options, Inspector::Protocol::Debugger::BreakpointId*, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::Debugger::Location>>& locations) final; > > > > This change caused a warning on Windows. Let's double check it. > > I think this is due to out-of-sync intermediate files. It's clear that > JavaScriptCore/inspector/agents/InspectorDebuggerAgent.cpp is declared as > "const String* const" (etc.), so the headers should be made to match. Someday these will use std::optional.
Blaze Burg
Comment 10 2016-12-20 10:07:20 PST
Comment on attachment 297527 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=297527&action=review > Source/JavaScriptCore/inspector/scripts/codegen/cpp_generator.py:142 > + return 'const %s* const' % cpp_name You'll need to rebaseline the expected test results: ./Tools/Scripts/run-inspector-generator-tests --reset-results
Blaze Burg
Comment 11 2016-12-20 10:09:36 PST
(In reply to comment #6) > Attachment 297521 [details] did not pass style-queue: > > > ERROR: Source/WebCore/inspector/PageDebuggerAgent.h:68: The parameter name > "const" adds no information, so it should be removed. > [readability/parameter_name] [5] > ERROR: Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h:86: > The parameter name "const" adds no information, so it should be removed. > [readability/parameter_name] [5] > Total errors found: 2 in 20 files > > > If any of these errors are false positives, please file a bug against > check-webkit-style. LOL, please file a bug about this.
Brent Fulgham
Comment 12 2016-12-20 10:15:16 PST
(In reply to comment #11) > (In reply to comment #6) > > Attachment 297521 [details] did not pass style-queue: > > > > > > ERROR: Source/WebCore/inspector/PageDebuggerAgent.h:68: The parameter name > > "const" adds no information, so it should be removed. > > [readability/parameter_name] [5] > > ERROR: Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h:86: > > The parameter name "const" adds no information, so it should be removed. > > [readability/parameter_name] [5] > > Total errors found: 2 in 20 files > > > > > > If any of these errors are false positives, please file a bug against > > check-webkit-style. > > LOL, please file a bug about this. Already did! Bug 166067.
Brent Fulgham
Comment 13 2016-12-20 10:17:55 PST
WebKit Commit Bot
Comment 14 2016-12-20 10:21:03 PST
Attachment 297532 [details] did not pass style-queue: ERROR: Source/WebCore/inspector/PageDebuggerAgent.h:68: The parameter name "const" adds no information, so it should be removed. [readability/parameter_name] [5] ERROR: Source/JavaScriptCore/inspector/agents/InspectorDebuggerAgent.h:86: The parameter name "const" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 2 in 21 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 15 2016-12-20 15:33:41 PST
Comment on attachment 297532 [details] Patch Clearing flags on attachment: 297532 Committed r210042: <http://trac.webkit.org/changeset/210042>
WebKit Commit Bot
Comment 16 2016-12-20 15:33:45 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.