Bug 168579 - Clean up how WebKit exports _WebCreateFragment
Summary: Clean up how WebKit exports _WebCreateFragment
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-19 17:40 PST by Alexey Proskuryakov
Modified: 2017-02-20 09:24 PST (History)
4 users (show)

See Also:


Attachments
proposed patch (9.43 KB, patch)
2017-02-19 17:49 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff
proposed patch (9.39 KB, patch)
2017-02-19 18:31 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2017-02-19 17:40:02 PST
WebKit exports the _WebCreateFragment symbol, but it is not present in any framework headers.
Comment 1 Alexey Proskuryakov 2017-02-19 17:49:53 PST
Created attachment 302102 [details]
proposed patch
Comment 2 WebKit Commit Bot 2017-02-19 17:51:03 PST
Attachment 302102 [details] did not pass style-queue:


ERROR: Source/WebKit/mac/WebCoreSupport/WebCreateFragmentInternal.h:37:  _WebCreateFragment is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 7 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 mitz 2017-02-19 17:52:53 PST
Comment on attachment 302102 [details]
proposed patch

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

> Source/WebKit/WebKit.xcodeproj/project.pbxproj:794
> +		E13E782C1E5A7365001849D1 /* WebCreateFragmentInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = E13E782B1E5A7365001849D1 /* WebCreateFragmentInternal.h */; settings = {ATTRIBUTES = (Private, ); }; };

We are we calling this “Internal” if it’s a private header?

> Source/WebKit/mac/WebCoreSupport/WebCreateFragmentInternal.h:33
> +#ifdef __cplusplus

This has got to be true because otherwise the above declarations would fail to compile.
Comment 4 Alexey Proskuryakov 2017-02-19 18:29:25 PST
> We are we calling this “Internal” if it’s a private header?

This naming is used elsewhere in WebKit for things that have to be framework headers, but are not API or SPI. Do you have a different suggestion for the name?

We need to expose this header to have symbols match between framework binaries and stubs.

> This has got to be true because otherwise the above declarations would fail
> to compile.

Good point.
Comment 5 Alexey Proskuryakov 2017-02-19 18:31:24 PST
Created attachment 302107 [details]
proposed patch

Removed __cplusplus checks, added a radar number.
Comment 6 mitz 2017-02-19 18:38:11 PST
(In reply to comment #4)
> > We are we calling this “Internal” if it’s a private header?
> 
> This naming is used elsewhere in WebKit for things that have to be framework
> headers, but are not API or SPI.

Filtering the Headers build phase of the WebCore, WebKitLegacy and WebKit targets for “Internal.h”, the only private header matching the pattern is npruntime_internal.h in WebCore. All other headers with names ending with Internal.h are project headers.

I believe that the convention is to add the suffixes “Private” and “Internal” only when needed to disambiguate, i.e. when there is also a separate header with the base name or with another suffix (one possible exception is that if the object being declared in a header has a name that ends with Private, then the header’s name may end with Private by virtue of being named after what it is declaring).

So unless I’m missing something, I suggest calling this header WebCreateFragment.h.
Comment 7 mitz 2017-02-19 18:38:35 PST
Comment on attachment 302107 [details]
proposed patch

r=me but I’d prefer the standard naming.
Comment 8 Alexey Proskuryakov 2017-02-19 18:48:31 PST
Hmm, it's less frequent than I thought. But there are four of those in JavaScriptCore.

Naming an exposed header that's purely internal to the WebKit stack in a "standard" way still seems less than great to me.
Comment 9 WebKit Commit Bot 2017-02-20 09:24:41 PST
Comment on attachment 302107 [details]
proposed patch

Clearing flags on attachment: 302107

Committed r212642: <http://trac.webkit.org/changeset/212642>
Comment 10 WebKit Commit Bot 2017-02-20 09:24:45 PST
All reviewed patches have been landed.  Closing bug.