[Webkit-unassigned] [Bug 230735] Add a module map file for PrivateFrameworks/WebKitLegacy

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 21 11:24:35 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=230735

David Kilzer (:ddkilzer) <ddkilzer at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #441851|review?                     |review-
              Flags|                            |

--- Comment #16 from David Kilzer (:ddkilzer) <ddkilzer at webkit.org> ---
Comment on attachment 441851
  --> https://bugs.webkit.org/attachment.cgi?id=441851
Patch

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

r-, and I think these need to be fixed at minimum:
- Move #include/#import statements inside header guard macros.
- Add comments after #endif where noted.
- Answer question about <objc/NSObject.h>.  (Might be okay—don't change them all yet.)
- Fix ordering of headers where noted.
- Reuse NSURLDownloadSPI.h in WebDownload.h (or was there a reason this code was copied?).

Thanks!

> Source/WebCore/platform/ios/WebItemProviderPasteboard.h:-30
> +#import <CoreGraphics/CoreGraphics.h>
>  #import <WebCore/AbstractPasteboard.h>
>  
>  #if TARGET_OS_IOS
>  
> -struct CGSize;

Why not put the #Import inside #if TARGET_OS_IOS/#endif?

> Source/WebCore/platform/ios/wak/WAKAppKitStubs.h:-32
> +#import <Foundation/Foundation.h>
> +
>  #if TARGET_OS_IPHONE
>  
>  #import <CoreGraphics/CoreGraphics.h>
> -#import <Foundation/Foundation.h>

Why does this need to go outside `#if TARGET_OS_IPHONE`?  This doesn't seem necessary since the entire contents is wrapped in #if TARGET_OS_IPHONE/#endif.

> Source/WebCore/platform/ios/wak/WAKResponder.h:33
> +#import <Foundation/Foundation.h>
> +
>  #if TARGET_OS_IPHONE
>  
> -#import "WKTypes.h"
> -#import <Foundation/Foundation.h>
> +#import <WebCore/WKTypes.h>

Why can't this go inside #if TARGET_OS_IPHONE/#endif?

> Source/WebCore/platform/ios/wak/WAKView.h:29
> +#import <Foundation/Foundation.h>

Ditto.

> Source/WebCore/platform/ios/wak/WAKWindow.h:28
> +#import <Foundation/Foundation.h>

Ditto.

> Source/WebKitLegacy/ios/Misc/WebGeolocationCoreLocationProvider.h:62
> +#endif

Should have a comment here:

#endif // defined(__cplusplus)

> Source/WebKitLegacy/mac/DOM/DOMEventListener.h:27
> +#import <objc/NSObject.h>

Is this a public header?  Why wouldn't we #import <Foundation/NSObject.h> instead?

> Source/WebKitLegacy/mac/DOM/DOMNodeFilter.h:27
> +#import <objc/NSObject.h>

Ditto.

> Source/WebKitLegacy/mac/DOM/DOMXPathNSResolver.h:27
> +#import <objc/NSObject.h>

Ditto.

> Source/WebKitLegacy/mac/DOM/WebDOMOperationsPrivate.h:31
> +#import <Foundation/Foundation.h>
>  #import <WebKitLegacy/WebDOMOperations.h>
>  #import <JavaScriptCore/JSBase.h>

The header order should probably be this (since we include the non-private header first?  Or does that give a check-webkit-style error?

#import <WebKitLegacy/WebDOMOperations.h>
#import <Foundation/Foundation.h>
#import <JavaScriptCore/JSBase.h>

> Source/WebKitLegacy/mac/History/WebHistoryItemPrivate.h:30
> +#import <CoreGraphics/CoreGraphics.h>
>  #import <WebKitLegacy/WebHistoryItem.h>

Ditto.

> Source/WebKitLegacy/mac/Misc/WebDownload.h:33
>  #ifndef WebDownload_h
>  #define WebDownload_h

It's a bit strange that there are #import statements above this header guard.  Can they be moved inside the header guard?

> Source/WebKitLegacy/mac/Misc/WebDownload.h:40
> -#if (defined TARGET_OS_MACCATALYST && TARGET_OS_MACCATALYST)
> +#if defined(TARGET_OS_MACCATALYST) && TARGET_OS_MACCATALYST
>  #import <CFNetwork/CFNSURLConnection.h>
> -#elif !TARGET_OS_IPHONE || (defined USE_APPLE_INTERNAL_SDK && USE_APPLE_INTERNAL_SDK)
> +#elif !TARGET_OS_IPHONE || (defined(USE_APPLE_INTERNAL_SDK) && USE_APPLE_INTERNAL_SDK)
>  #import <Foundation/NSURLDownload.h>
>  #else
>  #import <WebKitLegacy/NSURLDownloadSPI.h>

Both WebDownload.h and NSURLDownloadSPI.h are marked as Private headers, so we should be able to replace all of this with just:

#import <WebKitLegacy/NSURLDownloadSPI.h>

Since that has al the same logic as this block of macros.

> Source/WebKitLegacy/mac/Storage/WebDatabaseQuotaManager.h:27
> +#import <objc/NSObject.h>

Why <objc/NSObject.h> instead of <Foundation/NSObject.h>?

> Source/WebKitLegacy/mac/WebView/WebDeviceOrientationProvider.h:26
> +#import <objc/NSObject.h>

Ditto.

> Source/WebKitLegacy/mac/WebView/WebDeviceOrientationProviderMock.h:27
> -#import "WebDeviceOrientationProvider.h"
> +#import <WebKitLegacy/WebDeviceOrientationProvider.h>
> +#import <objc/NSObject.h>

Ditto.

> Source/WebKitLegacy/mac/WebView/WebGeolocationPosition.h:26
> +#import <objc/NSObject.h>

Ditto.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211021/2019fb08/attachment-0001.htm>


More information about the webkit-unassigned mailing list