Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(569)

Unified Diff: webrtc/examples/objc/AppRTCDemo/ARDAppClient.m

Issue 1650993004: Add iOS tracing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Update comment Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/objc/RTCTracing.mm ('k') | webrtc/examples/objc/AppRTCDemo/ios/ARDAppDelegate.m » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/objc/AppRTCDemo/ARDAppClient.m
diff --git a/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m b/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m
index 33e00ed443e346daf820d3710b02e77acbec5f27..47252bef1dbc4a9483f6687ac894976910160249 100644
--- a/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m
+++ b/webrtc/examples/objc/AppRTCDemo/ARDAppClient.m
@@ -11,6 +11,7 @@
#import "ARDAppClient+Internal.h"
#if defined(WEBRTC_IOS)
+#import "webrtc/base/objc/RTCTracing.h"
#import "RTCAVFoundationVideoSource.h"
#endif
#import "RTCFileLogger.h"
@@ -48,6 +49,12 @@ static NSInteger const kARDAppClientErrorSetSDP = -4;
static NSInteger const kARDAppClientErrorInvalidClient = -5;
static NSInteger const kARDAppClientErrorInvalidRoom = -6;
+// TODO(tkchin): Remove guard once rtc_base_objc compiles on Mac.
+#if defined(WEBRTC_IOS)
+// TODO(tkchin): Add this as a UI option.
+static BOOL const kARDAppClientEnableTracing = NO;
+#endif
+
// We need a proxy to NSTimer because it causes a strong retain cycle. When
// using the proxy, |invalidate| must be called before it properly deallocs.
@interface ARDTimerProxy : NSObject
@@ -209,6 +216,17 @@ static NSInteger const kARDAppClientErrorInvalidRoom = -6;
_isAudioOnly = isAudioOnly;
self.state = kARDAppClientStateConnecting;
+#if defined(WEBRTC_IOS)
+ if (kARDAppClientEnableTracing) {
+ NSArray *paths = NSSearchPathForDirectoriesInDomains(
+ NSDocumentDirectory, NSUserDomainMask, YES);
+ NSString *documentsDirPath = paths.firstObject;
+ NSString *filePath =
+ [documentsDirPath stringByAppendingPathComponent:@"webrtc-trace.txt"];
+ RTCStartInternalCapture(filePath);
+ }
+#endif
+
// Request TURN.
__weak ARDAppClient *weakSelf = self;
[_turnClient requestServersWithCompletionHandler:^(NSArray *turnServers,
@@ -285,6 +303,9 @@ static NSInteger const kARDAppClientErrorInvalidRoom = -6;
_messageQueue = [NSMutableArray array];
_peerConnection = nil;
self.state = kARDAppClientStateDisconnected;
+#if defined(WEBRTC_IOS)
+ RTCStopInternalCapture();
+#endif
}
#pragma mark - ARDSignalingChannelDelegate
« no previous file with comments | « webrtc/base/objc/RTCTracing.mm ('k') | webrtc/examples/objc/AppRTCDemo/ios/ARDAppDelegate.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698