Remove unneeded HAVE_TIMINGDATAOPTIONS
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Oct 2019 17:54:01 +0000 (17:54 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 31 Oct 2019 17:54:01 +0000 (17:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202990

Reviewed by Brady Eidson.

Source/WebCore:

This macro allowed us to adopt CFNetwork SPI, but now that the SPI is available everywhere we support, we don't need it.

* platform/network/NetworkLoadMetrics.h:
* platform/network/cocoa/NetworkLoadMetrics.mm:
(WebCore::copyTimingData):
(WebCore::setCollectsTimingData): Deleted.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection):

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):

Source/WTF:

* wtf/Platform.h:

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

Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/platform/network/NetworkLoadMetrics.h
Source/WebCore/platform/network/cocoa/NetworkLoadMetrics.mm
Source/WebCore/platform/network/mac/ResourceHandleMac.mm
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm

index 9cb7e0e..a990e64 100644 (file)
@@ -1,3 +1,12 @@
+2019-10-31  Alex Christensen  <achristensen@webkit.org>
+
+        Remove unneeded HAVE_TIMINGDATAOPTIONS
+        https://bugs.webkit.org/show_bug.cgi?id=202990
+
+        Reviewed by Brady Eidson.
+
+        * wtf/Platform.h:
+
 2019-10-31  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [JSC] DateMath should have TimeClipped version
index b7027ec..8d56e7c 100644 (file)
 #endif
 
 #if PLATFORM(COCOA)
-#define HAVE_TIMINGDATAOPTIONS 1
-#endif
-
-#if PLATFORM(COCOA)
 #define USE_AUDIO_SESSION 1
 #endif
 
index 1315cbf..fcb4407 100644 (file)
@@ -1,5 +1,21 @@
 2019-10-31  Alex Christensen  <achristensen@webkit.org>
 
+        Remove unneeded HAVE_TIMINGDATAOPTIONS
+        https://bugs.webkit.org/show_bug.cgi?id=202990
+
+        Reviewed by Brady Eidson.
+
+        This macro allowed us to adopt CFNetwork SPI, but now that the SPI is available everywhere we support, we don't need it.
+
+        * platform/network/NetworkLoadMetrics.h:
+        * platform/network/cocoa/NetworkLoadMetrics.mm:
+        (WebCore::copyTimingData):
+        (WebCore::setCollectsTimingData): Deleted.
+        * platform/network/mac/ResourceHandleMac.mm:
+        (WebCore::ResourceHandle::createNSURLConnection):
+
+2019-10-31  Alex Christensen  <achristensen@webkit.org>
+
         Use SecurityOriginData in NetworkProcess where possible without other changes
         https://bugs.webkit.org/show_bug.cgi?id=203615
 
index 03c18b6..ea7f88e 100644 (file)
@@ -187,10 +187,6 @@ public:
 WEBCORE_EXPORT void copyTimingData(NSDictionary *timingData, NetworkLoadMetrics&);
 #endif
 
-#if PLATFORM(COCOA) && !HAVE(TIMINGDATAOPTIONS)
-WEBCORE_EXPORT void setCollectsTimingData();
-#endif
-
 template<class Encoder>
 void NetworkLoadMetrics::encode(Encoder& encoder) const
 {
index 9aaec56..fbb8d68 100644 (file)
@@ -64,16 +64,5 @@ void copyTimingData(NSDictionary *timingData, NetworkLoadMetrics& timing)
 
     // NOTE: responseEnd is not populated in this code path.
 }
-
-#if !HAVE(TIMINGDATAOPTIONS)
-void setCollectsTimingData()
-{
-    static dispatch_once_t onceToken;
-    dispatch_once(&onceToken, ^{
-        [NSURLConnection _setCollectsTimingData:YES];
-        [NSURLConnection _collectTimingDataWithOptions:TimingDataCollectionNStatsOff | TimingDataCollectionConnectionDataOff];
-    });
-}
-#endif
     
 }
index dc5aedc..5bff074 100644 (file)
@@ -141,10 +141,6 @@ void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredential
 void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredentialStorage, bool shouldContentSniff, bool shouldContentEncodingSniff, SchedulingBehavior schedulingBehavior, NSDictionary *connectionProperties)
 #endif
 {
-#if !HAVE(TIMINGDATAOPTIONS)
-    setCollectsTimingData();
-#endif
-
     // Credentials for ftp can only be passed in URL, the connection:didReceiveAuthenticationChallenge: delegate call won't be made.
     if ((!d->m_user.isEmpty() || !d->m_pass.isEmpty()) && !firstRequest().url().protocolIsInHTTPFamily()) {
         URL urlWithCredentials(firstRequest().url());
@@ -217,9 +213,7 @@ void ResourceHandle::createNSURLConnection(id delegate, bool shouldUseCredential
     NSMutableDictionary *propertyDictionary = [NSMutableDictionary dictionaryWithObject:streamProperties forKey:@"kCFURLConnectionSocketStreamProperties"];
     const bool usesCache = true;
 #endif
-#if HAVE(TIMINGDATAOPTIONS)
     [propertyDictionary setObject:@{@"_kCFURLConnectionPropertyTimingDataOptions": @(_TimingDataOptionsEnableW3CNavigationTiming)} forKey:@"kCFURLConnectionURLConnectionProperties"];
-#endif
 
     // This is used to signal that to CFNetwork that this connection should be considered
     // web content for purposes of App Transport Security.
index 83451c5..868a9c6 100644 (file)
@@ -1,5 +1,15 @@
 2019-10-31  Alex Christensen  <achristensen@webkit.org>
 
+        Remove unneeded HAVE_TIMINGDATAOPTIONS
+        https://bugs.webkit.org/show_bug.cgi?id=202990
+
+        Reviewed by Brady Eidson.
+
+        * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
+        (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
+
+2019-10-31  Alex Christensen  <achristensen@webkit.org>
+
         Use SecurityOriginData in NetworkProcess where possible without other changes
         https://bugs.webkit.org/show_bug.cgi?id=203615
 
index b883d9c..29c5cb9 100644 (file)
@@ -1034,11 +1034,7 @@ NetworkSessionCocoa::NetworkSessionCocoa(NetworkProcess& networkProcess, Network
     networkProcess.supplement<LegacyCustomProtocolManager>()->registerProtocolClass(configuration);
 #endif
 
-#if HAVE(TIMINGDATAOPTIONS)
     configuration._timingDataOptions = _TimingDataOptionsEnableW3CNavigationTiming;
-#else
-    setCollectsTimingData();
-#endif
 
 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400) || PLATFORM(IOS_FAMILY)
     // FIXME: Replace @"kCFStreamPropertyAutoErrorOnSystemChange" with a constant from the SDK once rdar://problem/40650244 is in a build.