Skip to content

Commit

Permalink
Alpha build 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Benedict committed Apr 9, 2023
1 parent d4fb01e commit 1f41feb
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Source/CyberCore/PAL/pal/spi/cf/CFNetworkSPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ CF_ENUM(CFHTTPCookieStorageAcceptPolicy)
CFHTTPCookieStorageAcceptPolicyExclusivelyFromMainDocumentDomain = 3,
};

#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE)
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
typedef enum {
nw_connection_privacy_stance_unknown = 0,
nw_connection_privacy_stance_not_eligible = 1,
Expand Down Expand Up @@ -220,7 +220,7 @@ typedef enum {
- (BOOL)_schemeWasUpgradedDueToDynamicHSTS;
- (BOOL)_preventHSTSStorage;
- (BOOL)_ignoreHSTS;
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE)
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
@property (setter=_setPrivacyProxyFailClosed:) BOOL _privacyProxyFailClosed;
#endif
@end
Expand Down Expand Up @@ -280,7 +280,7 @@ typedef NS_ENUM(NSInteger, NSURLSessionCompanionProxyPreference) {
@property (readwrite, assign) BOOL _allowsHTTP3;
#endif
@property (nullable, retain) _NSHSTSStorage *_hstsStorage;
#if HAVE(NETWORK_LOADER)
#if HAVE(NETWORK_LOADER) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
@property BOOL _usesNWLoader;
#endif
#if HAVE(CFNETWORK_NSURLSESSION_CONNECTION_CACHE_LIMITS)
Expand Down Expand Up @@ -321,7 +321,7 @@ typedef NS_ENUM(NSInteger, NSURLSessionCompanionProxyPreference) {
@property (assign, readonly) NSInteger _responseHeaderBytesReceived;
@property (assign, readonly) int64_t _responseBodyBytesReceived;
@property (assign, readonly) int64_t _responseBodyBytesDecoded;
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE)
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
@property (assign, readonly) nw_connection_privacy_stance_t _privacyStance;
#endif
@end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ - (instancetype)_initWithMetrics:(CyberCore::NetworkLoadMetrics&&)metrics;
@property (readonly, getter=isExpensive) BOOL expensive;
@property (readonly, getter=isConstrained) BOOL constrained;
@property (readonly, getter=isMultipath) BOOL multipath;
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE)
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
@property (assign, readonly) nw_connection_privacy_stance_t _privacyStance;
#endif
@end
Expand Down Expand Up @@ -166,7 +166,7 @@ - (BOOL)isReusedConnection
return _metrics.isReusedConnection;
}

#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE)
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
@dynamic _privacyStance;
- (nw_connection_privacy_stance_t)_privacyStance
{
Expand Down
10 changes: 5 additions & 5 deletions Source/CyberKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ static NSURLSessionAuthChallengeDisposition toNSURLSessionAuthChallengeDispositi
return CyberCore::NetworkLoadPriority::Medium;
}

#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE)
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
static CyberCore::PrivacyStance toPrivacyStance(nw_connection_privacy_stance_t stance)
{
switch (stance) {
Expand Down Expand Up @@ -875,7 +875,7 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didComp
NSMutableDictionary *newUserInfo = oldUserInfo ? [NSMutableDictionary dictionaryWithDictionary:oldUserInfo] : [NSMutableDictionary dictionary];
newUserInfo[@"networkTaskDescription"] = [task description];
if (RefPtr networkDataTask = [self existingTask:task]) {
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE)
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
newUserInfo[@"networkTaskMetricsPrivacyStance"] = privacyStanceToString(networkDataTask->networkLoadMetrics().privacyStance);
#endif
#if HAVE(NETWORK_RESOLUTION_FAILURE_REPORT) && defined(NW_CONNECTION_HAS_FAILED_RESOLUTION_REPORT)
Expand Down Expand Up @@ -958,7 +958,7 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didFini
networkLoadMetrics.multipath = m.multipath;
networkLoadMetrics.isReusedConnection = m.isReusedConnection;

#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE)
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
networkLoadMetrics.privacyStance = toPrivacyStance(m._privacyStance);
#endif

Expand Down Expand Up @@ -1054,7 +1054,7 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data
NSURLSessionTaskMetrics *taskMetrics = dataTask._incompleteTaskMetrics;

NSURLSessionTaskTransactionMetrics *metrics = taskMetrics.transactionMetrics.lastObject;
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE)
#if HAVE(NETWORK_CONNECTION_PRIVACY_STANCE) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
auto privateRelayed = metrics._privacyStance == nw_connection_privacy_stance_direct
|| metrics._privacyStance == nw_connection_privacy_stance_not_eligible
? PrivateRelayed::No : PrivateRelayed::Yes;
Expand Down Expand Up @@ -1388,7 +1388,7 @@ static void activateSessionCleanup(NetworkSessionCocoa& session, const NetworkSe
configuration.URLCredentialStorage = adoptNS([[NSURLCredentialStorage alloc] _initWithIdentifier:parameters.dataStoreIdentifier->toString() private:NO]).get();
#endif

#if HAVE(NETWORK_LOADER)
#if HAVE(NETWORK_LOADER) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
RELEASE_LOG_IF(parameters.useNetworkLoader, NetworkSession, "Using experimental network loader.");
configuration._usesNWLoader = parameters.useNetworkLoader;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static bool experimentalFeatureEnabled(const String& key, bool defaultValue = fa

bool WebsiteDataStore::useNetworkLoader()
{
#if HAVE(NETWORK_LOADER)
#if HAVE(NETWORK_LOADER) && (!PLATFORM(IOS) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 150000)
return experimentalFeatureEnabled(WebPreferencesKey::cFNetworkNetworkLoaderEnabledKey());
#else
return false;
Expand Down
5 changes: 5 additions & 0 deletions script_fakesigner.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@
</array>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
<array>
<string>com.apple.diagnosticd</string>
<string>com.apple.fontservicesd</string>
</array>
<key>com.apple.security.temporary-exception.sbpl</key>
<array>
<string>(allow mach-issue-extension (require-all (extension-class &quot;com.apple.webkit.extension.mach&quot;)))</string>
Expand Down

0 comments on commit 1f41feb

Please sign in to comment.