Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Removes unused code and makes some other code platform specific #419

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 0 additions & 55 deletions Sources/NetworkProtection/IPC/IPCThroughCFMessagePort.swift

This file was deleted.

52 changes: 0 additions & 52 deletions Sources/NetworkProtection/IPC/IPCThroughCFMessagePortClient.swift

This file was deleted.

86 changes: 0 additions & 86 deletions Sources/NetworkProtection/IPC/IPCThroughCFMessagePortServer.swift

This file was deleted.

75 changes: 0 additions & 75 deletions Sources/NetworkProtection/IPC/StatusServiceClient.swift

This file was deleted.

60 changes: 0 additions & 60 deletions Sources/NetworkProtection/IPC/StatusServiceServer.swift

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// limitations under the License.
//

#if os(macOS)

import Foundation

/// JSONEncoder encrypts its output encoded as UTF8. This is just a convenience constant to make sure we're using
Expand Down Expand Up @@ -76,3 +78,5 @@ public struct DistributedNotificationObjectDecoder<T: Decodable> {
return object
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ import Common

#if os(macOS)

fileprivate extension Bundle {
private static let networkProtectionDistributedNotificationPrefixKey = "DISTRIBUTED_NOTIFICATIONS_PREFIX"

var networkProtectionDistributedNotificationPrefix: String {
guard let bundleID = object(forInfoDictionaryKey: Self.networkProtectionDistributedNotificationPrefixKey) as? String else {
fatalError("Info.plist is missing \(Self.networkProtectionDistributedNotificationPrefixKey)")
}

return bundleID
}
}

extension DistributedNotificationCenter {
// MARK: - Logging

Expand All @@ -42,20 +54,6 @@ extension DistributedNotificationCenter: NetworkProtectionNotificationPosting {
}
}

#endif

fileprivate extension Bundle {
private static let networkProtectionDistributedNotificationPrefixKey = "DISTRIBUTED_NOTIFICATIONS_PREFIX"

var networkProtectionDistributedNotificationPrefix: String {
guard let bundleID = object(forInfoDictionaryKey: Self.networkProtectionDistributedNotificationPrefixKey) as? String else {
fatalError("Info.plist is missing \(Self.networkProtectionDistributedNotificationPrefixKey)")
}

return bundleID
}
}

public protocol NetworkProtectionNotificationPosting: AnyObject {
func post(_ networkProtectionNotification: NetworkProtectionNotification, object: String?, log: OSLog)
}
Expand Down Expand Up @@ -114,3 +112,5 @@ public enum NetworkProtectionNotification: String {
"\(Bundle.main.networkProtectionDistributedNotificationPrefix).\(notificationName)"
}
}

#endif
Loading