Skip to content

Commit 61414e8

Browse files
authored
ref: Move last round of types to spi (#5518)
* ref: Move last round of types to spi * Fix build
1 parent fc6557e commit 61414e8

File tree

18 files changed

+57
-33
lines changed

18 files changed

+57
-33
lines changed

Sentry.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,6 @@
992992
D8C66A372A77B1F70015696A /* SentryPropagationContext.m in Sources */ = {isa = PBXBuildFile; fileRef = D8C66A352A77B1F70015696A /* SentryPropagationContext.m */; };
993993
D8C67E9B28000E24007E326E /* SentryUIApplication.h in Headers */ = {isa = PBXBuildFile; fileRef = D8C67E9928000E23007E326E /* SentryUIApplication.h */; };
994994
D8C67E9C28000E24007E326E /* SentryScreenshot.h in Headers */ = {isa = PBXBuildFile; fileRef = D8C67E9A28000E23007E326E /* SentryScreenshot.h */; };
995-
D8CA12952C203E71005894F4 /* SentrySessionListener.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8CA12942C203E71005894F4 /* SentrySessionListener.swift */; };
996995
D8CAC02E2BA0663E00E38F34 /* SentryReplayOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8CAC02A2BA0663E00E38F34 /* SentryReplayOptions.swift */; };
997996
D8CAC02F2BA0663E00E38F34 /* SentryVideoInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8CAC02B2BA0663E00E38F34 /* SentryVideoInfo.swift */; };
998997
D8CB74152947246600A5F964 /* SentryEnvelopeAttachmentHeader.h in Headers */ = {isa = PBXBuildFile; fileRef = D8CB74142947246600A5F964 /* SentryEnvelopeAttachmentHeader.h */; };
@@ -2245,7 +2244,6 @@
22452244
D8C66A352A77B1F70015696A /* SentryPropagationContext.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryPropagationContext.m; sourceTree = "<group>"; };
22462245
D8C67E9928000E23007E326E /* SentryUIApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryUIApplication.h; path = include/SentryUIApplication.h; sourceTree = "<group>"; };
22472246
D8C67E9A28000E23007E326E /* SentryScreenshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryScreenshot.h; path = include/SentryScreenshot.h; sourceTree = "<group>"; };
2248-
D8CA12942C203E71005894F4 /* SentrySessionListener.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentrySessionListener.swift; sourceTree = "<group>"; };
22492247
D8CAC02A2BA0663E00E38F34 /* SentryReplayOptions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SentryReplayOptions.swift; sourceTree = "<group>"; };
22502248
D8CAC02B2BA0663E00E38F34 /* SentryVideoInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SentryVideoInfo.swift; sourceTree = "<group>"; };
22512249
D8CB74142947246600A5F964 /* SentryEnvelopeAttachmentHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryEnvelopeAttachmentHeader.h; path = include/SentryEnvelopeAttachmentHeader.h; sourceTree = "<group>"; };
@@ -4472,7 +4470,6 @@
44724470
isa = PBXGroup;
44734471
children = (
44744472
620078752D38F1110022CB67 /* Codable */,
4475-
D8CA12942C203E71005894F4 /* SentrySessionListener.swift */,
44764473
);
44774474
path = Protocol;
44784475
sourceTree = "<group>";
@@ -5329,7 +5326,6 @@
53295326
63FE716920DA4C1100CDBAE8 /* SentryCrashStackCursor.c in Sources */,
53305327
7BA61CCA247D128B00C130A8 /* SentryThreadInspector.m in Sources */,
53315328
623FD9042D3FA92700803EDA /* NSNumberDecodableWrapper.swift in Sources */,
5332-
D8CA12952C203E71005894F4 /* SentrySessionListener.swift in Sources */,
53335329
63FE718D20DA4C1100CDBAE8 /* SentryCrashReportStore.c in Sources */,
53345330
7BA0C0482805600A003E0326 /* SentryTransportAdapter.m in Sources */,
53355331
63FE712920DA4C1000CDBAE8 /* SentryCrashCPU_arm.c in Sources */,

SentryTestUtils/TestDisplayLinkWrapper.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Foundation
2+
@_spi(Private) import Sentry
23

34
#if os(iOS) || os(tvOS) || targetEnvironment(macCatalyst)
45

@@ -17,7 +18,7 @@ public enum FrameRate: UInt64 {
1718
}
1819
}
1920

20-
public class TestDisplayLinkWrapper: SentryDisplayLinkWrapper {
21+
@_spi(Private) public class TestDisplayLinkWrapper: SentryDisplayLinkWrapper, SentryReplayDisplayLinkWrapper {
2122
public var target: AnyObject!
2223
public var selector: Selector!
2324
public var currentFrameRate: FrameRate = .low

Sources/Sentry/SentryDependencyContainer.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
#define SENTRY_THREAD_SANITIZER_DOUBLE_CHECKED_LOCK \
8282
SENTRY_DISABLE_THREAD_SANITIZER("Double-checked locks produce false alarms.")
8383

84+
@interface SentryFileManager () <SentryFileManagerProtocol>
85+
@end
86+
8487
@interface SentryDependencyContainer ()
8588

8689
@property (nonatomic, strong) id<SentryANRTracker> anrTracker;

Sources/Sentry/SentrySessionReplayIntegration.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
static NSString *SENTRY_CURRENT_REPLAY = @"replay.current";
3333
static NSString *SENTRY_LAST_REPLAY = @"replay.last";
3434

35+
@interface SentryDisplayLinkWrapper (Replay) <SentryReplayDisplayLinkWrapper>
36+
37+
@end
38+
3539
/**
3640
* We need to use this from the swizzled block
3741
* and using an instance property would hold reference

Sources/Sentry/include/SentryHub+Private.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@
1313
@class SentryReplayEvent;
1414
@class SentryReplayRecording;
1515
@protocol SentryIntegrationProtocol;
16-
@protocol SentrySessionListener;
1716

1817
NS_ASSUME_NONNULL_BEGIN
1918

19+
@protocol SentrySessionListener
20+
21+
- (void)sentrySessionEnded:(SentrySession *)session;
22+
- (void)sentrySessionStarted:(SentrySession *)session;
23+
24+
@end
25+
2026
@interface SentryHub ()
2127

2228
@property (nullable, nonatomic, strong) SentrySession *session;

Sources/Swift/Core/Integrations/FramesTracking/SentryFramesDelayResult.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Foundation
66
public let delayDuration: CFTimeInterval
77
public let framesContributingToDelayCount: UInt
88

9-
init(delayDuration: CFTimeInterval, framesContributingToDelayCount: UInt) {
9+
public init(delayDuration: CFTimeInterval, framesContributingToDelayCount: UInt) {
1010
self.delayDuration = delayDuration
1111
self.framesContributingToDelayCount = framesContributingToDelayCount
1212
}

Sources/Swift/Core/Tools/ViewCapture/SentryViewPhotographer.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,22 @@ import UIKit
6060
}
6161

6262
@objc(addIgnoreClasses:)
63-
func addIgnoreClasses(classes: [AnyClass]) {
63+
public func addIgnoreClasses(classes: [AnyClass]) {
6464
redactBuilder.addIgnoreClasses(classes)
6565
}
6666

6767
@objc(addRedactClasses:)
68-
func addRedactClasses(classes: [AnyClass]) {
68+
public func addRedactClasses(classes: [AnyClass]) {
6969
redactBuilder.addRedactClasses(classes)
7070
}
7171

7272
@objc(setIgnoreContainerClass:)
73-
func setIgnoreContainerClass(_ containerClass: AnyClass) {
73+
public func setIgnoreContainerClass(_ containerClass: AnyClass) {
7474
redactBuilder.setIgnoreContainerClass(containerClass)
7575
}
7676

7777
@objc(setRedactContainerClass:)
78-
func setRedactContainerClass(_ containerClass: AnyClass) {
78+
public func setRedactContainerClass(_ containerClass: AnyClass) {
7979
redactBuilder.setRedactContainerClass(containerClass)
8080
}
8181

Sources/Swift/Integrations/SessionReplay/RRWeb/SentryRRWebBreadcrumbEvent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Foundation
22

33
@_spi(Private) public final class SentryRRWebBreadcrumbEvent: SentryRRWebCustomEvent {
4-
init(timestamp: Date, category: String, message: String? = nil, level: SentryLevel = .none, data: [String: Any]? = nil) {
4+
public init(timestamp: Date, category: String, message: String? = nil, level: SentryLevel = .none, data: [String: Any]? = nil) {
55

66
var payload: [String: Any] = ["type": "default", "category": category, "level": level.description, "timestamp": timestamp.timeIntervalSince1970 ]
77

Sources/Swift/Integrations/SessionReplay/RRWeb/SentryRRWebSpanEvent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Foundation
22

33
@objc @_spi(Private) public class SentryRRWebSpanEvent: SentryRRWebCustomEvent {
44

5-
init(timestamp: Date, endTimestamp: Date, operation: String, description: String, data: [String: Any]) {
5+
public init(timestamp: Date, endTimestamp: Date, operation: String, description: String, data: [String: Any]) {
66
super.init(timestamp: timestamp, tag: "performanceSpan", payload:
77
[
88
"op": operation,

Sources/Swift/Integrations/SessionReplay/SentryOnDemandReplay.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ import UIKit
7474
}
7575
}
7676

77-
@objc func addFrameAsync(timestamp: Date, maskedViewImage: UIImage, forScreen screen: String?) {
77+
@objc public func addFrameAsync(timestamp: Date, maskedViewImage: UIImage, forScreen screen: String?) {
7878
SentrySDKLog.debug("[Session Replay] Adding frame async for screen: \(screen ?? "nil")")
7979
// Dispatch the frame addition to a background queue to avoid blocking the main queue.
8080
// This must be on the processing queue to avoid deadlocks.
@@ -125,7 +125,7 @@ import UIKit
125125
return UIGraphicsGetImageFromCurrentImageContext()
126126
}
127127

128-
func releaseFramesUntil(_ date: Date) {
128+
public func releaseFramesUntil(_ date: Date) {
129129
processingQueue.dispatchAsync {
130130
SentrySDKLog.debug("[Session Replay] Releasing frames until date: \(date)")
131131
while let first = self._frames.first, first.time < date {
@@ -146,7 +146,7 @@ import UIKit
146146
return _frames.first?.time
147147
}
148148

149-
func createVideoInBackgroundWith(beginning: Date, end: Date, completion: @escaping ([SentryVideoInfo]) -> Void) {
149+
public func createVideoInBackgroundWith(beginning: Date, end: Date, completion: @escaping ([SentryVideoInfo]) -> Void) {
150150
// Note: In Swift it is best practice to use `Result<Value, Error>` instead of `(Value?, Error?)`
151151
// Due to interoperability with Objective-C and @objc, we can not use Result for the completion callback.
152152
SentrySDKLog.debug("[Session Replay] Creating video in background with beginning: \(beginning), end: \(end)")

0 commit comments

Comments
 (0)