Bug 179867 - Eliminate some cases of double hashing, other related refactoring
Summary: Eliminate some cases of double hashing, other related refactoring
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Darin Adler
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-11-18 16:57 PST by Darin Adler
Modified: 2017-11-27 10:22 PST (History)
5 users (show)

See Also:


Attachments
Patch (104.30 KB, patch)
2017-11-18 17:41 PST, Darin Adler
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews116 for mac-elcapitan (527.12 KB, application/zip)
2017-11-18 18:34 PST, EWS Watchlist
no flags Details
Patch (104.27 KB, patch)
2017-11-18 19:12 PST, Darin Adler
sam: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2017-11-18 16:57:19 PST
Eliminate some cases of double hashing, other related refactoring
Comment 1 Darin Adler 2017-11-18 17:41:01 PST Comment hidden (obsolete)
Comment 2 EWS Watchlist 2017-11-18 18:34:27 PST Comment hidden (obsolete)
Comment 3 EWS Watchlist 2017-11-18 18:34:28 PST Comment hidden (obsolete)
Comment 4 Darin Adler 2017-11-18 19:12:44 PST
Created attachment 327331 [details]
Patch
Comment 5 Sam Weinig 2017-11-19 13:36:19 PST
Comment on attachment 327331 [details]
Patch

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

> Source/WebCore/html/FormController.cpp:325
> +        String signature = formSignature(*form);

I would use auto here.

> Source/WebCore/html/FormController.h:37
> +using FormControlState = Vector<String>;

Nice.

> Source/WebCore/html/HTMLTextAreaElement.cpp:117
> +    return m_isDirty ? FormControlState { { value() } } : FormControlState { };

In cases like these, I wonder if 

if (!m_dirty)
    return { };
return { { value() } };

is nicer due to not needing to restate FormControlState.  But looking at it, I think the ternary is nicer.
Comment 6 Darin Adler 2017-11-19 16:56:33 PST
Committed r225037: <https://trac.webkit.org/changeset/225037>
Comment 7 Radar WebKit Bug Importer 2017-11-19 16:57:17 PST
<rdar://problem/35639247>
Comment 8 Don Olmstead 2017-11-21 15:20:16 PST
I'm seeing compile issues with the AppleWin debug build that seem to point to this patch when compiling WebKitLegacy.

warning C4373: 'WebCore::InspectorDOMAgent::resolveNode': virtual function overrides 'Inspector::DOMBackendDispatcherHandler::resolveNode', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers

https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4373

Adding #pragma warning( disable : 4373) to InspectorDOMAgent.h seems to get things to build.

Should the definitions in DOMBackendDispatchHandler be updated or should we just be disabling this warning on Windows?
Comment 9 Darin Adler 2017-11-22 09:35:06 PST
(In reply to Don Olmstead from comment #8)
> Should the definitions in DOMBackendDispatchHandler be updated or should we
> just be disabling this warning on Windows?

The warning doesn’t point to any problem we actually have. It points to problems we might have had with "previous versions of the compiler". It’s OK to disable the warning.

But I think that an even better fix for this issues is to remove *all* the bogus const from DOMBackendDispatchHandler and wherever else we have it. There is not a good reason to mark function arguments themselves const.
Comment 10 BJ Burg 2017-11-27 10:22:09 PST
(In reply to Darin Adler from comment #9)
> (In reply to Don Olmstead from comment #8)
> > Should the definitions in DOMBackendDispatchHandler be updated or should we
> > just be disabling this warning on Windows?
> 
> The warning doesn’t point to any problem we actually have. It points to
> problems we might have had with "previous versions of the compiler". It’s OK
> to disable the warning.
> 
> But I think that an even better fix for this issues is to remove *all* the
> bogus const from DOMBackendDispatchHandler and wherever else we have it.
> There is not a good reason to mark function arguments themselves const.

Thanks for the suggestion. I'll take a look at this when I get some free time to hack on the protocol generator some more. Filed: https://bugs.webkit.org/show_bug.cgi?id=180043