Skip to content

Commit 0515c06

Browse files
committed
Convert dispatch queue wrapper to Swift
1 parent d38165b commit 0515c06

File tree

53 files changed

+31
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+31
-203
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,8 @@
568568
7BD86ECD264A78A6005439DB /* SentryAppStartTrackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BD86ECC264A78A6005439DB /* SentryAppStartTrackerTests.swift */; };
569569
7BD86ECF264A7C77005439DB /* SentryAppStartMeasurement.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BD86ECE264A7C77005439DB /* SentryAppStartMeasurement.h */; settings = {ATTRIBUTES = (Private, ); }; };
570570
7BD86ED1264A7CF6005439DB /* SentryAppStartMeasurement.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BD86ED0264A7CF6005439DB /* SentryAppStartMeasurement.m */; };
571-
7BDB03B7251364F800BAE198 /* SentryDispatchQueueWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BDB03B6251364F800BAE198 /* SentryDispatchQueueWrapper.h */; };
572-
7BDB03BB2513652900BAE198 /* SentryDispatchQueueWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BDB03BA2513652900BAE198 /* SentryDispatchQueueWrapper.m */; };
571+
7BDB03B7251364F800BAE198 /* _SentryDispatchQueueWrapperInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BDB03B6251364F800BAE198 /* _SentryDispatchQueueWrapperInternal.h */; };
572+
7BDB03BB2513652900BAE198 /* _SentryDispatchQueueWrapperInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = 7BDB03BA2513652900BAE198 /* _SentryDispatchQueueWrapperInternal.m */; };
573573
7BDDE3CC2966BD4700EB9177 /* SentryMXManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BDDE3CB2966BD4700EB9177 /* SentryMXManagerTests.swift */; };
574574
7BDEAA022632A4580001EA25 /* SentryOptions+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BDEAA002632A4580001EA25 /* SentryOptions+Private.h */; settings = {ATTRIBUTES = (Private, ); }; };
575575
7BE0DC29272A9E1C004FA8B7 /* SentryBreadcrumbTrackerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7BE0DC28272A9E1C004FA8B7 /* SentryBreadcrumbTrackerTests.swift */; };
@@ -1069,6 +1069,7 @@
10691069
FA7206E12E0B37C80072FDD4 /* SentryProfileCollector.mm in Sources */ = {isa = PBXBuildFile; fileRef = FA7206E02E0B37C60072FDD4 /* SentryProfileCollector.mm */; };
10701070
FA8A36182DEAA1EB0058D883 /* SentryThread+Private.h in Headers */ = {isa = PBXBuildFile; fileRef = FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */; };
10711071
FA90FAA82E06614E008CAAE8 /* SentryExtraPackages.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA90FAA72E06614B008CAAE8 /* SentryExtraPackages.swift */; };
1072+
FA8E58F12E0AD4270049F69D /* SentryDispatchQueueWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA8E58F02E0AD4220049F69D /* SentryDispatchQueueWrapper.swift */; };
10721073
FA90FAFD2E070A3B008CAAE8 /* SentryURLRequestFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA90FAFC2E070A3B008CAAE8 /* SentryURLRequestFactory.swift */; };
10731074
FAB359982E05D7E90083D5E3 /* SentryEventSwiftHelper.h in Headers */ = {isa = PBXBuildFile; fileRef = FAB359972E05D7E90083D5E3 /* SentryEventSwiftHelper.h */; };
10741075
FAB3599A2E05D8080083D5E3 /* SentryEventSwiftHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = FAB359992E05D8080083D5E3 /* SentryEventSwiftHelper.m */; };
@@ -1758,8 +1759,8 @@
17581759
7BD86ECC264A78A6005439DB /* SentryAppStartTrackerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryAppStartTrackerTests.swift; sourceTree = "<group>"; };
17591760
7BD86ECE264A7C77005439DB /* SentryAppStartMeasurement.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryAppStartMeasurement.h; path = include/HybridPublic/SentryAppStartMeasurement.h; sourceTree = "<group>"; };
17601761
7BD86ED0264A7CF6005439DB /* SentryAppStartMeasurement.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryAppStartMeasurement.m; sourceTree = "<group>"; };
1761-
7BDB03B6251364F800BAE198 /* SentryDispatchQueueWrapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryDispatchQueueWrapper.h; path = include/SentryDispatchQueueWrapper.h; sourceTree = "<group>"; };
1762-
7BDB03BA2513652900BAE198 /* SentryDispatchQueueWrapper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryDispatchQueueWrapper.m; sourceTree = "<group>"; };
1762+
7BDB03B6251364F800BAE198 /* _SentryDispatchQueueWrapperInternal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = _SentryDispatchQueueWrapperInternal.h; path = include/_SentryDispatchQueueWrapperInternal.h; sourceTree = "<group>"; };
1763+
7BDB03BA2513652900BAE198 /* _SentryDispatchQueueWrapperInternal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = _SentryDispatchQueueWrapperInternal.m; sourceTree = "<group>"; };
17631764
7BDB03BE25136A7D00BAE198 /* TestSentryDispatchQueueWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestSentryDispatchQueueWrapper.swift; sourceTree = "<group>"; };
17641765
7BDDE3CB2966BD4700EB9177 /* SentryMXManagerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryMXManagerTests.swift; sourceTree = "<group>"; };
17651766
7BDEAA002632A4580001EA25 /* SentryOptions+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryOptions+Private.h"; path = "include/SentryOptions+Private.h"; sourceTree = "<group>"; };
@@ -2321,6 +2322,7 @@
23212322
FA7206E02E0B37C60072FDD4 /* SentryProfileCollector.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryProfileCollector.mm; sourceTree = "<group>"; };
23222323
FA8A36172DEAA1EB0058D883 /* SentryThread+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SentryThread+Private.h"; path = "include/SentryThread+Private.h"; sourceTree = "<group>"; };
23232324
FA90FAA72E06614B008CAAE8 /* SentryExtraPackages.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryExtraPackages.swift; sourceTree = "<group>"; };
2325+
FA8E58F02E0AD4220049F69D /* SentryDispatchQueueWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryDispatchQueueWrapper.swift; sourceTree = "<group>"; };
23242326
FA90FAFC2E070A3B008CAAE8 /* SentryURLRequestFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryURLRequestFactory.swift; sourceTree = "<group>"; };
23252327
FAB359972E05D7E90083D5E3 /* SentryEventSwiftHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryEventSwiftHelper.h; path = include/SentryEventSwiftHelper.h; sourceTree = "<group>"; };
23262328
FAB359992E05D8080083D5E3 /* SentryEventSwiftHelper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryEventSwiftHelper.m; sourceTree = "<group>"; };
@@ -2459,6 +2461,7 @@
24592461
isa = PBXGroup;
24602462
children = (
24612463
FA6FC0A22E0B5AC800ED2669 /* SentrySdkPackage.swift */,
2464+
FA8E58F02E0AD4220049F69D /* SentryDispatchQueueWrapper.swift */,
24622465
84B0E0062CD963F9007FB332 /* SentryIconography.swift */,
24632466
621F61F02BEA073A005E654F /* SentryEnabledFeaturesBuilder.swift */,
24642467
);
@@ -2514,8 +2517,8 @@
25142517
638DC99E1EBC6B6400A66E41 /* SentryRequestOperation.h */,
25152518
638DC99F1EBC6B6400A66E41 /* SentryRequestOperation.m */,
25162519
D4291A672DD61A3F00772088 /* SentryDispatchQueueProviderProtocol.h */,
2517-
7BDB03B6251364F800BAE198 /* SentryDispatchQueueWrapper.h */,
2518-
7BDB03BA2513652900BAE198 /* SentryDispatchQueueWrapper.m */,
2520+
7BDB03B6251364F800BAE198 /* _SentryDispatchQueueWrapperInternal.h */,
2521+
7BDB03BA2513652900BAE198 /* _SentryDispatchQueueWrapperInternal.m */,
25192522
D4FC68162DD632E7001B74FF /* SentryDispatchSourceProviderProtocol.h */,
25202523
84AC61D129F7541E009EEF61 /* SentryDispatchSourceWrapper.m */,
25212524
84AC61D029F7541E009EEF61 /* SentryDispatchSourceWrapper.h */,
@@ -4809,7 +4812,7 @@
48094812
7B2BB0032966F55900A1E102 /* SentryOptions+HybridSDKs.h in Headers */,
48104813
7BF9EF762722B34700B5BBEF /* SentrySubClassFinder.h in Headers */,
48114814
7BC852332458802C005A70F0 /* SentryDataCategoryMapper.h in Headers */,
4812-
7BDB03B7251364F800BAE198 /* SentryDispatchQueueWrapper.h in Headers */,
4815+
7BDB03B7251364F800BAE198 /* _SentryDispatchQueueWrapperInternal.h in Headers */,
48134816
7BF9EF842722D07B00B5BBEF /* SentryObjCRuntimeWrapper.h in Headers */,
48144817
621AE74B2C626C230012E730 /* SentryANRTrackerV2.h in Headers */,
48154818
639889B71EDECFA800EA7442 /* SentryBreadcrumbTracker.h in Headers */,
@@ -5273,7 +5276,7 @@
52735276
7BD4BD4527EB29F50071F4FF /* SentryClientReport.m in Sources */,
52745277
631E6D341EBC679C00712345 /* SentryQueueableRequestManager.m in Sources */,
52755278
7B8713B426415BAA006D6004 /* SentryAppStartTracker.m in Sources */,
5276-
7BDB03BB2513652900BAE198 /* SentryDispatchQueueWrapper.m in Sources */,
5279+
7BDB03BB2513652900BAE198 /* _SentryDispatchQueueWrapperInternal.m in Sources */,
52775280
FA6FC0A32E0B5ACE00ED2669 /* SentrySdkPackage.swift in Sources */,
52785281
D8739D142BEE5049007D2F66 /* SentryRRWebSpanEvent.swift in Sources */,
52795282
7B6C5EDE264E8DF00010D138 /* SentryFramesTracker.m in Sources */,
@@ -5587,6 +5590,7 @@
55875590
D859697327BECDD20036A46E /* SentryCoreDataSwizzling.m in Sources */,
55885591
639889BD1EDED18400EA7442 /* SentrySwizzle.m in Sources */,
55895592
8453421228BE855D00C22EEC /* SentrySampleDecision.m in Sources */,
5593+
FA8E58F12E0AD4270049F69D /* SentryDispatchQueueWrapper.swift in Sources */,
55905594
7B7D872E2486482600D2ECFF /* SentryStacktraceBuilder.m in Sources */,
55915595
861265FA2404EC1500C4AFDE /* NSArray+SentrySanitize.m in Sources */,
55925596
D802994E2BA836EF000F0081 /* SentryOnDemandReplay.swift in Sources */,

SentryTestUtils/TestDispatchFactory.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import _SentryPrivate
22
import Foundation
3+
@testable import Sentry
34

4-
public class TestDispatchFactory: SentryDispatchFactory {
5+
@_spi(Private) public class TestDispatchFactory: SentryDispatchFactory {
56
public var vendedSourceHandler: ((TestDispatchSourceWrapper) -> Void)?
67
public var vendedQueueHandler: ((TestSentryDispatchQueueWrapper) -> Void)?
78

SentryTestUtils/TestSentryDispatchQueueWrapper.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import _SentryPrivate
22
import Foundation
3-
@testable import Sentry
3+
@_spi(Private) @testable import Sentry
44

55
/// A wrapper around `SentryDispatchQueueWrapper` that memoized invocations to its methods and allows customization of async logic, specifically: dispatch-after calls can be made to run immediately, or not at all.
6-
public class TestSentryDispatchQueueWrapper: SentryDispatchQueueWrapper {
6+
@_spi(Private) public class TestSentryDispatchQueueWrapper: SentryDispatchQueueWrapper {
77

88
private let dispatchAsyncLock = NSLock()
99

SentryTestUtilsTests/TestDispatchFactoryTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@testable import Sentry
12
@testable import SentryTestUtils
23
import XCTest
34

Sources/Sentry/Profiling/SentryContinuousProfiler.mm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#if SENTRY_TARGET_PROFILING_SUPPORTED
44

55
# import "SentryDependencyContainer.h"
6-
# import "SentryDispatchQueueWrapper.h"
76
# import "SentryLog.h"
87
# import "SentryMetricProfiler.h"
98
# import "SentryNSNotificationCenterWrapper.h"

Sources/Sentry/Profiling/SentryLaunchProfiling.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
# import "SentryContinuousProfiler.h"
66
# import "SentryDependencyContainer.h"
7-
# import "SentryDispatchQueueWrapper.h"
87
# import "SentryFileManager.h"
98
# import "SentryInternalDefines.h"
109
# import "SentryLaunchProfiling.h"

Sources/Sentry/Profiling/SentryProfiledTracerConcurrency.mm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
# include <mutex>
1212

1313
# import "SentryDependencyContainer.h"
14-
# import "SentryDispatchQueueWrapper.h"
1514
# import "SentryEvent+Private.h"
1615
# import "SentryHub+Private.h"
1716
# import "SentryInternalDefines.h"

Sources/Sentry/Profiling/SentryProfilerState.mm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# import "SentryAsyncSafeLog.h"
44
# import "SentryBacktrace.hpp"
55
# import "SentryDependencyContainer.h"
6-
# import "SentryDispatchQueueWrapper.h"
76
# import "SentryFormatter.h"
87
# import "SentryProfileTimeseries.h"
98
# import "SentrySample.h"

Sources/Sentry/Profiling/SentryTraceProfiler.mm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#if SENTRY_TARGET_PROFILING_SUPPORTED
44

55
# import "SentryDependencyContainer.h"
6-
# import "SentryDispatchQueueWrapper.h"
76
# import "SentryLog.h"
87
# import "SentryMetricProfiler.h"
98
# import "SentryNSTimerFactory.h"

Sources/Sentry/SentryANRTrackerV1.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#import "SentryANRTrackerV1.h"
22
#import "SentryCrashWrapper.h"
33
#import "SentryDependencyContainer.h"
4-
#import "SentryDispatchQueueWrapper.h"
54
#import "SentryLog.h"
65
#import "SentrySwift.h"
76
#import "SentryThreadWrapper.h"

0 commit comments

Comments
 (0)