Fix the build with newer clang and other custom configuration options
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 May 2016 23:16:50 +0000 (23:16 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 28 May 2016 23:16:50 +0000 (23:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=158161

Reviewed by Dan Bernstein.

Source/WebCore:

* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::rateChanged): Added UNUSED_PARAMs for the
case where this function is unimplemented.
(WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback): Added a non-additions
version of this function.
* platform/spi/cf/CFNetworkSPI.h: Silence nullability-completeness (and other) warnings.
I doubt that it's practical to get these right for every SDK version at this time. Added
functions for overriding HTTPS certicate behavior that we used to declare in .m files.
* platform/spi/mac/AVFoundationSPI.h: Define AVAssetCache conditionally.

Source/WebKit2:

* NetworkProcess/ios/NetworkProcessIOS.mm: -setAllowsSpecificHTTPSCertificate:forHost:
is now in CFNetworkSPI.h
* NetworkProcess/mac/NetworkProcessMac.mm: Ditto.
* Shared/mac/CookieStorageShimLibrary.cpp:
(WebKit::WebKitCookieStorageShimInitialize): Use more portable std::call_once.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm
Source/WebCore/platform/spi/cf/CFNetworkSPI.h
Source/WebCore/platform/spi/mac/AVFoundationSPI.h
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/ios/NetworkProcessIOS.mm
Source/WebKit2/NetworkProcess/mac/NetworkProcessMac.mm
Source/WebKit2/Shared/mac/CookieStorageShimLibrary.cpp

index 429e4b8..0bb12d3 100644 (file)
@@ -1,3 +1,20 @@
+2016-05-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Fix the build with newer clang and other custom configuration options
+        https://bugs.webkit.org/show_bug.cgi?id=158161
+
+        Reviewed by Dan Bernstein.
+
+        * platform/mac/WebVideoFullscreenInterfaceMac.mm:
+        (WebCore::WebVideoFullscreenInterfaceMac::rateChanged): Added UNUSED_PARAMs for the
+        case where this function is unimplemented.
+        (WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback): Added a non-additions
+        version of this function.
+        * platform/spi/cf/CFNetworkSPI.h: Silence nullability-completeness (and other) warnings.
+        I doubt that it's practical to get these right for every SDK version at this time. Added
+        functions for overriding HTTPS certicate behavior that we used to declare in .m files.
+        * platform/spi/mac/AVFoundationSPI.h: Define AVAssetCache conditionally.
+
 2016-05-28  Ryosuke Niwa  <rniwa@webkit.org>
 
         Autocorrection makes it hard to type "doesn't" and to type @ in email addresses
index 80cffd1..fd19f01 100644 (file)
@@ -111,6 +111,9 @@ void WebVideoFullscreenInterfaceMac::rateChanged(bool isPlaying, float playbackR
 {
 #if USE(APPLE_INTERNAL_SDK)
     [videoFullscreenInterfaceObjC() updateIsPlaying:isPlaying newPlaybackRate:playbackRate];
+#else
+    UNUSED_PARAM(isPlaying);
+    UNUSED_PARAM(playbackRate);
 #endif
 }
 
@@ -172,6 +175,10 @@ bool WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() const
     return false;
 }
 
+void WebVideoFullscreenInterfaceMac::setExternalPlayback(bool, ExternalPlaybackTargetType, String)
+{
+}
+
 bool supportsPictureInPicture()
 {
     return false;
index e062fed..8036b2b 100644 (file)
@@ -23,6 +23,8 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#pragma clang system_header
+
 #ifndef CFNetworkSPI_h
 #define CFNetworkSPI_h
 
@@ -85,6 +87,8 @@ typedef void (^CFCachedURLResponseCallBackBlock)(CFCachedURLResponseRef);
 
 #if defined(__OBJC__)
 @interface NSURLRequest ()
++ (NSArray *)allowsSpecificHTTPSCertificateForHost:(NSString *)host;
++ (void)setAllowsSpecificHTTPSCertificate:(NSArray *)allow forHost:(NSString *)host;
 - (void)_setProperty:(id)value forKey:(NSString *)key;
 @end
 
index 98de9d0..8f3f10a 100644 (file)
@@ -58,8 +58,14 @@ NS_ASSUME_NONNULL_END
 #if USE(APPLE_INTERNAL_SDK)
 #import <AVFoundation/AVAssetCache_Private.h>
 #else
-NS_ASSUME_NONNULL_BEGIN
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000)
+#import <AVFoundation/AVAssetCache.h>
+#else
 @interface AVAssetCache : NSObject
+@end
+#endif
+NS_ASSUME_NONNULL_BEGIN
+@interface AVAssetCache ()
 + (AVAssetCache *)assetCacheWithURL:(NSURL *)URL;
 - (id)initWithURL:(NSURL *)URL;
 - (NSArray *)allKeys;
index 714cbcc..f60bb9f 100644 (file)
@@ -1,3 +1,16 @@
+2016-05-28  Alexey Proskuryakov  <ap@apple.com>
+
+        Fix the build with newer clang and other custom configuration options
+        https://bugs.webkit.org/show_bug.cgi?id=158161
+
+        Reviewed by Dan Bernstein.
+
+        * NetworkProcess/ios/NetworkProcessIOS.mm: -setAllowsSpecificHTTPSCertificate:forHost:
+        is now in CFNetworkSPI.h
+        * NetworkProcess/mac/NetworkProcessMac.mm: Ditto.
+        * Shared/mac/CookieStorageShimLibrary.cpp:
+        (WebKit::WebKitCookieStorageShimInitialize): Use more portable std::call_once.
+
 2016-05-28  Chris Dumez  <cdumez@apple.com>
 
         Modernize lambda captures in the network disk cache implementation
index bd04828..b5b702f 100644 (file)
 #import "ResourceCachesToClear.h"
 #import "SandboxInitializationParameters.h"
 #import "SecItemShim.h"
+#import <WebCore/CFNetworkSPI.h>
 #import <WebCore/CertificateInfo.h>
 #import <WebCore/NotImplemented.h>
 #import <WebCore/WebCoreThreadSystemInterface.h>
 
 #define ENABLE_MANUAL_NETWORK_SANDBOXING 0
 
-@interface NSURLRequest (WKDetails)
-+ (void)setAllowsSpecificHTTPSCertificate:(NSArray *)certificateChain forHost:(NSString *)host;
-@end
-
 using namespace WebCore;
 
 namespace WebKit {
index dd579a5..27cef56 100644 (file)
 
 using namespace WebCore;
 
-@interface NSURLRequest (Details) 
-+ (void)setAllowsSpecificHTTPSCertificate:(NSArray *)allow forHost:(NSString *)host;
-@end
-
 namespace WebKit {
 
 void NetworkProcess::initializeProcess(const ChildProcessInitializationParameters&)
index df7f896..40bcf14 100644 (file)
@@ -29,6 +29,7 @@
 #if !PLATFORM(IOS)
 
 #include <WebCore/DynamicLinkerInterposing.h>
+#include <mutex>
 
 extern "C" CFDictionaryRef _CFHTTPCookieStorageCopyRequestHeaderFieldsForURL(CFAllocatorRef inAllocator, CFHTTPCookieStorageRef inCookieStorage, CFURLRef inRequestURL);
 
@@ -80,12 +81,8 @@ void WebKitCookieStorageShimInitialize(const CookieStorageShimCallbacks& callbac
 {
     // Because the value of cookieStorageShimCallbacks will be read from mulitple threads,
     // only allow it to be initialized once.
-    static int initialized = 0;
-    if (!OSAtomicCompareAndSwapInt(0, 1, &initialized)) {
-        return;
-    }
-
-    cookieStorageShimCallbacks = callbacks;
+    static std::once_flag initializeCallbacksOnceFlag;
+    std::call_once(initializeCallbacksOnceFlag, [&callbacks] { cookieStorageShimCallbacks = callbacks; });
 }
     
 }