Consistently use Obj-C boolean literals
authorkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Aug 2019 23:44:46 +0000 (23:44 +0000)
committerkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 Aug 2019 23:44:46 +0000 (23:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=200405
<rdar://problem/53880043>

Reviewed by Simon Fraser, Joseph Pecoraro.

There are places where we use equivalent but different expressions for
Obj-C boolean objects. For example, we use both [NSNumber
numberWithBool:YES] and @YES. There are places where both are used in
the same function, such as -[WebPreferences initialize]. The boolean
literal is in greater use and is more succinct, so standardize on
that. Also, change @(YES/NO) to @YES/NO.

Examples:

* NetscapeCoreAnimationMoviePlugin/main.m:
(NPP_GetValue):

Source/WebCore:

No new tests -- no new or changed functionality.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
* platform/graphics/cv/ImageTransferSessionVT.mm:
(WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
(WebCore::ImageTransferSessionVT::setSize):
(WebCore::ImageTransferSessionVT::ioSurfacePixelBufferCreationOptions):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):

Source/WebKit:

* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
(WebKit::LocalConnection::getAttestation const):

Source/WebKitLegacy/mac:

* History/WebHistoryItem.mm:
* WebView/WebFrame.mm:
(-[WebFrame _cacheabilityDictionary]):
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

Tools:

* DumpRenderTree/mac/ObjCController.m:
(-[ObjCController objectOfClass:]):
* TestWebKitAPI/Tests/WebKitCocoa/BundleEditingDelegate.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
(overrideAddObserverForName):
* TestWebKitAPI/ios/mainIOS.mm:
(main):
* TestWebKitAPI/mac/InjectedBundleControllerMac.mm:
(TestWebKitAPI::InjectedBundleController::platformInitialize):
* TestWebKitAPI/mac/mainMac.mm:
(main):
* WebKitLauncher/WebKitNightlyEnabler.m:
(enableWebKitNightlyBehaviour):

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

24 files changed:
Examples/ChangeLog
Examples/NetscapeCoreAnimationMoviePlugin/main.m
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
Source/WebCore/platform/graphics/cv/ImageTransferSessionVT.mm
Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm
Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm
Source/WebCore/platform/network/mac/ResourceHandleMac.mm
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalConnection.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/History/WebHistoryItem.mm
Source/WebKitLegacy/mac/WebView/WebFrame.mm
Source/WebKitLegacy/mac/WebView/WebPreferences.mm
Tools/ChangeLog
Tools/DumpRenderTree/mac/ObjCController.m
Tools/TestWebKitAPI/Tests/WebKitCocoa/BundleEditingDelegate.mm
Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm
Tools/TestWebKitAPI/ios/mainIOS.mm
Tools/TestWebKitAPI/mac/InjectedBundleControllerMac.mm
Tools/TestWebKitAPI/mac/mainMac.mm
Tools/WebKitLauncher/WebKitNightlyEnabler.m

index 4cdeb7f..c7375e7 100644 (file)
@@ -1,3 +1,21 @@
+2019-08-02  Keith Rollin  <krollin@apple.com>
+
+        Consistently use Obj-C boolean literals
+        https://bugs.webkit.org/show_bug.cgi?id=200405
+        <rdar://problem/53880043>
+
+        Reviewed by Simon Fraser, Joseph Pecoraro.
+
+        There are places where we use equivalent but different expressions for
+        Obj-C boolean objects. For example, we use both [NSNumber
+        numberWithBool:YES] and @YES. There are places where both are used in
+        the same function, such as -[WebPreferences initialize]. The boolean
+        literal is in greater use and is more succinct, so standardize on
+        that. Also, change @(YES/NO) to @YES/NO.
+
+        * NetscapeCoreAnimationMoviePlugin/main.m:
+        (NPP_GetValue):
+
 2014-12-03  Ada Chan  <adachan@apple.com>
 
         Add a sample plugin to demonstrate the mute plugin API.
index b23283f..3ac5c81 100644 (file)
@@ -364,8 +364,8 @@ NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value)
                 
                 if (obj->movieURL) {
                     NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:obj->movieURL, QTMovieURLAttribute,
-                                                [NSNumber numberWithBool:YES], QTMovieOpenForPlaybackAttribute, 
-                                                [NSNumber numberWithBool:YES], QTMovieLoopsAttribute, 
+                                                @YES, QTMovieOpenForPlaybackAttribute,
+                                                @YES, QTMovieLoopsAttribute,
                                                 nil];
                     obj->movie = [QTMovie movieWithAttributes:attributes error:nil];
 
index f9c8c49..f9f8c5f 100644 (file)
@@ -1,3 +1,33 @@
+2019-08-02  Keith Rollin  <krollin@apple.com>
+
+        Consistently use Obj-C boolean literals
+        https://bugs.webkit.org/show_bug.cgi?id=200405
+        <rdar://problem/53880043>
+
+        Reviewed by Simon Fraser, Joseph Pecoraro.
+
+        There are places where we use equivalent but different expressions for
+        Obj-C boolean objects. For example, we use both [NSNumber
+        numberWithBool:YES] and @YES. There are places where both are used in
+        the same function, such as -[WebPreferences initialize]. The boolean
+        literal is in greater use and is more succinct, so standardize on
+        that. Also, change @(YES/NO) to @YES/NO.
+
+        No new tests -- no new or changed functionality.
+
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
+        * platform/graphics/cv/ImageTransferSessionVT.mm:
+        (WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
+        (WebCore::ImageTransferSessionVT::setSize):
+        (WebCore::ImageTransferSessionVT::ioSurfacePixelBufferCreationOptions):
+        * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
+        (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
+        * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
+        (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):
+
 2019-08-02  Andres Gonzalez  <andresg_22@apple.com>
 
         Add accessibility object method to determine whether an element is inside a table cell. Needed for iOS accessibility client.
index 3242763..dee3c37 100644 (file)
@@ -1131,7 +1131,7 @@ void SourceBufferPrivateAVFObjC::enqueueSample(Ref<MediaSample>&& sample, const
                 CMSampleBufferRef rawSampleCopy;
                 CMSampleBufferCreateCopy(kCFAllocatorDefault, platformSample.sample.cmSampleBuffer, &rawSampleCopy);
                 auto sampleCopy = adoptCF(rawSampleCopy);
-                CMSetAttachment(sampleCopy.get(), kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed, (__bridge CFDictionaryRef)@{ (__bridge NSString *)kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed : @(YES) }, kCMAttachmentMode_ShouldNotPropagate);
+                CMSetAttachment(sampleCopy.get(), kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed, (__bridge CFDictionaryRef)@{ (__bridge NSString *)kCMSampleBufferAttachmentKey_PostNotificationWhenConsumed : @YES }, kCMAttachmentMode_ShouldNotPropagate);
                 [m_displayLayer enqueueSampleBuffer:sampleCopy.get()];
 #if PLATFORM(IOS_FAMILY)
                 m_mediaSource->player()->setHasAvailableVideoFrame(true);
index 4202658..861ac1d 100644 (file)
@@ -63,16 +63,16 @@ ImageTransferSessionVT::ImageTransferSessionVT(uint32_t pixelFormat)
     if (status != kCVReturnSuccess)
         RELEASE_LOG(Media, "ImageTransferSessionVT::ImageTransferSessionVT: VTSessionSetProperty(kVTPixelTransferPropertyKey_ScalingMode) failed with error %d", static_cast<int>(status));
 
-    status = VTSessionSetProperty(transferSession, kVTPixelTransferPropertyKey_EnableHighSpeedTransfer, @(YES));
+    status = VTSessionSetProperty(transferSession, kVTPixelTransferPropertyKey_EnableHighSpeedTransfer, @YES);
     if (status != kCVReturnSuccess)
         RELEASE_LOG(Media, "ImageTransferSessionVT::ImageTransferSessionVT: VTSessionSetProperty(kVTPixelTransferPropertyKey_EnableHighSpeedTransfer) failed with error %d", static_cast<int>(status));
 
-    status = VTSessionSetProperty(transferSession, kVTPixelTransferPropertyKey_RealTime, @(YES));
+    status = VTSessionSetProperty(transferSession, kVTPixelTransferPropertyKey_RealTime, @YES);
     if (status != kCVReturnSuccess)
         RELEASE_LOG(Media, "ImageTransferSessionVT::ImageTransferSessionVT: VTSessionSetProperty(kVTPixelTransferPropertyKey_RealTime) failed with error %d", static_cast<int>(status));
 
 #if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
-    status = VTSessionSetProperty(transferSession, kVTPixelTransferPropertyKey_EnableHardwareAcceleratedTransfer, @(YES));
+    status = VTSessionSetProperty(transferSession, kVTPixelTransferPropertyKey_EnableHardwareAcceleratedTransfer, @YES);
     if (status != kCVReturnSuccess)
         RELEASE_LOG(Media, "ImageTransferSessionVT::ImageTransferSessionVT: VTSessionSetProperty(kVTPixelTransferPropertyKey_EnableHardwareAcceleratedTransfer) failed with error %d", static_cast<int>(status));
 #endif
@@ -89,7 +89,7 @@ bool ImageTransferSessionVT::setSize(const IntSize& size)
         (__bridge NSString *)kCVPixelBufferWidthKey : @(size.width()),
         (__bridge NSString *)kCVPixelBufferHeightKey : @(size.height()),
         (__bridge NSString *)kCVPixelBufferPixelFormatTypeKey : @(m_pixelFormat),
-        (__bridge NSString *)cvPixelFormatOpenGLKey() : @(YES),
+        (__bridge NSString *)cvPixelFormatOpenGLKey() : @YES,
         (__bridge NSString *)kCVPixelBufferIOSurfacePropertiesKey : @{ /*empty dictionary*/ },
     };
 
@@ -280,7 +280,7 @@ CFDictionaryRef ImageTransferSessionVT::ioSurfacePixelBufferCreationOptions(IOSu
         return m_ioSurfaceBufferAttributes.get();
 
     m_ioSurfaceBufferAttributes = (__bridge CFDictionaryRef) @{
-        (__bridge NSString *)cvPixelFormatOpenGLKey() : @(YES),
+        (__bridge NSString *)cvPixelFormatOpenGLKey() : @YES,
     };
 
 #if PLATFORM(MAC)
@@ -295,7 +295,7 @@ CFDictionaryRef ImageTransferSessionVT::ioSurfacePixelBufferCreationOptions(IOSu
         && (IOSurfaceGetBytesPerRowOfPlane(surface, 1) >= width + extendedRight)
         && (IOSurfaceGetAllocSize(surface) >= (height + extendedBottom) * IOSurfaceGetBytesPerRowOfPlane(surface, 0) * 3 / 2)) {
             m_ioSurfaceBufferAttributes = (__bridge CFDictionaryRef) @{
-                (__bridge NSString *)kCVPixelBufferOpenGLCompatibilityKey : @(YES),
+                (__bridge NSString *)kCVPixelBufferOpenGLCompatibilityKey : @YES,
                 (__bridge NSString *)kCVPixelBufferExtendedPixelsRightKey : @(extendedRight),
                 (__bridge NSString *)kCVPixelBufferExtendedPixelsBottomKey : @(extendedBottom)
             };
index 17ebd66..d230659 100644 (file)
@@ -100,11 +100,11 @@ CVPixelBufferPoolRef RealtimeIncomingVideoSourceCocoa::pixelBufferPool(size_t wi
             (__bridge NSString *)kCVPixelBufferWidthKey: @(width),
             (__bridge NSString *)kCVPixelBufferHeightKey: @(height),
             (__bridge NSString *)kCVPixelBufferPixelFormatTypeKey: @(videoCaptureFormat),
-            (__bridge NSString *)kCVPixelBufferCGImageCompatibilityKey: @(NO),
+            (__bridge NSString *)kCVPixelBufferCGImageCompatibilityKey: @NO,
 #if PLATFORM(IOS_FAMILY)
-            (__bridge NSString *)kCVPixelFormatOpenGLESCompatibility : @(YES),
+            (__bridge NSString *)kCVPixelFormatOpenGLESCompatibility : @YES,
 #else
-            (__bridge NSString *)kCVPixelBufferOpenGLCompatibilityKey : @(YES),
+            (__bridge NSString *)kCVPixelBufferOpenGLCompatibilityKey : @YES,
 #endif
             (__bridge NSString *)kCVPixelBufferIOSurfacePropertiesKey : @{ }
         };
index 2cbf8ae..582a723 100644 (file)
@@ -149,7 +149,7 @@ bool ScreenDisplayCaptureSourceMac::createDisplayStream()
             (__bridge NSString *)kCGDisplayStreamMinimumFrameTime : @(1 / frameRate()),
             (__bridge NSString *)kCGDisplayStreamQueueDepth : @(screenQueueMaximumLength),
             (__bridge NSString *)kCGDisplayStreamColorSpace : (__bridge id)sRGBColorSpaceRef(),
-            (__bridge NSString *)kCGDisplayStreamShowCursor : @(YES),
+            (__bridge NSString *)kCGDisplayStreamShowCursor : @YES,
         };
 
         auto weakThis = makeWeakPtr(*this);
index e79e68d..dc5aedc 100644 (file)
@@ -124,11 +124,11 @@ NSURLRequest *ResourceHandle::applySniffingPoliciesIfNeeded(NSURLRequest *reques
 
 #if USE(CFNETWORK_CONTENT_ENCODING_SNIFFING_OVERRIDE)
     if (!shouldContentEncodingSniff)
-        [mutableRequest _setProperty:@(YES) forKey:(__bridge NSString *)kCFURLRequestContentDecoderSkipURLCheck];
+        [mutableRequest _setProperty:@YES forKey:(__bridge NSString *)kCFURLRequestContentDecoderSkipURLCheck];
 #endif
 
     if (!shouldContentSniff)
-        [mutableRequest _setProperty:@(NO) forKey:(__bridge NSString *)_kCFURLConnectionPropertyShouldSniff];
+        [mutableRequest _setProperty:@NO forKey:(__bridge NSString *)_kCFURLConnectionPropertyShouldSniff];
 
     return mutableRequest.autorelease();
 }
index a2b5143..aa1cf9a 100644 (file)
@@ -1,3 +1,25 @@
+2019-08-02  Keith Rollin  <krollin@apple.com>
+
+        Consistently use Obj-C boolean literals
+        https://bugs.webkit.org/show_bug.cgi?id=200405
+        <rdar://problem/53880043>
+
+        Reviewed by Simon Fraser, Joseph Pecoraro.
+
+        There are places where we use equivalent but different expressions for
+        Obj-C boolean objects. For example, we use both [NSNumber
+        numberWithBool:YES] and @YES. There are places where both are used in
+        the same function, such as -[WebPreferences initialize]. The boolean
+        literal is in greater use and is more succinct, so standardize on
+        that. Also, change @(YES/NO) to @YES/NO.
+
+        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
+        (WebKit::NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeeded):
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
+        * UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
+        (WebKit::LocalConnection::getAttestation const):
+
 2019-08-02  Sihui Liu  <sihui_liu@apple.com>
 
         API tests using permanent credentials should clear credentials left by previous tests
index ba5e880..f6d1ede 100644 (file)
@@ -98,11 +98,11 @@ void NetworkDataTaskCocoa::applySniffingPoliciesAndBindRequestToInferfaceIfNeede
 
 #if USE(CFNETWORK_CONTENT_ENCODING_SNIFFING_OVERRIDE)
     if (!shouldContentEncodingSniff)
-        [mutableRequest _setProperty:@(YES) forKey:(NSString *)kCFURLRequestContentDecoderSkipURLCheck];
+        [mutableRequest _setProperty:@YES forKey:(NSString *)kCFURLRequestContentDecoderSkipURLCheck];
 #endif
 
     if (!shouldContentSniff)
-        [mutableRequest _setProperty:@(NO) forKey:(NSString *)_kCFURLConnectionPropertyShouldSniff];
+        [mutableRequest _setProperty:@NO forKey:(NSString *)_kCFURLConnectionPropertyShouldSniff];
 
     if (!cocoaSession.m_boundInterfaceIdentifier.isNull())
         [mutableRequest setBoundInterfaceIdentifier:cocoaSession.m_boundInterfaceIdentifier];
index 04b0349..d82eefb 100644 (file)
@@ -988,7 +988,7 @@ NetworkSessionCocoa::NetworkSessionCocoa(NetworkProcess& networkProcess, Network
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 120000)
     // FIXME: Replace @"kCFStreamPropertyAutoErrorOnSystemChange" with a constant from the SDK once rdar://problem/40650244 is in a build.
     if (networkProcess.suppressesConnectionTerminationOnSystemChange())
-        configuration._socketStreamProperties = @{ @"kCFStreamPropertyAutoErrorOnSystemChange" : @(NO) };
+        configuration._socketStreamProperties = @{ @"kCFStreamPropertyAutoErrorOnSystemChange" : @NO };
 #endif
 
 #if PLATFORM(WATCHOS) && __WATCH_OS_VERSION_MIN_REQUIRED >= 60000
index 944705c..7aad4c6 100644 (file)
@@ -103,10 +103,10 @@ void LocalConnection::getAttestation(const String& rpId, const String& username,
         kMAOptionsBAAKeychainLabel: label,
         // FIXME(rdar://problem/38489134): Need a formal name.
         kMAOptionsBAAKeychainAccessGroup: @"com.apple.safari.WebAuthN.credentials",
-        kMAOptionsBAAIgnoreExistingKeychainItems: @(YES),
+        kMAOptionsBAAIgnoreExistingKeychainItems: @YES,
         // FIXME(rdar://problem/38489134): Determine a proper lifespan.
         kMAOptionsBAAValidity: @(1440), // Last one day.
-        kMAOptionsBAASCRTAttestation: @(NO),
+        kMAOptionsBAASCRTAttestation: @NO,
         kMAOptionsBAANonce: [NSData dataWithBytes:hash.data() length:hash.size()],
         kMAOptionsBAAAccessControls: (id)accessControlRef.get(),
         kMAOptionsBAAOIDSToInclude: @[kMAOptionsBAAOIDNonce]
index f67ca0a..570b15b 100644 (file)
@@ -1,3 +1,24 @@
+2019-08-02  Keith Rollin  <krollin@apple.com>
+
+        Consistently use Obj-C boolean literals
+        https://bugs.webkit.org/show_bug.cgi?id=200405
+        <rdar://problem/53880043>
+
+        Reviewed by Simon Fraser, Joseph Pecoraro.
+
+        There are places where we use equivalent but different expressions for
+        Obj-C boolean objects. For example, we use both [NSNumber
+        numberWithBool:YES] and @YES. There are places where both are used in
+        the same function, such as -[WebPreferences initialize]. The boolean
+        literal is in greater use and is more succinct, so standardize on
+        that. Also, change @(YES/NO) to @YES/NO.
+
+        * History/WebHistoryItem.mm:
+        * WebView/WebFrame.mm:
+        (-[WebFrame _cacheabilityDictionary]):
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+
 2019-08-01  Alex Christensen  <achristensen@webkit.org>
 
         Move FormData zip file generation to NetworkProcess and enable it for all WebKit clients for uploading directories
index 45607db..b739593 100644 (file)
@@ -436,7 +436,7 @@ WebHistoryItem *kit(HistoryItem* item)
                  forKey:lastVisitedTimeIntervalKey];
     }
     if (coreItem->lastVisitWasFailure())
-        [dict setObject:[NSNumber numberWithBool:YES] forKey:lastVisitWasFailureKey];
+        [dict setObject:@YES forKey:lastVisitWasFailureKey];
     if (Vector<String>* redirectURLs = _private->_redirectURLs.get()) {
         size_t size = redirectURLs->size();
         ASSERT(size);
index c75cbaa..a90622c 100644 (file)
@@ -2051,20 +2051,20 @@ static WebFrameLoadType toWebFrameLoadType(FrameLoadType frameLoadType)
         [result setObject:(NSError *)documentLoader->mainDocumentError() forKey:WebFrameMainDocumentError];
         
     if (frameLoader.subframeLoader().containsPlugins())
-        [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameHasPlugins];
+        [result setObject:@YES forKey:WebFrameHasPlugins];
     
     if (DOMWindow* domWindow = _private->coreFrame->document()->domWindow()) {
         if (domWindow->hasEventListeners(eventNames().unloadEvent))
-            [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameHasUnloadListener];
+            [result setObject:@YES forKey:WebFrameHasUnloadListener];
         if (domWindow->optionalApplicationCache())
-            [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameUsesApplicationCache];
+            [result setObject:@YES forKey:WebFrameUsesApplicationCache];
     }
     
     if (Document* document = _private->coreFrame->document()) {
         if (DatabaseManager::singleton().hasOpenDatabases(*document))
-            [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameUsesDatabases];
+            [result setObject:@YES forKey:WebFrameUsesDatabases];
         if (!document->canSuspendActiveDOMObjectsForDocumentSuspension())
-            [result setObject:[NSNumber numberWithBool:YES] forKey:WebFrameCanSuspendActiveDOMObjects];
+            [result setObject:@YES forKey:WebFrameCanSuspendActiveDOMObjects];
     }
     
     return result;
index 4ac8930..425e63c 100644 (file)
@@ -398,93 +398,93 @@ public:
 #endif
 
     NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
-        @"Times",                       WebKitStandardFontPreferenceKey,
-        @"Courier",                     WebKitFixedFontPreferenceKey,
-        @"Times",                       WebKitSerifFontPreferenceKey,
-        @"Helvetica",                   WebKitSansSerifFontPreferenceKey,
+        @"Times", WebKitStandardFontPreferenceKey,
+        @"Courier", WebKitFixedFontPreferenceKey,
+        @"Times", WebKitSerifFontPreferenceKey,
+        @"Helvetica", WebKitSansSerifFontPreferenceKey,
 #if !PLATFORM(IOS_FAMILY)
-        @"Apple Chancery",              WebKitCursiveFontPreferenceKey,
+        @"Apple Chancery", WebKitCursiveFontPreferenceKey,
 #else
-        @"Snell Roundhand",             WebKitCursiveFontPreferenceKey,
+        @"Snell Roundhand", WebKitCursiveFontPreferenceKey,
 #endif
-        @"Papyrus",                     WebKitFantasyFontPreferenceKey,
+        @"Papyrus", WebKitFantasyFontPreferenceKey,
 #if PLATFORM(IOS_FAMILY)
-        @"AppleColorEmoji",             WebKitPictographFontPreferenceKey,
+        @"AppleColorEmoji", WebKitPictographFontPreferenceKey,
 #else
-        @"Apple Color Emoji",           WebKitPictographFontPreferenceKey,
-#endif
-        @"0",                           WebKitMinimumFontSizePreferenceKey,
-        @"9",                           WebKitMinimumLogicalFontSizePreferenceKey, 
-        @"16",                          WebKitDefaultFontSizePreferenceKey,
-        @"13",                          WebKitDefaultFixedFontSizePreferenceKey,
-        @"ISO-8859-1",                  WebKitDefaultTextEncodingNamePreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitUsesEncodingDetectorPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitUserStyleSheetEnabledPreferenceKey,
-        @"",                            WebKitUserStyleSheetLocationPreferenceKey,
+        @"Apple Color Emoji", WebKitPictographFontPreferenceKey,
+#endif
+        @"0", WebKitMinimumFontSizePreferenceKey,
+        @"9", WebKitMinimumLogicalFontSizePreferenceKey,
+        @"16", WebKitDefaultFontSizePreferenceKey,
+        @"13", WebKitDefaultFixedFontSizePreferenceKey,
+        @"ISO-8859-1", WebKitDefaultTextEncodingNamePreferenceKey,
+        @NO, WebKitUsesEncodingDetectorPreferenceKey,
+        @NO, WebKitUserStyleSheetEnabledPreferenceKey,
+        @"", WebKitUserStyleSheetLocationPreferenceKey,
 #if !PLATFORM(IOS_FAMILY)
-        [NSNumber numberWithBool:NO],   WebKitShouldPrintBackgroundsPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitTextAreasAreResizablePreferenceKey,
+        @NO, WebKitShouldPrintBackgroundsPreferenceKey,
+        @NO, WebKitTextAreasAreResizablePreferenceKey,
 #endif
-        [NSNumber numberWithBool:NO],   WebKitShrinksStandaloneImagesToFitPreferenceKey,
+        @NO, WebKitShrinksStandaloneImagesToFitPreferenceKey,
 #if !PLATFORM(IOS_FAMILY)
-        [NSNumber numberWithBool:YES],  WebKitJavaEnabledPreferenceKey,
+        @YES, WebKitJavaEnabledPreferenceKey,
 #endif
-        [NSNumber numberWithBool:YES],  WebKitJavaScriptEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitJavaScriptMarkupEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitWebSecurityEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitAllowUniversalAccessFromFileURLsPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitAllowFileAccessFromFileURLsPreferenceKey,
+        @YES, WebKitJavaScriptEnabledPreferenceKey,
+        @YES, WebKitJavaScriptMarkupEnabledPreferenceKey,
+        @YES, WebKitWebSecurityEnabledPreferenceKey,
+        @YES, WebKitAllowUniversalAccessFromFileURLsPreferenceKey,
+        @YES, WebKitAllowFileAccessFromFileURLsPreferenceKey,
 #if PLATFORM(IOS_FAMILY)
-        [NSNumber numberWithBool:NO],   WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
+        @NO, WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
 #else
-        [NSNumber numberWithBool:YES],  WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
+        @YES, WebKitJavaScriptCanOpenWindowsAutomaticallyPreferenceKey,
 #endif
-        [NSNumber numberWithBool:YES],  WebKitPluginsEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitDatabasesEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitHTTPEquivEnabledPreferenceKey,
+        @YES, WebKitPluginsEnabledPreferenceKey,
+        @YES, WebKitDatabasesEnabledPreferenceKey,
+        @YES, WebKitHTTPEquivEnabledPreferenceKey,
 
 #if PLATFORM(IOS_FAMILY)
-        [NSNumber numberWithBool:NO],   WebKitStorageTrackerEnabledPreferenceKey,
-#endif
-        [NSNumber numberWithBool:YES],  WebKitLocalStorageEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitExperimentalNotificationsEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitAllowAnimatedImagesPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitAllowAnimatedImageLoopingPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitDisplayImagesKey,
-        [NSNumber numberWithBool:NO],   WebKitLoadSiteIconsKey,
-        @"1800",                        WebKitBackForwardCacheExpirationIntervalKey,
+        @NO, WebKitStorageTrackerEnabledPreferenceKey,
+#endif
+        @YES, WebKitLocalStorageEnabledPreferenceKey,
+        @NO, WebKitExperimentalNotificationsEnabledPreferenceKey,
+        @YES, WebKitAllowAnimatedImagesPreferenceKey,
+        @YES, WebKitAllowAnimatedImageLoopingPreferenceKey,
+        @YES, WebKitDisplayImagesKey,
+        @NO, WebKitLoadSiteIconsKey,
+        @"1800", WebKitBackForwardCacheExpirationIntervalKey,
 #if !PLATFORM(IOS_FAMILY)
-        [NSNumber numberWithBool:NO],   WebKitTabToLinksPreferenceKey,
+        @NO, WebKitTabToLinksPreferenceKey,
 #endif
-        [NSNumber numberWithBool:NO],   WebKitPrivateBrowsingEnabledPreferenceKey,
+        @NO, WebKitPrivateBrowsingEnabledPreferenceKey,
 #if !PLATFORM(IOS_FAMILY)
-        [NSNumber numberWithBool:NO],   WebKitRespectStandardStyleKeyEquivalentsPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitShowsURLsInToolTipsPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitShowsToolTipOverTruncatedTextPreferenceKey,
-        @"1",                           WebKitPDFDisplayModePreferenceKey,
-        @"0",                           WebKitPDFScaleFactorPreferenceKey,
+        @NO, WebKitRespectStandardStyleKeyEquivalentsPreferenceKey,
+        @NO, WebKitShowsURLsInToolTipsPreferenceKey,
+        @NO, WebKitShowsToolTipOverTruncatedTextPreferenceKey,
+        @"1", WebKitPDFDisplayModePreferenceKey,
+        @"0", WebKitPDFScaleFactorPreferenceKey,
 #endif
-        @"0",                           WebKitUseSiteSpecificSpoofingPreferenceKey,
+        @"0", WebKitUseSiteSpecificSpoofingPreferenceKey,
         [NSNumber numberWithInt:WebKitEditableLinkDefaultBehavior], WebKitEditableLinkBehaviorPreferenceKey,
 #if !PLATFORM(IOS_FAMILY)
         [NSNumber numberWithInt:WebTextDirectionSubmenuAutomaticallyIncluded],
                                         WebKitTextDirectionSubmenuInclusionBehaviorPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitDOMPasteAllowedPreferenceKey,
+        @NO, WebKitDOMPasteAllowedPreferenceKey,
 #endif
-        [NSNumber numberWithBool:YES],  WebKitUsesPageCachePreferenceKey,
+        @YES, WebKitUsesPageCachePreferenceKey,
         [NSNumber numberWithInt:cacheModelForMainBundle()], WebKitCacheModelPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitPageCacheSupportsPluginsPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitDeveloperExtrasEnabledPreferenceKey,
+        @YES, WebKitPageCacheSupportsPluginsPreferenceKey,
+        @NO, WebKitDeveloperExtrasEnabledPreferenceKey,
         [NSNumber numberWithUnsignedInt:0], WebKitJavaScriptRuntimeFlagsPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitAuthorAndUserStylesEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitDOMTimersThrottlingEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitWebArchiveDebugModeEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitLocalFileContentSniffingEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitOfflineWebApplicationCacheEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitZoomsTextOnlyPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitJavaScriptCanAccessClipboardPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitXSSAuditorEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitAcceleratedCompositingEnabledPreferenceKey,
+        @YES, WebKitAuthorAndUserStylesEnabledPreferenceKey,
+        @YES, WebKitDOMTimersThrottlingEnabledPreferenceKey,
+        @NO, WebKitWebArchiveDebugModeEnabledPreferenceKey,
+        @NO, WebKitLocalFileContentSniffingEnabledPreferenceKey,
+        @NO, WebKitOfflineWebApplicationCacheEnabledPreferenceKey,
+        @YES, WebKitZoomsTextOnlyPreferenceKey,
+        @NO, WebKitJavaScriptCanAccessClipboardPreferenceKey,
+        @YES, WebKitXSSAuditorEnabledPreferenceKey,
+        @YES, WebKitAcceleratedCompositingEnabledPreferenceKey,
 
 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
 #define DEFAULT_SUBPIXEL_ANTIALIASED_LAYER_TEXT_ENABLED YES
@@ -493,67 +493,67 @@ public:
 #endif
         [NSNumber numberWithBool:DEFAULT_SUBPIXEL_ANTIALIASED_LAYER_TEXT_ENABLED], WebKitSubpixelAntialiasedLayerTextEnabledPreferenceKey,
 
-        [NSNumber numberWithBool:NO],   WebKitDisplayListDrawingEnabledPreferenceKey,
+        @NO, WebKitDisplayListDrawingEnabledPreferenceKey,
 #if PLATFORM(IOS_FAMILY) && !PLATFORM(IOS_FAMILY_SIMULATOR)
-        [NSNumber numberWithBool:YES],  WebKitAcceleratedDrawingEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitCanvasUsesAcceleratedDrawingPreferenceKey,
+        @YES, WebKitAcceleratedDrawingEnabledPreferenceKey,
+        @YES, WebKitCanvasUsesAcceleratedDrawingPreferenceKey,
 #else
-        [NSNumber numberWithBool:NO],  WebKitAcceleratedDrawingEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],  WebKitCanvasUsesAcceleratedDrawingPreferenceKey,
-#endif
-        [NSNumber numberWithBool:NO],   WebKitShowDebugBordersPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitSimpleLineLayoutEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitShowRepaintCounterPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitWebGLEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],   WebKitForceWebGLUsesLowPowerPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitAccelerated2dCanvasEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],  WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],  WebKitResourceLoadStatisticsEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitLargeImageAsyncDecodingEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitAnimatedImageAsyncDecodingEnabledPreferenceKey,
+        @NO, WebKitAcceleratedDrawingEnabledPreferenceKey,
+        @NO, WebKitCanvasUsesAcceleratedDrawingPreferenceKey,
+#endif
+        @NO, WebKitShowDebugBordersPreferenceKey,
+        @YES, WebKitSimpleLineLayoutEnabledPreferenceKey,
+        @NO, WebKitSimpleLineLayoutDebugBordersEnabledPreferenceKey,
+        @NO, WebKitShowRepaintCounterPreferenceKey,
+        @YES, WebKitWebGLEnabledPreferenceKey,
+        @YES, WebKitForceWebGLUsesLowPowerPreferenceKey,
+        @NO, WebKitAccelerated2dCanvasEnabledPreferenceKey,
+        @NO, WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey,
+        @NO, WebKitResourceLoadStatisticsEnabledPreferenceKey,
+        @YES, WebKitLargeImageAsyncDecodingEnabledPreferenceKey,
+        @YES, WebKitAnimatedImageAsyncDecodingEnabledPreferenceKey,
 #if PLATFORM(IOS_FAMILY)
         [NSNumber numberWithUnsignedInt:static_cast<uint32_t>(FrameFlattening::FullyEnabled)], WebKitFrameFlatteningPreferenceKey,
 #else
         [NSNumber numberWithUnsignedInt:static_cast<uint32_t>(FrameFlattening::Disabled)], WebKitFrameFlatteningPreferenceKey,
 #endif
-        [NSNumber numberWithBool:NO], WebKitAsyncFrameScrollingEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitSpatialNavigationEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],  WebKitDNSPrefetchingEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitFullScreenEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitAsynchronousSpellCheckingEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitHyperlinkAuditingEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitUsePreHTML5ParserQuirksKey,
-        [NSNumber numberWithBool:YES],  WebKitAVFoundationEnabledKey,
-        [NSNumber numberWithBool:YES],  WebKitAVFoundationNSURLSessionEnabledKey,
-        [NSNumber numberWithBool:NO],   WebKitSuppressesIncrementalRenderingKey,
+        @NO, WebKitAsyncFrameScrollingEnabledPreferenceKey,
+        @NO, WebKitSpatialNavigationEnabledPreferenceKey,
+        @NO, WebKitDNSPrefetchingEnabledPreferenceKey,
+        @NO, WebKitFullScreenEnabledPreferenceKey,
+        @NO, WebKitAsynchronousSpellCheckingEnabledPreferenceKey,
+        @YES, WebKitHyperlinkAuditingEnabledPreferenceKey,
+        @NO, WebKitUsePreHTML5ParserQuirksKey,
+        @YES, WebKitAVFoundationEnabledKey,
+        @YES, WebKitAVFoundationNSURLSessionEnabledKey,
+        @NO, WebKitSuppressesIncrementalRenderingKey,
         [NSNumber numberWithBool:attachmentElementEnabled], WebKitAttachmentElementEnabledPreferenceKey,
 #if !PLATFORM(IOS_FAMILY)
-        [NSNumber numberWithBool:YES],  WebKitAllowsInlineMediaPlaybackPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey,
-        [NSNumber numberWithBool:YES],  WebKitMediaControlsScaleWithPageZoomPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitWebAudioEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitBackspaceKeyNavigationEnabledKey,
-        [NSNumber numberWithBool:NO],   WebKitShouldDisplaySubtitlesPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitShouldDisplayCaptionsPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitShouldDisplayTextDescriptionsPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitNotificationsEnabledKey,
-        [NSNumber numberWithBool:NO],   WebKitShouldRespectImageOrientationKey,
-        [NSNumber numberWithBool:YES],  WebKitMediaDataLoadsAutomaticallyPreferenceKey,
+        @YES, WebKitAllowsInlineMediaPlaybackPreferenceKey,
+        @NO, WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey,
+        @NO, WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey,
+        @YES, WebKitMediaControlsScaleWithPageZoomPreferenceKey,
+        @NO, WebKitWebAudioEnabledPreferenceKey,
+        @YES, WebKitBackspaceKeyNavigationEnabledKey,
+        @NO, WebKitShouldDisplaySubtitlesPreferenceKey,
+        @NO, WebKitShouldDisplayCaptionsPreferenceKey,
+        @NO, WebKitShouldDisplayTextDescriptionsPreferenceKey,
+        @YES, WebKitNotificationsEnabledKey,
+        @NO, WebKitShouldRespectImageOrientationKey,
+        @YES, WebKitMediaDataLoadsAutomaticallyPreferenceKey,
 #else
-        [NSNumber numberWithBool:allowsInlineMediaPlayback],   WebKitAllowsInlineMediaPlaybackPreferenceKey,
-        [NSNumber numberWithBool:allowsInlineMediaPlaybackAfterFullscreen],   WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey,
+        [NSNumber numberWithBool:allowsInlineMediaPlayback], WebKitAllowsInlineMediaPlaybackPreferenceKey,
+        [NSNumber numberWithBool:allowsInlineMediaPlaybackAfterFullscreen], WebKitAllowsInlineMediaPlaybackAfterFullscreenPreferenceKey,
         [NSNumber numberWithBool:requiresPlaysInlineAttribute], WebKitInlineMediaPlaybackRequiresPlaysInlineAttributeKey,
-        [NSNumber numberWithBool:NO],   WebKitMediaControlsScaleWithPageZoomPreferenceKey,
-        [NSNumber numberWithUnsignedInt:AudioSession::None],  WebKitAudioSessionCategoryOverride,
-        [NSNumber numberWithBool:NO],   WebKitMediaDataLoadsAutomaticallyPreferenceKey,
+        @NO, WebKitMediaControlsScaleWithPageZoomPreferenceKey,
+        [NSNumber numberWithUnsignedInt:AudioSession::None], WebKitAudioSessionCategoryOverride,
+        @NO, WebKitMediaDataLoadsAutomaticallyPreferenceKey,
 #if HAVE(AVKIT)
-        [NSNumber numberWithBool:YES],  WebKitAVKitEnabled,
+        @YES, WebKitAVKitEnabled,
 #endif
-        [NSNumber numberWithBool:YES],  WebKitRequiresUserGestureForMediaPlaybackPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitRequiresUserGestureForVideoPlaybackPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitRequiresUserGestureForAudioPlaybackPreferenceKey,
+        @YES, WebKitRequiresUserGestureForMediaPlaybackPreferenceKey,
+        @NO, WebKitRequiresUserGestureForVideoPlaybackPreferenceKey,
+        @NO, WebKitRequiresUserGestureForAudioPlaybackPreferenceKey,
         [NSNumber numberWithLongLong:WebCore::ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
 
         // Per-Origin Quota on iOS is 25MB. When the quota is reached for a particular origin
@@ -561,32 +561,32 @@ public:
         [NSNumber numberWithLongLong:(25 * 1024 * 1024)], WebKitApplicationCacheDefaultOriginQuota,
 
         // Enable WebAudio by default in all iOS UIWebViews
-        [NSNumber numberWithBool:YES],   WebKitWebAudioEnabledPreferenceKey,
+        @YES, WebKitWebAudioEnabledPreferenceKey,
 
-        [NSNumber numberWithBool:YES],   WebKitShouldRespectImageOrientationKey,
+        @YES, WebKitShouldRespectImageOrientationKey,
 #endif // PLATFORM(IOS_FAMILY)
 #if ENABLE(WIRELESS_TARGET_PLAYBACK)
-        [NSNumber numberWithBool:YES],  WebKitAllowsAirPlayForMediaPlaybackPreferenceKey,
+        @YES, WebKitAllowsAirPlayForMediaPlaybackPreferenceKey,
 #endif
-        [NSNumber numberWithBool:YES],  WebKitAllowsPictureInPictureMediaPlaybackPreferenceKey,
-        [NSNumber numberWithBool:YES],  WebKitRequestAnimationFrameEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitWantsBalancedSetDefersLoadingBehaviorKey,
-        [NSNumber numberWithBool:NO],   WebKitDiagnosticLoggingEnabledKey,
+        @YES, WebKitAllowsPictureInPictureMediaPlaybackPreferenceKey,
+        @YES, WebKitRequestAnimationFrameEnabledPreferenceKey,
+        @NO, WebKitWantsBalancedSetDefersLoadingBehaviorKey,
+        @NO, WebKitDiagnosticLoggingEnabledKey,
         [NSNumber numberWithInt:WebAllowAllStorage], WebKitStorageBlockingPolicyKey,
-        [NSNumber numberWithBool:NO],   WebKitPlugInSnapshottingEnabledPreferenceKey,
+        @NO, WebKitPlugInSnapshottingEnabledPreferenceKey,
 
 #if PLATFORM(IOS_FAMILY)
-        [NSNumber numberWithBool:YES],  WebKitContentChangeObserverEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO],   WebKitTelephoneParsingEnabledPreferenceKey,
-        [NSNumber numberWithInt:-1],      WebKitLayoutIntervalPreferenceKey,
+        @YES, WebKitContentChangeObserverEnabledPreferenceKey,
+        @NO, WebKitTelephoneParsingEnabledPreferenceKey,
+        [NSNumber numberWithInt:-1], WebKitLayoutIntervalPreferenceKey,
         [NSNumber numberWithFloat:-1.0f], WebKitMaxParseDurationPreferenceKey,
-        [NSNumber numberWithBool:NO],     WebKitAllowMultiElementImplicitFormSubmissionPreferenceKey,
-        [NSNumber numberWithBool:NO],     WebKitAlwaysRequestGeolocationPermissionPreferenceKey,
+        @NO, WebKitAllowMultiElementImplicitFormSubmissionPreferenceKey,
+        @NO, WebKitAlwaysRequestGeolocationPermissionPreferenceKey,
         [NSNumber numberWithInt:InterpolationLow], WebKitInterpolationQualityPreferenceKey,
-        [NSNumber numberWithBool:YES],    WebKitPasswordEchoEnabledPreferenceKey,
-        [NSNumber numberWithFloat:2.0f],  WebKitPasswordEchoDurationPreferenceKey,
-        [NSNumber numberWithBool:NO],     WebKitNetworkDataUsageTrackingEnabledPreferenceKey,
-        @"",                              WebKitNetworkInterfaceNamePreferenceKey,
+        @YES, WebKitPasswordEchoEnabledPreferenceKey,
+        [NSNumber numberWithFloat:2.0f], WebKitPasswordEchoDurationPreferenceKey,
+        @NO, WebKitNetworkDataUsageTrackingEnabledPreferenceKey,
+        @"", WebKitNetworkInterfaceNamePreferenceKey,
 #endif
 #if ENABLE(TEXT_AUTOSIZING)
         [NSNumber numberWithFloat:Settings::defaultMinimumZoomFontSize()], WebKitMinimumZoomFontSizePreferenceKey,
@@ -594,56 +594,56 @@ public:
 #endif
         [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
         [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
-        [NSNumber numberWithBool:NO], WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO], WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO], WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey,
+        @NO, WebKitHiddenPageDOMTimerThrottlingEnabledPreferenceKey,
+        @NO, WebKitHiddenPageCSSAnimationSuspensionEnabledPreferenceKey,
+        @NO, WebKitLowPowerVideoAudioBufferSizeEnabledPreferenceKey,
         
-        [NSNumber numberWithBool:NO], WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey,
+        @NO, WebKitUseLegacyTextAlignPositionedElementBehaviorPreferenceKey,
 #if ENABLE(MEDIA_SOURCE)
-        [NSNumber numberWithBool:YES], WebKitMediaSourceEnabledPreferenceKey,
+        @YES, WebKitMediaSourceEnabledPreferenceKey,
         @YES, WebKitSourceBufferChangeTypeEnabledPreferenceKey,
 #endif
 #if ENABLE(SERVICE_CONTROLS)
-        [NSNumber numberWithBool:NO], WebKitImageControlsEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO], WebKitServiceControlsEnabledPreferenceKey,
+        @NO, WebKitImageControlsEnabledPreferenceKey,
+        @NO, WebKitServiceControlsEnabledPreferenceKey,
 #endif
-        [NSNumber numberWithBool:NO], WebKitEnableInheritURIQueryComponentPreferenceKey,
+        @NO, WebKitEnableInheritURIQueryComponentPreferenceKey,
 #if ENABLE(LEGACY_ENCRYPTED_MEDIA)
         @"~/Library/WebKit/MediaKeys", WebKitMediaKeysStorageDirectoryKey,
 #endif
 #if ENABLE(MEDIA_STREAM)
-        [NSNumber numberWithBool:NO], WebKitMockCaptureDevicesEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES], WebKitMockCaptureDevicesPromptEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES], WebKitMediaCaptureRequiresSecureConnectionPreferenceKey,
-#endif
-        [NSNumber numberWithBool:YES], WebKitShadowDOMEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES], WebKitCustomElementsEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES], WebKitDataTransferItemsEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO], WebKitCustomPasteboardDataEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO], WebKitDialogElementEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES], WebKitModernMediaControlsEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO], WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey,
+        @NO, WebKitMockCaptureDevicesEnabledPreferenceKey,
+        @YES, WebKitMockCaptureDevicesPromptEnabledPreferenceKey,
+        @YES, WebKitMediaCaptureRequiresSecureConnectionPreferenceKey,
+#endif
+        @YES, WebKitShadowDOMEnabledPreferenceKey,
+        @YES, WebKitCustomElementsEnabledPreferenceKey,
+        @YES, WebKitDataTransferItemsEnabledPreferenceKey,
+        @NO, WebKitCustomPasteboardDataEnabledPreferenceKey,
+        @NO, WebKitDialogElementEnabledPreferenceKey,
+        @YES, WebKitModernMediaControlsEnabledPreferenceKey,
+        @NO, WebKitWebAnimationsCSSIntegrationEnabledPreferenceKey,
 
 #if ENABLE(WEBGL2)
-        [NSNumber numberWithBool:NO], WebKitWebGL2EnabledPreferenceKey,
+        @NO, WebKitWebGL2EnabledPreferenceKey,
 #endif
 #if ENABLE(WEBGPU)
-        [NSNumber numberWithBool:NO], WebKitWebGPUEnabledPreferenceKey,
+        @NO, WebKitWebGPUEnabledPreferenceKey,
 #endif
-        [NSNumber numberWithBool:NO], WebKitCacheAPIEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES], WebKitFetchAPIEnabledPreferenceKey,
+        @NO, WebKitCacheAPIEnabledPreferenceKey,
+        @YES, WebKitFetchAPIEnabledPreferenceKey,
 
 #if ENABLE(STREAMS_API)
-        [NSNumber numberWithBool:NO], WebKitReadableByteStreamAPIEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO], WebKitWritableStreamAPIEnabledPreferenceKey,
+        @NO, WebKitReadableByteStreamAPIEnabledPreferenceKey,
+        @NO, WebKitWritableStreamAPIEnabledPreferenceKey,
 #endif
 #if ENABLE(DOWNLOAD_ATTRIBUTE)
-        [NSNumber numberWithBool:NO], WebKitDownloadAttributeEnabledPreferenceKey,
+        @NO, WebKitDownloadAttributeEnabledPreferenceKey,
 #endif
-        [NSNumber numberWithBool:NO], WebKitDirectoryUploadEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES], WebKitWebAnimationsEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES], WebKitPointerEventsEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES], WebKitSyntheticEditingCommandsEnabledPreferenceKey,
+        @NO, WebKitDirectoryUploadEnabledPreferenceKey,
+        @YES, WebKitWebAnimationsEnabledPreferenceKey,
+        @YES, WebKitPointerEventsEnabledPreferenceKey,
+        @YES, WebKitSyntheticEditingCommandsEnabledPreferenceKey,
 
 #if PLATFORM(IOS_FAMILY)
         @NO, WebKitVisualViewportAPIEnabledPreferenceKey,
@@ -651,20 +651,20 @@ public:
         @YES, WebKitVisualViewportAPIEnabledPreferenceKey,
 #endif
 
-        [NSNumber numberWithBool:YES], WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES], WebKitNeedsStorageAccessFromFileURLsQuirkKey,
-        [NSNumber numberWithBool:NO], WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey,
+        @YES, WebKitCSSOMViewScrollingAPIEnabledPreferenceKey,
+        @YES, WebKitNeedsStorageAccessFromFileURLsQuirkKey,
+        @NO, WebKitAllowCrossOriginSubresourcesToAskForCredentialsKey,
 #if ENABLE(MEDIA_STREAM)
-        [NSNumber numberWithBool:NO], WebKitMediaDevicesEnabledPreferenceKey,
-        [NSNumber numberWithBool:YES], WebKitMediaStreamEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO], WebKitMediaRecorderEnabledPreferenceKey,
+        @NO, WebKitMediaDevicesEnabledPreferenceKey,
+        @YES, WebKitMediaStreamEnabledPreferenceKey,
+        @NO, WebKitMediaRecorderEnabledPreferenceKey,
 #endif
 #if ENABLE(WEB_RTC)
-        [NSNumber numberWithBool:YES], WebKitPeerConnectionEnabledPreferenceKey,
+        @YES, WebKitPeerConnectionEnabledPreferenceKey,
 #endif
-        [NSNumber numberWithBool:YES], WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO], WebKitCSSLogicalEnabledPreferenceKey,
-        [NSNumber numberWithBool:NO], WebKitAdClickAttributionEnabledPreferenceKey,
+        @YES, WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey,
+        @NO, WebKitCSSLogicalEnabledPreferenceKey,
+        @NO, WebKitAdClickAttributionEnabledPreferenceKey,
 #if ENABLE(INTERSECTION_OBSERVER)
         @NO, WebKitIntersectionObserverEnabledPreferenceKey,
 #endif
index 33542d0..46f6dd6 100644 (file)
@@ -1,3 +1,33 @@
+2019-08-02  Keith Rollin  <krollin@apple.com>
+
+        Consistently use Obj-C boolean literals
+        https://bugs.webkit.org/show_bug.cgi?id=200405
+        <rdar://problem/53880043>
+
+        Reviewed by Simon Fraser, Joseph Pecoraro.
+
+        There are places where we use equivalent but different expressions for
+        Obj-C boolean objects. For example, we use both [NSNumber
+        numberWithBool:YES] and @YES. There are places where both are used in
+        the same function, such as -[WebPreferences initialize]. The boolean
+        literal is in greater use and is more succinct, so standardize on
+        that. Also, change @(YES/NO) to @YES/NO.
+
+        * DumpRenderTree/mac/ObjCController.m:
+        (-[ObjCController objectOfClass:]):
+        * TestWebKitAPI/Tests/WebKitCocoa/BundleEditingDelegate.mm:
+        (TEST):
+        * TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm:
+        (overrideAddObserverForName):
+        * TestWebKitAPI/ios/mainIOS.mm:
+        (main):
+        * TestWebKitAPI/mac/InjectedBundleControllerMac.mm:
+        (TestWebKitAPI::InjectedBundleController::platformInitialize):
+        * TestWebKitAPI/mac/mainMac.mm:
+        (main):
+        * WebKitLauncher/WebKitNightlyEnabler.m:
+        (enableWebKitNightlyBehaviour):
+
 2019-08-02  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         TextAutosizingBoost.ChangeAutosizingBoostAtRuntime fails on iPad Simulator
index 27c692d..6bdec3f 100644 (file)
@@ -144,7 +144,7 @@ static void* runJavaScriptThread(void* arg)
     if ([aClass isEqualToString:@"WebUndefined"])
         return [WebUndefined undefined];
     if ([aClass isEqualToString:@"NSCFBoolean"])
-        return [NSNumber numberWithBool:true];
+        return @YES;
     if ([aClass isEqualToString:@"NSCFNumber"])
         return [NSNumber numberWithInt:1];
     if ([aClass isEqualToString:@"NSCFString"])
index c5fca3e..0462a88 100644 (file)
@@ -72,7 +72,7 @@ static bool didWriteToPasteboard;
 TEST(WebKit, WKWebProcessPlugInEditingDelegate)
 {
     RetainPtr<WKWebViewConfiguration> configuration = retainPtr([WKWebViewConfiguration _test_configurationWithTestPlugInClassName:@"BundleEditingDelegatePlugIn"]);
-    [[configuration processPool] _setObject:[NSNumber numberWithBool:NO] forBundleParameter:@"EditingDelegateShouldInsertText"];
+    [[configuration processPool] _setObject:@NO forBundleParameter:@"EditingDelegateShouldInsertText"];
     
     RetainPtr<WKWebView> webView = adoptNS([[WKWebView alloc] initWithFrame:NSMakeRect(0, 0, 800, 600) configuration:configuration.get()]);
 
index 9bbcbf6..d0e2e7d 100644 (file)
@@ -274,7 +274,7 @@ static id overrideAddObserverForName(id, SEL, NSNotificationName name, id, NSOpe
 {
     if ([name isEqual:NSWindowWillCloseNotification])
         gNotificationCallback = makeBlockPtr(block);
-    return [NSNumber numberWithBool:YES];
+    return @YES;
 }
 #endif
 
index cb8c0c5..cf08a74 100644 (file)
@@ -38,7 +38,7 @@ int main(int argc, char** argv)
         argumentDomain = [[NSMutableDictionary alloc] init];
     
     NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
-                          [NSNumber numberWithBool:YES],    @"WebKitLinkedOnOrAfterEverything",
+                          @YES,    @"WebKitLinkedOnOrAfterEverything",
                           nil];
 
     [argumentDomain addEntriesFromDictionary:dict];
index 7b2bd7f..3a33c2d 100644 (file)
@@ -40,8 +40,8 @@ void InjectedBundleController::platformInitialize()
     NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
                           [NSNumber numberWithInteger:4],   @"AppleAntiAliasingThreshold",
                           [NSNumber numberWithInteger:0],   @"AppleFontSmoothing",
-                          [NSNumber numberWithBool:NO],     @"NSScrollAnimationEnabled",
-                          [NSNumber numberWithBool:NO],     @"NSOverlayScrollersEnabled",
+                          @NO,     @"NSScrollAnimationEnabled",
+                          @NO,     @"NSOverlayScrollersEnabled",
                           @"Always",                        @"AppleShowScrollBars",
                           nil];
 
index d312c67..7ca99e6 100644 (file)
@@ -40,7 +40,7 @@ int main(int argc, char** argv)
         argumentDomain = [[NSMutableDictionary alloc] init];
     
     NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
-                          [NSNumber numberWithBool:YES],    @"WebKitLinkedOnOrAfterEverything",
+                          @YES,    @"WebKitLinkedOnOrAfterEverything",
                           nil];
 
     [argumentDomain addEntriesFromDictionary:dict];
index 999f1c1..97bb7b6 100644 (file)
@@ -157,7 +157,7 @@ static void enableWebKitNightlyBehaviour()
 
     NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
     NSDictionary *defaultPrefs = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:RunStateShutDown], WKNERunState,
-                                                                            [NSNumber numberWithBool:YES], WKNEShouldMonitorShutdowns,
+                                                                            @YES, WKNEShouldMonitorShutdowns,
                                                                             disabledInputManagers, @"NSDisabledInputManagers", nil];
     [userDefaults registerDefaults:defaultPrefs];
     if ([userDefaults boolForKey:WKNEShouldMonitorShutdowns]) {