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

Unified Diff: talk/app/webrtc/objc/public/RTCFileLogger.h

Issue 1217473011: AppRTCDemo file logging. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 6 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
Index: talk/app/webrtc/objc/public/RTCFileLogger.h
diff --git a/talk/examples/objc/AppRTCDemo/ARDSDPUtils.h b/talk/app/webrtc/objc/public/RTCFileLogger.h
similarity index 62%
copy from talk/examples/objc/AppRTCDemo/ARDSDPUtils.h
copy to talk/app/webrtc/objc/public/RTCFileLogger.h
index 2f14e6dec0b40b77b1f6d03be0ef639387b4d0db..59c52052c54621f54a5fb19aca69eb3addfceeec 100644
--- a/talk/examples/objc/AppRTCDemo/ARDSDPUtils.h
+++ b/talk/app/webrtc/objc/public/RTCFileLogger.h
@@ -27,15 +27,31 @@
#import <Foundation/Foundation.h>
-@class RTCSessionDescription;
+// TODO(tkchin): Move this to a common location.
+#ifndef NS_DESIGNATED_INITIALIZER
+#define NS_DESIGNATED_INITIALIZER
+#endif
-@interface ARDSDPUtils : NSObject
+// This class intercepts WebRTC logs and saves them to a file. The file size
+// will not exceed the given maximum bytesize. When the maximum bytesize is
+// reached logs from the beginning and the end are preserved while the middle
+// section is overwritten instead.
+@interface RTCFileLogger : NSObject
-// Updates the original SDP description to instead prefer the specified video
-// codec. We do this by placing the specified codec at the beginning of the
-// codec list if it exists in the sdp.
-+ (RTCSessionDescription *)
- descriptionForDescription:(RTCSessionDescription *)description
- preferredVideoCodec:(NSString *)codec;
+// Default constructor provides default settings for file path and file size.
+- (instancetype)init;
+
+- (instancetype)initWithFilePath:(NSString *)filePath
+ maxFileSize:(NSUInteger)maxFileSize NS_DESIGNATED_INITIALIZER;
+
+// Starts writing WebRTC logs to file if not already started. Overwrites any
+// existing file.
+- (void)start;
+
+// Stops writing WebRTC logs to file.
+- (void)stop;
+
+// Returns the contents of the written log file.
+- (NSString *)log;
@end

Powered by Google App Engine
This is Rietveld 408576698