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

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

Issue 1972483002: Pass around the candidate removals events in IOS clients Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Merge with head Created 4 years, 7 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: webrtc/examples/objc/AppRTCDemo/ARDSignalingMessage.m
diff --git a/webrtc/examples/objc/AppRTCDemo/ARDSignalingMessage.m b/webrtc/examples/objc/AppRTCDemo/ARDSignalingMessage.m
index a5ca29576a0c0315194b00b938efc98e26d3be04..3fab185848513b53ab6bbe8190ccfbd6a7ae8524 100644
--- a/webrtc/examples/objc/AppRTCDemo/ARDSignalingMessage.m
+++ b/webrtc/examples/objc/AppRTCDemo/ARDSignalingMessage.m
@@ -16,7 +16,8 @@
#import "RTCIceCandidate+JSON.h"
#import "RTCSessionDescription+JSON.h"
-static NSString const *kARDSignalingMessageTypeKey = @"type";
+static NSString * const kARDSignalingMessageTypeKey = @"type";
+static NSString * const kARDTypeValueRemoveCandidates = @"remove-candidates";
@implementation ARDSignalingMessage
@@ -47,6 +48,12 @@ static NSString const *kARDSignalingMessageTypeKey = @"type";
RTCIceCandidate *candidate =
[RTCIceCandidate candidateFromJSONDictionary:values];
message = [[ARDICECandidateMessage alloc] initWithCandidate:candidate];
+ } else if ([typeString isEqualToString:kARDTypeValueRemoveCandidates]) {
+ RTCLogInfo(@"Received remove-candidates message");
+ NSArray<RTCIceCandidate *> *candidates =
+ [RTCIceCandidate candidatesFromJSONDictionary:values];
+ message = [[ARDICECandidateRemovalMessage alloc]
+ initWithRemovedCandidates:candidates];
} else if ([typeString isEqualToString:@"offer"] ||
[typeString isEqualToString:@"answer"]) {
RTCSessionDescription *description =
@@ -84,6 +91,27 @@ static NSString const *kARDSignalingMessageTypeKey = @"type";
@end
+@implementation ARDICECandidateRemovalMessage
+
+@synthesize candidates = _candidates;
+
+- (instancetype)initWithRemovedCandidates:(
+ NSArray<RTCIceCandidate *> *)candidates {
+ NSParameterAssert(candidates.count);
+ if (self = [super initWithType:kARDSignalingMessageTypeCandidateRemoval]) {
+ _candidates = candidates;
+ }
+ return self;
+}
+
+- (NSData *)JSONData {
+ return
+ [RTCIceCandidate JSONDataForIceCandidates:_candidates
+ withType:kARDTypeValueRemoveCandidates];
+}
+
+@end
+
@implementation ARDSessionDescriptionMessage
@synthesize sessionDescription = _sessionDescription;
« no previous file with comments | « webrtc/examples/objc/AppRTCDemo/ARDSignalingMessage.h ('k') | webrtc/examples/objc/AppRTCDemo/ARDWebSocketChannel.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698