Bug 125446 - Store SHA1 hash in std::array.
Summary: Store SHA1 hash in std::array.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-09 05:26 PST by Laszlo Vidacs
Modified: 2013-12-11 14:28 PST (History)
6 users (show)

See Also:


Attachments
Patch (8.32 KB, patch)
2013-12-09 05:47 PST, Laszlo Vidacs
no flags Details | Formatted Diff | Diff
Patch (8.33 KB, patch)
2013-12-09 13:58 PST, Laszlo Vidacs
no flags Details | Formatted Diff | Diff
Patch (8.27 KB, patch)
2013-12-09 14:22 PST, Laszlo Vidacs
no flags Details | Formatted Diff | Diff
Patch (8.25 KB, patch)
2013-12-09 15:04 PST, Laszlo Vidacs
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Laszlo Vidacs 2013-12-09 05:26:00 PST
Request from https://bugs.webkit.org/show_bug.cgi?id=125345

Use std::array for hash instead of custom Vector implementation.
Comment 1 Laszlo Vidacs 2013-12-09 05:47:10 PST
Created attachment 218752 [details]
Patch
Comment 2 Anders Carlsson 2013-12-09 10:30:46 PST
Comment on attachment 218752 [details]
Patch

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

> Source/WTF/wtf/SHA1.h:61
> +    // Size of the SHA1 hash
> +    WTF_EXPORT_PRIVATE static const size_t hashSize = 20;

how about we add

typedef std::array<uint8_t, hashSize> Digest;

here - then we don’t have to use hashSize everywhere. Patch looks good otherwise.
Comment 3 Laszlo Vidacs 2013-12-09 13:58:34 PST
Created attachment 218798 [details]
Patch
Comment 4 Laszlo Vidacs 2013-12-09 14:01:12 PST
Thanks for the improvement, also removed some obsolete comments from SHA1.h
Comment 5 Darin Adler 2013-12-09 14:02:00 PST
Comment on attachment 218798 [details]
Patch

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

> Source/WTF/wtf/SHA1.cpp:95
> +    // array not initialized, need to update all positions

True, yet not really a helpful comment. Nor in the format we use for comments in WebKit.
Comment 6 Laszlo Vidacs 2013-12-09 14:15:14 PST
Right; I wrote that comment when digest.clear() was deleted. Is it better to remove it?
Comment 7 Darin Adler 2013-12-09 14:19:04 PST
(In reply to comment #6)
> Right; I wrote that comment when digest.clear() was deleted. Is it better to remove it?

I think it would be slightly better, yes.
Comment 8 Laszlo Vidacs 2013-12-09 14:22:11 PST
Created attachment 218799 [details]
Patch
Comment 9 Build Bot 2013-12-09 14:53:24 PST
Comment on attachment 218799 [details]
Patch

Attachment 218799 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/47268185
Comment 10 Build Bot 2013-12-09 15:01:17 PST
Comment on attachment 218799 [details]
Patch

Attachment 218799 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/47248208
Comment 11 Darin Adler 2013-12-09 15:01:57 PST
Comment on attachment 218799 [details]
Patch

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

> Source/WTF/wtf/SHA1.h:64
> +    WTF_EXPORT_PRIVATE typedef std::array<uint8_t, hashSize> Digest;

There’s no need to export a typedef, and that’s what caused the build failure. Remove this WTF_EXPORT_PRIVATE.
Comment 12 Build Bot 2013-12-09 15:04:09 PST
Comment on attachment 218799 [details]
Patch

Attachment 218799 [details] did not pass win-ews (win):
Output: http://webkit-queues.appspot.com/results/47248212
Comment 13 Laszlo Vidacs 2013-12-09 15:04:51 PST
Created attachment 218806 [details]
Patch
Comment 14 Laszlo Vidacs 2013-12-10 15:40:02 PST
Could someone take a quick look at the final version of the patch?
Comment 15 WebKit Commit Bot 2013-12-11 14:28:03 PST
Comment on attachment 218806 [details]
Patch

Clearing flags on attachment: 218806

Committed r160456: <http://trac.webkit.org/changeset/160456>
Comment 16 WebKit Commit Bot 2013-12-11 14:28:06 PST
All reviewed patches have been landed.  Closing bug.