Use warning-ignoring macros more consistently and simply
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Dec 2018 00:21:25 +0000 (00:21 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 16 Dec 2018 00:21:25 +0000 (00:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=192743

Reviewed by Mark Lam.

Source/JavaScriptCore:

* dfg/DFGSpeculativeJIT64.cpp: Use IGNORE_WARNINGS_BEGIN/END instead of
IGNORE_CLANG_WARNINGS_BEGIN/END. Other callsites are using the non-clang-specific
one for this warning, "implicit-fallthrough", and it seems there is no special
need to use the clang-specific one here.
* llint/LLIntData.cpp: Ditto, but here it's "missing-noreturn"."
* tools/CodeProfiling.cpp: Ditto.

Source/WebCore:

* bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
files like this one with non-clang compilers, and no need to worry about
them when choosing the macro.

* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.

* css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
the "unknown-pragmas" trick, which the macro should take care of.
* css/makevalues.pl: Ditto.
* platform/ColorData.gperf: Ditto.

* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
(see rationale above for Objective-C++).

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.

* platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
(see rationale above for Objective-C++).

* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.

* platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
(see rationale above for Objective-C++).

* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const): Use
ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.

Source/WebCore/PAL:

* pal/spi/cocoa/AVKitSPI.h: Use IGNORE_WARNINGS_BEGIN instead of
IGNORE_CLANG_WARNINGS_BEGIN; there is no special need to accomodate
non-clang compilers here.

Source/WebKit:

* UIProcess/ios/WKDrawingView.mm:
(-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
* UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _EVOrganizationName]): Ditto.

* WebProcess/WebCoreSupport/WebAlternativeTextClient.h: Use
IGNORE_WARNINGS_BEGIN/END instead of IGNORE_CLANG_WARNINGS_BEGIN/END
because there is no need to accomodate non-clang compilers here.
Also use #pragma once, add a missing "explicit", and fix conditionals.

Source/WebKitLegacy/mac:

* DOM/DOM.mm: Use IGNORE_WARNINGS_BEGIN/END instead of
IGNORE_CLANG_WARNINGS_BEGIN since there is no need to accomodate non-clang
compilers in Objective-C++ code.

* WebCoreSupport/WebAlternativeTextClient.h: Use IGNORE_WARNINGS_BEGIN/END
instead of IGNORE_CLANG_WARNINGS_BEGIN/END because there is no need to
accomodate non-clang compilers here. Also use #pragma once, add a missing
"explicit" and fix conditionals.

Source/WTF:

* wtf/Assertions.h: Use IGNORE_WARNINGS_BEGIN rather than
IGNORE_CLANG_WARNINGS_BEGIN since we don't need special handling for
non-clang compilers, in part since the code is already inside
#if COMPILER(CLANG), but also because it would be harmless to ignore this
warning on non-clang; we should almost never use IGNORE_CLANG_WARNINGS_BEGIN.

Tools:

* DumpRenderTree/TestNetscapePlugIn/main.cpp:
(handleEventCarbon): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
* DumpRenderTree/mac/TextInputControllerMac.m:
(-[TextInputController interpretKeyEvents:withSender:]): Use
IGNORE_WARNINGS_BEGIN/END.
* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::mouseForceClick): Use
IGNORE_NULL_CHECK_WARNINGS_BEGIN/END.
(WTR::EventSenderProxy::startAndCancelMouseForceClick): Ditto.
(WTR::EventSenderProxy::mouseForceDown): Ditto.
(WTR::EventSenderProxy::mouseForceUp): Ditto.
(WTR::EventSenderProxy::mouseForceChanged): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@239255 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
Source/JavaScriptCore/llint/LLIntData.cpp
Source/JavaScriptCore/tools/CodeProfiling.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/Assertions.h
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cocoa/AVKitSPI.h
Source/WebCore/bridge/objc/WebScriptObject.mm
Source/WebCore/crypto/mac/CryptoKeyRSAMac.cpp
Source/WebCore/css/makeprop.pl
Source/WebCore/css/makevalues.pl
Source/WebCore/platform/ColorData.gperf
Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
Source/WebCore/platform/ios/DragImageIOS.mm
Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm
Source/WebCore/platform/mac/WebPlaybackControlsManager.mm
Source/WebCore/platform/network/cocoa/ResourceResponseCocoa.mm
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKDrawingView.mm
Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm
Source/WebKit/WebProcess/WebCoreSupport/WebAlternativeTextClient.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/DOM/DOM.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebAlternativeTextClient.h
Tools/ChangeLog
Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp
Tools/DumpRenderTree/mac/TextInputControllerMac.m
Tools/WebKitTestRunner/mac/EventSenderProxy.mm

index 86e3394..8ae72c0 100644 (file)
@@ -1,5 +1,19 @@
 2018-12-15  Darin Adler  <darin@apple.com>
 
+        Use warning-ignoring macros more consistently and simply
+        https://bugs.webkit.org/show_bug.cgi?id=192743
+
+        Reviewed by Mark Lam.
+
+        * dfg/DFGSpeculativeJIT64.cpp: Use IGNORE_WARNINGS_BEGIN/END instead of
+        IGNORE_CLANG_WARNINGS_BEGIN/END. Other callsites are using the non-clang-specific
+        one for this warning, "implicit-fallthrough", and it seems there is no special
+        need to use the clang-specific one here.
+        * llint/LLIntData.cpp: Ditto, but here it's "missing-noreturn"."
+        * tools/CodeProfiling.cpp: Ditto.
+
+2018-12-15  Darin Adler  <darin@apple.com>
+
         Replace many uses of String::format with more type-safe alternatives
         https://bugs.webkit.org/show_bug.cgi?id=192742
 
index 6f5a87c..18ae7d8 100644 (file)
@@ -876,7 +876,7 @@ void SpeculativeJIT::emitCall(Node* node)
 
 // Clang should allow unreachable [[clang::fallthrough]] in template functions if any template expansion uses it
 // http://llvm.org/bugs/show_bug.cgi?id=18619
-IGNORE_CLANG_WARNINGS_BEGIN("implicit-fallthrough")
+IGNORE_WARNINGS_BEGIN("implicit-fallthrough")
 template<bool strict>
 GPRReg SpeculativeJIT::fillSpeculateInt32Internal(Edge edge, DataFormat& returnFormat)
 {
@@ -1007,7 +1007,7 @@ GPRReg SpeculativeJIT::fillSpeculateInt32Internal(Edge edge, DataFormat& returnF
         return InvalidGPRReg;
     }
 }
-IGNORE_CLANG_WARNINGS_END
+IGNORE_WARNINGS_END
 
 GPRReg SpeculativeJIT::fillSpeculateInt32(Edge edge, DataFormat& returnFormat)
 {
index fa9a7ed..58f18e4 100644 (file)
@@ -74,7 +74,7 @@ void initialize()
 #endif // ENABLE(C_LOOP)
 }
 
-IGNORE_CLANG_WARNINGS_BEGIN("missing-noreturn")
+IGNORE_WARNINGS_BEGIN("missing-noreturn")
 void Data::performAssertions(VM& vm)
 {
     UNUSED_PARAM(vm);
@@ -184,6 +184,6 @@ void Data::performAssertions(VM& vm)
         STATIC_ASSERT(ArithProfile::observedBinaryIntNumber().rhsObservedType().isOnlyNumber());
     }
 }
-IGNORE_CLANG_WARNINGS_END
+IGNORE_WARNINGS_END
 
 } } // namespace JSC::LLInt
index e44dc34..94ebe8e 100644 (file)
@@ -44,7 +44,7 @@ volatile CodeProfile* CodeProfiling::s_profileStack = 0;
 CodeProfiling::Mode CodeProfiling::s_mode = CodeProfiling::Disabled;
 WTF::MetaAllocatorTracker* CodeProfiling::s_tracker = 0;
 
-IGNORE_CLANG_WARNINGS_BEGIN("missing-noreturn")
+IGNORE_WARNINGS_BEGIN("missing-noreturn")
 
 #if HAVE(MACHINE_CONTEXT)
 // Helper function to start & stop the timer.
@@ -60,7 +60,7 @@ static void setProfileTimer(unsigned usec)
 }
 #endif
 
-IGNORE_CLANG_WARNINGS_END
+IGNORE_WARNINGS_END
 
 #if HAVE(MACHINE_CONTEXT)
 static void profilingTimer(int, siginfo_t*, void* uap)
index 9a8cfc5..ca0e856 100644 (file)
@@ -1,5 +1,18 @@
 2018-12-15  Darin Adler  <darin@apple.com>
 
+        Use warning-ignoring macros more consistently and simply
+        https://bugs.webkit.org/show_bug.cgi?id=192743
+
+        Reviewed by Mark Lam.
+
+        * wtf/Assertions.h: Use IGNORE_WARNINGS_BEGIN rather than
+        IGNORE_CLANG_WARNINGS_BEGIN since we don't need special handling for
+        non-clang compilers, in part since the code is already inside
+        #if COMPILER(CLANG), but also because it would be harmless to ignore this
+        warning on non-clang; we should almost never use IGNORE_CLANG_WARNINGS_BEGIN.
+
+2018-12-15  Darin Adler  <darin@apple.com>
+
         Replace many uses of String::format with more type-safe alternatives
         https://bugs.webkit.org/show_bug.cgi?id=192742
 
index f193996..650e765 100644 (file)
@@ -610,14 +610,14 @@ inline void compilerFenceForCrash()
 #if COMPILER(CLANG)
 // This would be a macro except that its use of #pragma works best around
 // a function. Hence it uses macro naming convention.
-IGNORE_CLANG_WARNINGS_BEGIN("missing-noreturn")
+IGNORE_WARNINGS_BEGIN("missing-noreturn")
 static inline void UNREACHABLE_FOR_PLATFORM()
 {
     // This *MUST* be a release assert. We use it in places where it's better to crash than to keep
     // going.
     RELEASE_ASSERT_NOT_REACHED();
 }
-IGNORE_CLANG_WARNINGS_END
+IGNORE_WARNINGS_END
 #else
 #define UNREACHABLE_FOR_PLATFORM() RELEASE_ASSERT_NOT_REACHED()
 #endif
index 6bf2c4d..6ab25aa 100644 (file)
@@ -1,5 +1,49 @@
 2018-12-15  Darin Adler  <darin@apple.com>
 
+        Use warning-ignoring macros more consistently and simply
+        https://bugs.webkit.org/show_bug.cgi?id=192743
+
+        Reviewed by Mark Lam.
+
+        * bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
+        IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
+        files like this one with non-clang compilers, and no need to worry about
+        them when choosing the macro.
+
+        * crypto/mac/CryptoKeyRSAMac.cpp:
+        (WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
+
+        * css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
+        the "unknown-pragmas" trick, which the macro should take care of.
+        * css/makevalues.pl: Ditto.
+        * platform/ColorData.gperf: Ditto.
+
+        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
+        (WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
+        (see rationale above for Objective-C++).
+
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
+        ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.
+
+        * platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
+        (see rationale above for Objective-C++).
+
+        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
+        (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
+        Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
+
+        * platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
+        (see rationale above for Objective-C++).
+
+        * platform/network/cocoa/ResourceResponseCocoa.mm:
+        (WebCore::ResourceResponse::platformCertificateInfo const): Use
+        ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
+
+2018-12-15  Darin Adler  <darin@apple.com>
+
         Replace many uses of String::format with more type-safe alternatives
         https://bugs.webkit.org/show_bug.cgi?id=192742
 
index 1c879a8..d975a16 100644 (file)
@@ -1,5 +1,16 @@
 2018-12-15  Darin Adler  <darin@apple.com>
 
+        Use warning-ignoring macros more consistently and simply
+        https://bugs.webkit.org/show_bug.cgi?id=192743
+
+        Reviewed by Mark Lam.
+
+        * pal/spi/cocoa/AVKitSPI.h: Use IGNORE_WARNINGS_BEGIN instead of
+        IGNORE_CLANG_WARNINGS_BEGIN; there is no special need to accomodate
+        non-clang compilers here.
+
+2018-12-15  Darin Adler  <darin@apple.com>
+
         Replace many uses of String::format with more type-safe alternatives
         https://bugs.webkit.org/show_bug.cgi?id=192742
 
index 58c4c56..426e01d 100644 (file)
@@ -38,9 +38,9 @@
 #endif
 
 #import <AVKit/AVPlayerController.h>
-IGNORE_CLANG_WARNINGS_BEGIN("objc-property-no-attribute")
+IGNORE_WARNINGS_BEGIN("objc-property-no-attribute")
 #import <AVKit/AVPlayerLayerView.h>
-IGNORE_CLANG_WARNINGS_END
+IGNORE_WARNINGS_END
 #import <AVKit/AVPlayerViewController_Private.h>
 #import <AVKit/AVPlayerViewController_WebKitOnly.h>
 
index 18d013c..bc11bb3 100644 (file)
@@ -702,12 +702,12 @@ static void getListFromNSArray(ExecState *exec, NSArray *array, RootObject* root
     return self;
 }
 
-IGNORE_CLANG_WARNINGS_BEGIN("objc-missing-super-calls")
+IGNORE_WARNINGS_BEGIN("objc-missing-super-calls")
 - (void)dealloc
 {
-    return;
+    // Intentionally not calling [super dealloc] since we never want to deallocate our single instance.
 }
-IGNORE_CLANG_WARNINGS_END
+IGNORE_WARNINGS_END
 
 + (WebUndefined *)undefined
 {
index 142f439..e36fa76 100644 (file)
@@ -62,10 +62,9 @@ static CCCryptorStatus getPublicKeyComponents(CCRSACryptorRef rsaKey, Vector<uin
 {
     ASSERT(CCRSAGetKeyType(rsaKey) == ccRSAKeyPublic || CCRSAGetKeyType(rsaKey) == ccRSAKeyPrivate);
     bool keyIsPublic = CCRSAGetKeyType(rsaKey) == ccRSAKeyPublic;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     CCRSACryptorRef publicKey = keyIsPublic ? rsaKey : CCRSACryptorGetPublicKeyFromPrivateKey(rsaKey);
-#pragma clang diagnostic pop
+    ALLOW_DEPRECATED_DECLARATIONS_END
 
     modulus.resize(16384);
     size_t modulusLength = modulus.size();
index c05944c..e4cb475 100755 (executable)
@@ -248,11 +248,7 @@ print GPERF << "EOF";
 #include <wtf/text/WTFString.h>
 #include <string.h>
 
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored \"-Wunknown-pragmas\"
-#pragma clang diagnostic ignored \"-Wimplicit-fallthrough\"
-#endif
+IGNORE_WARNINGS_BEGIN(\"implicit-fallthrough\")
 
 // Older versions of gperf like to use the `register` keyword.
 #define register
@@ -421,9 +417,7 @@ print GPERF << "EOF";
 
 } // namespace WebCore
 
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
+IGNORE_WARNINGS_END
 EOF
 
 close GPERF;
index 6fc684c..d1e8090 100755 (executable)
@@ -78,11 +78,7 @@ print GPERF << "EOF";
 #include <wtf/text/WTFString.h>
 #include <string.h>
 
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored \"-Wunknown-pragmas\"
-#pragma clang diagnostic ignored \"-Wimplicit-fallthrough\"
-#endif
+IGNORE_WARNINGS_BEGIN(\"implicit-fallthrough\")
 
 // Older versions of gperf like to use the `register` keyword.
 #define register
@@ -155,9 +151,7 @@ String getValueNameString(CSSValueID id)
 
 } // namespace WebCore
 
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
+IGNORE_WARNINGS_END
 EOF
 close GPERF;
 
index 0ac28d3..5af79c2 100644 (file)
@@ -2,11 +2,7 @@
 #include "HashTools.h"
 #include <string.h>
 
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunknown-pragmas"
-#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
-#endif
+IGNORE_WARNINGS_BEGIN("implicit-fallthrough")
 
 // Older versions of gperf like to use the `register` keyword.
 #define register
@@ -184,6 +180,4 @@ const struct NamedColor* findColor(const char* str, unsigned int len)
 
 } // namespace WebCore
 
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
+IGNORE_WARNINGS_END
index e00f94d..9929431 100644 (file)
@@ -198,11 +198,11 @@ bool CDMSessionAVStreamSession::update(Uint8Array* key, RefPtr<Uint8Array>& next
 
         RetainPtr<NSData> certificateData = adoptNS([[NSData alloc] initWithBytes:m_certificate->data() length:m_certificate->length()]);
 
-        IGNORE_CLANG_WARNINGS_BEGIN("objc-literal-conversion")
+        IGNORE_WARNINGS_BEGIN("objc-literal-conversion")
         String storagePath = this->storagePath();
         if (!storagePath.isEmpty() && [getAVStreamSessionClass() respondsToSelector:@selector(removePendingExpiredSessionReports:withAppIdentifier:storageDirectoryAtURL:)])
             [getAVStreamSessionClass() removePendingExpiredSessionReports:@[m_expiredSession.get()] withAppIdentifier:certificateData.get() storageDirectoryAtURL:[NSURL fileURLWithPath:storagePath]];
-        IGNORE_CLANG_WARNINGS_END
+        IGNORE_WARNINGS_END
         m_expiredSession = nullptr;
         return true;
     }
index eee35e1..d05785c 100644 (file)
@@ -3272,9 +3272,8 @@ std::optional<VideoPlaybackQualityMetrics> MediaPlayerPrivateAVFoundationObjC::v
 #if PLATFORM(WATCHOS)
     return std::nullopt;
 #else
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunknown-pragmas"
-#pragma clang diagnostic ignored "-Wunguarded-availability-new"
+    ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN
+
     auto metrics = [m_videoLayer videoPerformanceMetrics];
     if (!metrics)
         return std::nullopt;
@@ -3290,7 +3289,8 @@ std::optional<VideoPlaybackQualityMetrics> MediaPlayerPrivateAVFoundationObjC::v
         [metrics totalFrameDelay],
         displayCompositedFrames,
     };
-#pragma clang diagnostic pop
+
+    ALLOW_NEW_API_WITHOUT_GUARDS_END
 #endif
 }
 
index d77323d..2b50c1a 100644 (file)
@@ -657,12 +657,10 @@ std::optional<VideoPlaybackQualityMetrics> MediaPlayerPrivateMediaSourceAVFObjC:
         return std::nullopt;
 
     uint32_t displayCompositedFrames = 0;
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunknown-pragmas"
-#pragma clang diagnostic ignored "-Wunguarded-availability-new"
+    ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN
     if ([metrics respondsToSelector:@selector(numberOfDisplayCompositedVideoFrames)])
         displayCompositedFrames = [metrics numberOfDisplayCompositedVideoFrames];
-#pragma clang diagnostic pop
+    ALLOW_NEW_API_WITHOUT_GUARDS_END
 
     return VideoPlaybackQualityMetrics {
         static_cast<uint32_t>([metrics totalNumberOfVideoFrames]),
index f2effa4..20b0d92 100644 (file)
@@ -52,7 +52,7 @@
 #import <wtf/NeverDestroyed.h>
 #import <wtf/SoftLinking.h>
 
-IGNORE_CLANG_WARNINGS_BEGIN("nullability-completeness")
+IGNORE_WARNINGS_BEGIN("nullability-completeness")
 
 SOFT_LINK_FRAMEWORK(UIKit)
 SOFT_LINK_CLASS(UIKit, UIFont)
@@ -62,7 +62,7 @@ SOFT_LINK(UIKit, UIGraphicsGetCurrentContext, CGContextRef, (void), ())
 SOFT_LINK(UIKit, UIGraphicsGetImageFromCurrentImageContext, UIImage *, (void), ())
 SOFT_LINK(UIKit, UIGraphicsEndImageContext, void, (void), ())
 
-IGNORE_CLANG_WARNINGS_END
+IGNORE_WARNINGS_END
 
 namespace WebCore {
 
index 4dc8832..9633b3c 100644 (file)
@@ -583,12 +583,10 @@ NS_ASSUME_NONNULL_END
 
 - (void)setWebKitOverrideRouteSharingPolicy:(NSUInteger)routeSharingPolicy routingContextUID:(NSString *)routingContextUID
 {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunknown-pragmas"
-#pragma clang diagnostic ignored "-Wunguarded-availability-new"
+    ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN
     if ([_avPlayerViewController respondsToSelector:@selector(setWebKitOverrideRouteSharingPolicy:routingContextUID:)])
         [_avPlayerViewController setWebKitOverrideRouteSharingPolicy:routeSharingPolicy routingContextUID:routingContextUID];
-#pragma clang diagnostic pop
+    ALLOW_NEW_API_WITHOUT_GUARDS_END
 }
 
 - (void)enterFullScreenAnimated:(BOOL)animated completionHandler:(void (^)(BOOL success, NSError * __nullable error))completionHandler
index ac08d1f..0446ef6 100644 (file)
@@ -34,7 +34,8 @@
 #import <wtf/SoftLinking.h>
 #import <wtf/text/WTFString.h>
 
-IGNORE_CLANG_WARNINGS_BEGIN("nullability-completeness")
+IGNORE_WARNINGS_BEGIN("nullability-completeness")
+
 SOFT_LINK_FRAMEWORK(AVKit)
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
 SOFT_LINK_CLASS_OPTIONAL(AVKit, AVTouchBarMediaSelectionOption)
@@ -343,9 +344,8 @@ static RetainPtr<NSMutableArray> mediaSelectionOptions(const Vector<MediaSelecti
         _playbackSessionInterfaceMac->playbackSessionModel()->togglePictureInPicture();
 }
 
-IGNORE_CLANG_WARNINGS_END
+IGNORE_WARNINGS_END
 
 @end
 
 #endif // PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE) && ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
-
index 8fe505b..f6e242b 100644 (file)
@@ -97,10 +97,9 @@ CertificateInfo ResourceResponse::platformCertificateInfo() const
 
     if (trustResultType == kSecTrustResultInvalid) {
         // FIXME: This is deprecated <rdar://problem/45894288>.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         result = SecTrustEvaluate(trust, &trustResultType);
-#pragma clang diagnostic pop
+        ALLOW_DEPRECATED_DECLARATIONS_END
         if (result != errSecSuccess)
             return { };
     }
index 8889828..b98194b 100644 (file)
@@ -1,5 +1,23 @@
 2018-12-15  Darin Adler  <darin@apple.com>
 
+        Use warning-ignoring macros more consistently and simply
+        https://bugs.webkit.org/show_bug.cgi?id=192743
+
+        Reviewed by Mark Lam.
+
+        * UIProcess/ios/WKDrawingView.mm:
+        (-[WKDrawingView initWithEmbeddedViewID:webPageProxy:]):
+        Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
+        * UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
+        (-[WKFullScreenWindowController _EVOrganizationName]): Ditto.
+
+        * WebProcess/WebCoreSupport/WebAlternativeTextClient.h: Use
+        IGNORE_WARNINGS_BEGIN/END instead of IGNORE_CLANG_WARNINGS_BEGIN/END
+        because there is no need to accomodate non-clang compilers here.
+        Also use #pragma once, add a missing "explicit", and fix conditionals.
+
+2018-12-15  Darin Adler  <darin@apple.com>
+
         Replace many uses of String::format with more type-safe alternatives
         https://bugs.webkit.org/show_bug.cgi?id=192742
 
index 522d95e..885fd97 100644 (file)
     [_pencilView setFingerDrawingEnabled:NO];
     [_pencilView setUserInteractionEnabled:YES];
     [_pencilView setOpaque:NO];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+
+    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
     [_pencilView setDrawingDelegate:self];
-#pragma clang diagnostic pop
+    ALLOW_DEPRECATED_DECLARATIONS_END
 
     [self addSubview:_pencilView.get()];
 
index 939b5d3..aabe284 100644 (file)
@@ -907,10 +907,9 @@ static const NSTimeInterval kAnimationDuration = 0.2;
         SecTrustResultType result = kSecTrustResultProceed;
 
         // FIXME: This is deprecated <rdar://problem/45894288>.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+        ALLOW_DEPRECATED_DECLARATIONS_BEGIN
         OSStatus err = SecTrustEvaluate(trust, &result);
-#pragma clang diagnostic pop
+        ALLOW_DEPRECATED_DECLARATIONS_END
 
         if (err == noErr)
             infoDictionary = [(__bridge NSDictionary *)SecTrustCopyInfo(trust) autorelease];
index 0775e35..a2f0428 100644 (file)
@@ -23,9 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-
-#ifndef WebAlternativeTextClient_h
-#define WebAlternativeTextClient_h
+#pragma once
 
 #include <WebCore/AlternativeTextClient.h>
 
@@ -35,7 +33,7 @@ class WebPage;
 
 class WebAlternativeTextClient : public WebCore::AlternativeTextClient {
 public:
-    WebAlternativeTextClient(WebPage *);
+    explicit WebAlternativeTextClient(WebPage*);
     virtual ~WebAlternativeTextClient();
     void pageDestroyed() override;
 #if USE(AUTOCORRECTION_PANEL)
@@ -49,16 +47,15 @@ public:
     void removeDictationAlternatives(uint64_t dictationContext) override;
     Vector<String> dictationAlternatives(uint64_t dictationContext) override;
 #endif
+
 private:
-#if PLATFORM(IOS_FAMILY)
-    IGNORE_CLANG_WARNINGS_BEGIN("unused-private-field")
+#if !(USE(AUTOCORRECTION_PANEL) || USE(DICTATION_ALTERNATIVES))
+    IGNORE_WARNINGS_BEGIN("unused-private-field")
 #endif
-    WebPage *m_page;
-#if PLATFORM(IOS_FAMILY)
-    IGNORE_CLANG_WARNINGS_END
+    WebPagem_page;
+#if !(USE(AUTOCORRECTION_PANEL) || USE(DICTATION_ALTERNATIVES))
+    IGNORE_WARNINGS_END
 #endif
 };
 
 }
-
-#endif // WebAlternativeTextClient_h
index 3570259..0916b4e 100644 (file)
@@ -1,3 +1,19 @@
+2018-12-15  Darin Adler  <darin@apple.com>
+
+        Use warning-ignoring macros more consistently and simply
+        https://bugs.webkit.org/show_bug.cgi?id=192743
+
+        Reviewed by Mark Lam.
+
+        * DOM/DOM.mm: Use IGNORE_WARNINGS_BEGIN/END instead of
+        IGNORE_CLANG_WARNINGS_BEGIN since there is no need to accomodate non-clang
+        compilers in Objective-C++ code.
+
+        * WebCoreSupport/WebAlternativeTextClient.h: Use IGNORE_WARNINGS_BEGIN/END
+        instead of IGNORE_CLANG_WARNINGS_BEGIN/END because there is no need to
+        accomodate non-clang compilers here. Also use #pragma once, add a missing
+        "explicit" and fix conditionals.
+
 2018-12-12  Ryosuke Niwa  <rniwa@webkit.org>
 
         Make TextInputController.legacyAttributedString take DOM nodes and offsets
index 55f8a79..f87e615 100644 (file)
@@ -244,7 +244,7 @@ static inline WKQuad zeroQuad()
 
 @implementation DOMNode (WebCoreInternal)
 
-IGNORE_CLANG_WARNINGS_BEGIN("objc-protocol-method-implementation")
+IGNORE_WARNINGS_BEGIN("objc-protocol-method-implementation")
 
 - (NSString *)description
 {
@@ -258,7 +258,7 @@ IGNORE_CLANG_WARNINGS_BEGIN("objc-protocol-method-implementation")
     return [NSString stringWithFormat:@"<%@ [%@]: %p>", [[self class] description], [self nodeName], _internal];
 }
 
-IGNORE_CLANG_WARNINGS_END
+IGNORE_WARNINGS_END
 
 - (Bindings::RootObject*)_rootObject
 {
index 5fe54e2..a3b1598 100644 (file)
@@ -23,9 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-
-#ifndef WebAlternativeTextClient_h
-#define WebAlternativeTextClient_h
+#pragma once
 
 #import "CorrectionPanel.h"
 #import <WebCore/AlternativeTextClient.h>
@@ -34,7 +32,7 @@
 
 class WebAlternativeTextClient : public WebCore::AlternativeTextClient {
 public:
-    WebAlternativeTextClient(WebView *);
+    explicit WebAlternativeTextClient(WebView*);
     virtual ~WebAlternativeTextClient();
     void pageDestroyed() override;
 #if USE(AUTOCORRECTION_PANEL)
@@ -48,17 +46,17 @@ public:
     void removeDictationAlternatives(uint64_t dictationContext) override;
     Vector<String> dictationAlternatives(uint64_t dictationContext) override;
 #endif
+
 private:
-#if PLATFORM(IOS_FAMILY)
-IGNORE_CLANG_WARNINGS_BEGIN("unused-private-field")
+#if !(USE(AUTOCORRECTION_PANEL) || USE(DICTATION_ALTERNATIVES))
+    IGNORE_WARNINGS_BEGIN("unused-private-field")
 #endif
     WebView* m_webView;
-#if PLATFORM(IOS_FAMILY)
-IGNORE_CLANG_WARNINGS_END
+#if !(USE(AUTOCORRECTION_PANEL) || USE(DICTATION_ALTERNATIVES))
+    IGNORE_WARNINGS_END
 #endif
+
 #if USE(AUTOCORRECTION_PANEL)
     CorrectionPanel m_correctionPanel;
 #endif
 };
-
-#endif // WebAlternativeTextClient_h
index ee91fb0..c8d6402 100644 (file)
@@ -1,5 +1,25 @@
 2018-12-15  Darin Adler  <darin@apple.com>
 
+        Use warning-ignoring macros more consistently and simply
+        https://bugs.webkit.org/show_bug.cgi?id=192743
+
+        Reviewed by Mark Lam.
+
+        * DumpRenderTree/TestNetscapePlugIn/main.cpp:
+        (handleEventCarbon): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
+        * DumpRenderTree/mac/TextInputControllerMac.m:
+        (-[TextInputController interpretKeyEvents:withSender:]): Use
+        IGNORE_WARNINGS_BEGIN/END.
+        * WebKitTestRunner/mac/EventSenderProxy.mm:
+        (WTR::EventSenderProxy::mouseForceClick): Use
+        IGNORE_NULL_CHECK_WARNINGS_BEGIN/END.
+        (WTR::EventSenderProxy::startAndCancelMouseForceClick): Ditto.
+        (WTR::EventSenderProxy::mouseForceDown): Ditto.
+        (WTR::EventSenderProxy::mouseForceUp): Ditto.
+        (WTR::EventSenderProxy::mouseForceChanged): Ditto.
+
+2018-12-15  Darin Adler  <darin@apple.com>
+
         Replace many uses of String::format with more type-safe alternatives
         https://bugs.webkit.org/show_bug.cgi?id=192742
 
index 4cd1a62..8d82c49 100644 (file)
@@ -471,14 +471,9 @@ static int16_t handleEventCarbon(NPP instance, PluginObject* obj, EventRecord* e
             break;
         case mouseDown:
             if (obj->eventLogging) {
-#if __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#endif
+                ALLOW_DEPRECATED_DECLARATIONS_BEGIN
                 GlobalToLocal(&pt);
-#if __clang__
-#pragma clang diagnostic pop
-#endif
+                ALLOW_DEPRECATED_DECLARATIONS_END
                 pluginLog(instance, "mouseDown at (%d, %d)", pt.h, pt.v);
             }
             if (obj->evaluateScriptOnMouseDownOrKeyDown && obj->mouseDownForEvaluateScript)
@@ -486,14 +481,9 @@ static int16_t handleEventCarbon(NPP instance, PluginObject* obj, EventRecord* e
             break;
         case mouseUp:
             if (obj->eventLogging) {
-#if __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-#endif
+                ALLOW_DEPRECATED_DECLARATIONS_BEGIN
                 GlobalToLocal(&pt);
-#if __clang__
-#pragma clang diagnostic pop
-#endif
+                ALLOW_DEPRECATED_DECLARATIONS_END
                 pluginLog(instance, "mouseUp at (%d, %d)", pt.h, pt.v);
             }
             break;
index 227c963..b1b0db2 100644 (file)
@@ -541,10 +541,9 @@ NSString *NSTextInsertionUndoableAttributeName;
     
     id result = [inputMethodHandler callWebScriptMethod:@"call" withArguments:[NSArray arrayWithObjects:inputMethodHandler, eventParam, nil]];
     if (![result respondsToSelector:@selector(boolValue)] || ![result boolValue]) {
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wundeclared-selector"
+        IGNORE_WARNINGS_BEGIN("undeclared-selector")
         [sender doCommandBySelector:@selector(noop:)]; // AppKit sends noop: if the ime does not handle an event
-#pragma clang diagnostic pop
+        IGNORE_WARNINGS_END
     }
 
     inputMethodView = nil;
index 9643d52..3985e14 100644 (file)
@@ -417,11 +417,10 @@ void EventSenderProxy::mouseForceClick()
     [NSApp sendEvent:mouseUp];
 
     [NSApp _setCurrentEvent:nil];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wnonnull"
     // WKView caches the most recent pressure event, so send it a nil event to clear the cache.
+    IGNORE_NULL_CHECK_WARNINGS_BEGIN
     [targetView pressureChangeWithEvent:nil];
-#pragma clang diagnostic pop
+    IGNORE_NULL_CHECK_WARNINGS_END
 }
 
 void EventSenderProxy::startAndCancelMouseForceClick()
@@ -453,11 +452,10 @@ void EventSenderProxy::startAndCancelMouseForceClick()
     [NSApp sendEvent:mouseUp];
 
     [NSApp _setCurrentEvent:nil];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wnonnull"
     // WKView caches the most recent pressure event, so send it a nil event to clear the cache.
+    IGNORE_NULL_CHECK_WARNINGS_BEGIN
     [targetView pressureChangeWithEvent:nil];
-#pragma clang diagnostic pop
+    IGNORE_NULL_CHECK_WARNINGS_END
 }
 
 void EventSenderProxy::mouseForceDown()
@@ -479,11 +477,10 @@ void EventSenderProxy::mouseForceDown()
     [forceMouseDown _postDelayed];
 
     [NSApp _setCurrentEvent:nil];
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wnonnull"
     // WKView caches the most recent pressure event, so send it a nil event to clear the cache.
+    IGNORE_NULL_CHECK_WARNINGS_BEGIN
     [targetView pressureChangeWithEvent:nil];
-#pragma clang diagnostic pop
+    IGNORE_NULL_CHECK_WARNINGS_END
 }
 
 void EventSenderProxy::mouseForceUp()
@@ -503,12 +500,10 @@ void EventSenderProxy::mouseForceUp()
     ASSERT(targetView);
 
     [NSApp _setCurrentEvent:nil];
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wnonnull"
-// WKView caches the most recent pressure event, so send it a nil event to clear the cache.
+    // WKView caches the most recent pressure event, so send it a nil event to clear the cache.
+    IGNORE_NULL_CHECK_WARNINGS_BEGIN
     [targetView pressureChangeWithEvent:nil];
-#pragma clang diagnostic pop
+    IGNORE_NULL_CHECK_WARNINGS_END
 }
 
 void EventSenderProxy::mouseForceChanged(float force)
@@ -525,11 +520,10 @@ void EventSenderProxy::mouseForceChanged(float force)
     [NSApp sendEvent:beginPressure.get()];
     [NSApp sendEvent:pressureChangedEvent.get()];
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wnonnull"
     // WKView caches the most recent pressure event, so send it a nil event to clear the cache.
+    IGNORE_NULL_CHECK_WARNINGS_BEGIN
     [targetView pressureChangeWithEvent:nil];
-#pragma clang diagnostic pop
+    IGNORE_NULL_CHECK_WARNINGS_END
 }
 #else