Bug 194103 - [SOUP] Improve use of SoupCookiePersistentStorageType
Summary: [SOUP] Improve use of SoupCookiePersistentStorageType
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-31 11:43 PST by Michael Catanzaro
Modified: 2019-02-05 08:03 PST (History)
8 users (show)

See Also:


Attachments
Patch (10.93 KB, patch)
2019-01-31 11:48 PST, Michael Catanzaro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2019-01-31 11:43:16 PST
Improve use of SoupCookiePersistentStorageType. Turn it into an enum class, and stop casting it to and from uint32_t.
Comment 1 Michael Catanzaro 2019-01-31 11:48:55 PST
Created attachment 360747 [details]
Patch
Comment 2 EWS Watchlist 2019-01-31 11:51:14 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Carlos Garcia Campos 2019-02-01 00:58:19 PST
Comment on attachment 360747 [details]
Patch

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

> Source/WebKit/Shared/soup/SoupCookiePersistentStorageType.h:30
> +enum class SoupCookiePersistentStorageType : bool {

why bool?
Comment 4 Michael Catanzaro 2019-02-01 08:24:08 PST
Comment on attachment 360747 [details]
Patch

Because there's only two possible values. It's an implementation detail -- we can change it whenever we want -- but there's another bool-typed enum in NetworkProcess messages so seemed good to match that.

Maybe I'll change it to uint8_t before landing so we'll never have to change it even in the unlikely case we add a new storage type; let's see if that works.
Comment 5 Michael Catanzaro 2019-02-01 09:28:53 PST
(In reply to Michael Catanzaro from comment #4)
> Maybe I'll change it to uint8_t before landing so we'll never have to change
> it even in the unlikely case we add a new storage type; let's see if that
> works.

Weird build errors. Let's just use int.
Comment 6 Michael Catanzaro 2019-02-01 09:31:14 PST
Even that causes strange failures. I'll land it as-is... bool is an OK type for a two-valued enum.
Comment 7 WebKit Commit Bot 2019-02-01 09:49:15 PST
Comment on attachment 360747 [details]
Patch

Clearing flags on attachment: 360747

Committed r240858: <https://trac.webkit.org/changeset/240858>
Comment 8 WebKit Commit Bot 2019-02-01 09:49:17 PST
All reviewed patches have been landed.  Closing bug.