Bug 192197 - Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO
Summary: Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-29 16:08 PST by Don Olmstead
Modified: 2018-11-30 14:24 PST (History)
4 users (show)

See Also:


Attachments
Patch (144.76 KB, patch)
2018-11-29 16:13 PST, Don Olmstead
no flags Details | Formatted Diff | Diff
Patch (161.09 KB, patch)
2018-11-29 16:30 PST, Don Olmstead
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Don Olmstead 2018-11-29 16:08:02 PST
Its really odd on the CMake side that there is ENABLE_WEB_CRYPTO and ENABLE_SUBTLE_CRYPTO. ENABLE_SUBTLE_CRYPTO seems to be pretty old and maybe its time to just change it to ENABLE_WEB_CRYPTO since that better describes things.
Comment 1 Don Olmstead 2018-11-29 16:13:09 PST
Created attachment 356082 [details]
Patch

Just a mass rename for the most part plus some CMake changes to remove ENABLE_SUBTLE_CRYPTO.
Comment 2 Don Olmstead 2018-11-29 16:30:04 PST
Created attachment 356087 [details]
Patch

Forgot some IDL files.
Comment 3 Michael Catanzaro 2018-11-30 06:55:34 PST
Yay!
Comment 4 Michael Catanzaro 2018-11-30 10:49:01 PST
Comment on attachment 356087 [details]
Patch

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

This looks good to be, just needs approval by Jiewen.

> Tools/Scripts/webkitperl/FeatureList.pm:-350
> -    { option => "subtle-crypto", desc => "Toggle WebCrypto Subtle-Crypto support",
> -      define => "ENABLE_SUBTLE_CRYPTO", value => \$subtleCrypto },
> -

Alternatively you could rename it to web-crypto so it's still possible to disable with build-webkit.
Comment 5 Don Olmstead 2018-11-30 11:00:56 PST
(In reply to Michael Catanzaro from comment #4)
> Comment on attachment 356087 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=356087&action=review
> 
> This looks good to be, just needs approval by Jiewen.
> 
> > Tools/Scripts/webkitperl/FeatureList.pm:-350
> > -    { option => "subtle-crypto", desc => "Toggle WebCrypto Subtle-Crypto support",
> > -      define => "ENABLE_SUBTLE_CRYPTO", value => \$subtleCrypto },
> > -
> 
> Alternatively you could rename it to web-crypto so it's still possible to
> disable with build-webkit.

I have some stuff locally where I'm going through and syncing up the perl script and the cmake side. A syncing of xcode features as well will either be in that or in a subsequent patch.

The feature flag stuff is wildly out of date.
Comment 6 Jiewen Tan 2018-11-30 12:10:03 PST
(In reply to Don Olmstead from comment #0)
> Its really odd on the CMake side that there is ENABLE_WEB_CRYPTO and
> ENABLE_SUBTLE_CRYPTO. ENABLE_SUBTLE_CRYPTO seems to be pretty old and maybe
> its time to just change it to ENABLE_WEB_CRYPTO since that better describes
> things.

Thanks for making this patch. However, I want to point it out the reason why this macro is named ENABLE_SUBTLE_CRYPTO instead of ENABLE_WEB_CRYPTO. Web Crypto API consists more than the SubtleCrypto interface. It means the whole Crypto interface: https://www.w3.org/TR/WebCryptoAPI/#crypto-interface. There is no flags for the crypto interface. Without the SubtleCrypto interface, there is the getRandomValues function. Even though SubtleCrypto interface is the bone and meat of Web Crypto API, it still feels semantically wrong to guard SubtleCrypto with ENABLE_WEB_CRYPTO.

Maybe it would be better to rename ENABLE_WEB_CRYPTO to ENABLE_SUBTLE_CRYPTO. From the Crypto class, I believe the crypto interface is enabled by default for all ports? Just the SubtleCrypto interface is platform dependent.
Comment 7 Michael Catanzaro 2018-11-30 12:39:50 PST
(In reply to Jiewen Tan from comment #6)
> Maybe it would be better to rename ENABLE_WEB_CRYPTO to
> ENABLE_SUBTLE_CRYPTO. From the Crypto class, I believe the crypto interface
> is enabled by default for all ports? Just the SubtleCrypto interface is
> platform dependent.

ENABLE_WEB_CRYPTO exists only to rename the ENABLE_SUBTLE_CRYPTO option so that it can be presented as a public build option. You'll see nothing is guarded by it, it's just a stub option so that we don't have to expose a confusing internal name ENABLE_SUBTLE_CRYPTO.
Comment 8 Jiewen Tan 2018-11-30 13:53:39 PST
(In reply to Michael Catanzaro from comment #7)
> (In reply to Jiewen Tan from comment #6)
> > Maybe it would be better to rename ENABLE_WEB_CRYPTO to
> > ENABLE_SUBTLE_CRYPTO. From the Crypto class, I believe the crypto interface
> > is enabled by default for all ports? Just the SubtleCrypto interface is
> > platform dependent.
> 
> ENABLE_WEB_CRYPTO exists only to rename the ENABLE_SUBTLE_CRYPTO option so
> that it can be presented as a public build option. You'll see nothing is
> guarded by it, it's just a stub option so that we don't have to expose a
> confusing internal name ENABLE_SUBTLE_CRYPTO.

The whole thing is a little bit subtle. I saw confusions on both sides. Since the guard is not needed for Apple ports, I will r+ this patch as you both thinks it is good.
Comment 9 Jiewen Tan 2018-11-30 13:53:55 PST
Comment on attachment 356087 [details]
Patch

LGTM. r=me.
Comment 10 WebKit Commit Bot 2018-11-30 14:23:26 PST
Comment on attachment 356087 [details]
Patch

Clearing flags on attachment: 356087

Committed r238754: <https://trac.webkit.org/changeset/238754>
Comment 11 WebKit Commit Bot 2018-11-30 14:23:28 PST
All reviewed patches have been landed.  Closing bug.
Comment 12 Radar WebKit Bug Importer 2018-11-30 14:24:33 PST
<rdar://problem/46384108>